blob: fffb9136dee9cd4d34003cbe8d84812eb4eb177a [file] [log] [blame]
Harald Welte136e7372016-05-29 10:53:17 +09001Checking FSM allocation
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +02002Test_FSM(my_id){NULL}: Allocated
3Test_FSM(my_id){NULL}: Received Event EV_B
4Test_FSM(my_id){NULL}: Event EV_B not permitted
5Test_FSM(my_id){NULL}: Received Event EV_A
Vadim Yanitskiy477d99f2023-12-27 04:46:51 +07006Test_FSM(my_id){NULL}: test_fsm_onleave() next_state=ONE
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +02007Test_FSM(my_id){NULL}: State change to ONE (no timeout)
Vadim Yanitskiy477d99f2023-12-27 04:46:51 +07008Test_FSM(my_id){ONE}: test_fsm_onenter() prev_state=NULL
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +02009Test_FSM(my_id){ONE}: Received Event EV_B
Vadim Yanitskiy477d99f2023-12-27 04:46:51 +070010Test_FSM(my_id){ONE}: test_fsm_onleave() next_state=TWO
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +020011Test_FSM(my_id){ONE}: State change to TWO (T2342, 1s)
Vadim Yanitskiy477d99f2023-12-27 04:46:51 +070012Test_FSM(my_id){TWO}: test_fsm_onenter() prev_state=ONE
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +020013Test_FSM(my_id){TWO}: Timeout of T2342
14Timer
15Test_FSM(my_id){TWO}: Deallocated
16
Neels Hofmeyr975ee6b2018-04-09 00:42:12 +020017--- test_id_api()
18Test_FSM{NULL}: Allocated
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +020019 osmo_fsm_inst_name() == "Test_FSM"
Neels Hofmeyr71f76a12018-03-31 16:30:25 +020020 osmo_fsm_inst_find_by_name("Test_FSM") == fi
Neels Hofmeyr975ee6b2018-04-09 00:42:12 +020021osmo_fsm_inst_update_id("my_id")
22 rc == 0, ok
23 osmo_fsm_inst_name() == "Test_FSM(my_id)"
24 osmo_fsm_inst_find_by_name("Test_FSM(my_id)") == fi
25 osmo_fsm_inst_find_by_id("my_id") == fi
26osmo_fsm_inst_update_id("another_id")
27 rc == 0, ok
28 osmo_fsm_inst_name() == "Test_FSM(another_id)"
29 osmo_fsm_inst_find_by_name("Test_FSM(another_id)") == fi
30 osmo_fsm_inst_find_by_id("another_id") == fi
31osmo_fsm_inst_update_id(NULL)
32 rc == 0, ok
33 osmo_fsm_inst_name() == "Test_FSM"
34 osmo_fsm_inst_find_by_name("Test_FSM") == fi
35osmo_fsm_inst_update_id(NULL)
36 rc == 0, ok
37 osmo_fsm_inst_name() == "Test_FSM"
38 osmo_fsm_inst_find_by_name("Test_FSM") == fi
39osmo_fsm_inst_update_id("arbitrary_id")
40 rc == 0, ok
41 osmo_fsm_inst_name() == "Test_FSM(arbitrary_id)"
42 osmo_fsm_inst_find_by_name("Test_FSM(arbitrary_id)") == fi
43 osmo_fsm_inst_find_by_id("arbitrary_id") == fi
44osmo_fsm_inst_update_id("")
Neels Hofmeyr6e8c0882018-04-09 02:28:34 +020045Attempting to set illegal id for FSM instance of type 'Test_FSM': ""
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +020046 rc == -22, ok
Neels Hofmeyr975ee6b2018-04-09 00:42:12 +020047 osmo_fsm_inst_name() == "Test_FSM(arbitrary_id)"
48 osmo_fsm_inst_find_by_name("Test_FSM(arbitrary_id)") == fi
49osmo_fsm_inst_update_id("invalid.id")
Neels Hofmeyr6e8c0882018-04-09 02:28:34 +020050Attempting to set illegal id for FSM instance of type 'Test_FSM': "invalid.id"
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +020051 rc == -22, ok
Neels Hofmeyr975ee6b2018-04-09 00:42:12 +020052 osmo_fsm_inst_name() == "Test_FSM(arbitrary_id)"
53 osmo_fsm_inst_find_by_name("Test_FSM(arbitrary_id)") == fi
Neels Hofmeyra64c45a2018-03-31 16:34:49 +020054--- id format tests...
55osmo_fsm_inst_update_id_f("format%cid", '.')
56Attempting to set illegal id for FSM instance of type 'Test_FSM': "format.id"
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +020057 rc == -22, ok
Neels Hofmeyra64c45a2018-03-31 16:34:49 +020058 osmo_fsm_inst_name() == "Test_FSM(arbitrary_id)"
59 osmo_fsm_inst_find_by_name("Test_FSM(arbitrary_id)") == fi
60osmo_fsm_inst_update_id_f("%s", "")
61Attempting to set illegal id for FSM instance of type 'Test_FSM': ""
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +020062 rc == -22, ok
Neels Hofmeyra64c45a2018-03-31 16:34:49 +020063 osmo_fsm_inst_name() == "Test_FSM(arbitrary_id)"
64 osmo_fsm_inst_find_by_name("Test_FSM(arbitrary_id)") == fi
65osmo_fsm_inst_update_id_f("format%xid%d", 0x23, 42)
66 rc == 0, ok
67 osmo_fsm_inst_name() == "Test_FSM(format23id42)"
68 osmo_fsm_inst_find_by_name("Test_FSM(format23id42)") == fi
69osmo_fsm_inst_update_id_f(NULL, )
70 rc == 0, ok
71 osmo_fsm_inst_name() == "Test_FSM"
72 osmo_fsm_inst_find_by_name("Test_FSM") == fi
73osmo_fsm_inst_update_id_f(NULL, )
74 rc == 0, ok
75 osmo_fsm_inst_name() == "Test_FSM"
76 osmo_fsm_inst_find_by_name("Test_FSM") == fi
77osmo_fsm_inst_update_id_f("%s%c%s", "arbitrary", '_', "id")
78 rc == 0, ok
79 osmo_fsm_inst_name() == "Test_FSM(arbitrary_id)"
80 osmo_fsm_inst_find_by_name("Test_FSM(arbitrary_id)") == fi
Neels Hofmeyr975ee6b2018-04-09 00:42:12 +020081
82--- test_id_api() done
83
84Test_FSM(arbitrary_id){NULL}: Terminating (cause = OSMO_FSM_TERM_REQUEST)
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +020085Test_FSM(arbitrary_id){NULL}: Freeing instance
86Test_FSM(arbitrary_id){NULL}: Deallocated
87
Neels Hofmeyr407df022018-05-25 18:20:06 +020088--- test_state_chg_keep_timer()
89Test_FSM{NULL}: Allocated
Vadim Yanitskiy477d99f2023-12-27 04:46:51 +070090Test_FSM{NULL}: test_fsm_onleave() next_state=ONE
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +020091Test_FSM{NULL}: State change to ONE (no timeout)
Vadim Yanitskiy477d99f2023-12-27 04:46:51 +070092Test_FSM{ONE}: test_fsm_onenter() prev_state=NULL
93Test_FSM{ONE}: test_fsm_onleave() next_state=TWO
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +020094Test_FSM{ONE}: State change to TWO (no timeout)
Vadim Yanitskiy477d99f2023-12-27 04:46:51 +070095Test_FSM{TWO}: test_fsm_onenter() prev_state=ONE
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +020096Test_FSM{TWO}: Terminating (cause = OSMO_FSM_TERM_REQUEST)
97Test_FSM{TWO}: Freeing instance
98Test_FSM{TWO}: Deallocated
99Total time passed: 0.000000 s
Neels Hofmeyr407df022018-05-25 18:20:06 +0200100Test_FSM{NULL}: Allocated
Vadim Yanitskiy477d99f2023-12-27 04:46:51 +0700101Test_FSM{NULL}: test_fsm_onleave() next_state=ONE
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +0200102Test_FSM{NULL}: State change to ONE (T10, 10s)
Vadim Yanitskiy477d99f2023-12-27 04:46:51 +0700103Test_FSM{ONE}: test_fsm_onenter() prev_state=NULL
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +0200104Total time passed: 2.000342 s
Vadim Yanitskiy477d99f2023-12-27 04:46:51 +0700105Test_FSM{ONE}: test_fsm_onleave() next_state=TWO
Neels Hofmeyr050f2d32018-05-31 15:30:15 +0200106Test_FSM{ONE}: State change to TWO (keeping T10, 7.999s remaining)
Vadim Yanitskiy477d99f2023-12-27 04:46:51 +0700107Test_FSM{TWO}: test_fsm_onenter() prev_state=ONE
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +0200108Total time passed: 2.000342 s
Neels Hofmeyr407df022018-05-25 18:20:06 +0200109Total time passed: 9.999999 s
110Total time passed: 10.000000 s
111Test_FSM{TWO}: Timeout of T10
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +0200112Test_FSM{TWO}: Terminating (cause = OSMO_FSM_TERM_REQUEST)
113Test_FSM{TWO}: Freeing instance
114Test_FSM{TWO}: Deallocated
115--- test_state_chg_keep_timer() done
Neels Hofmeyrbd5a1dc2019-01-28 15:38:09 +0100116
117--- test_state_chg_T()
118Test_FSM{NULL}: Allocated
Vadim Yanitskiy477d99f2023-12-27 04:46:51 +0700119Test_FSM{NULL}: test_fsm_onleave() next_state=ONE
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +0200120Test_FSM{NULL}: State change to ONE (T42, 23s)
Vadim Yanitskiy477d99f2023-12-27 04:46:51 +0700121Test_FSM{ONE}: test_fsm_onenter() prev_state=NULL
122Test_FSM{ONE}: test_fsm_onleave() next_state=TWO
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +0200123Test_FSM{ONE}: State change to TWO (no timeout)
Vadim Yanitskiy477d99f2023-12-27 04:46:51 +0700124Test_FSM{TWO}: test_fsm_onenter() prev_state=ONE
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +0200125Test_FSM{TWO}: Terminating (cause = OSMO_FSM_TERM_REQUEST)
126Test_FSM{TWO}: Freeing instance
127Test_FSM{TWO}: Deallocated
128Test_FSM{NULL}: Allocated
Vadim Yanitskiy477d99f2023-12-27 04:46:51 +0700129Test_FSM{NULL}: test_fsm_onleave() next_state=ONE
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +0200130Test_FSM{NULL}: State change to ONE (T42, 23s)
Vadim Yanitskiy477d99f2023-12-27 04:46:51 +0700131Test_FSM{ONE}: test_fsm_onenter() prev_state=NULL
132Test_FSM{ONE}: test_fsm_onleave() next_state=TWO
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +0200133Test_FSM{ONE}: State change to TWO (no timeout)
Vadim Yanitskiy477d99f2023-12-27 04:46:51 +0700134Test_FSM{TWO}: test_fsm_onenter() prev_state=ONE
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +0200135Test_FSM{TWO}: Terminating (cause = OSMO_FSM_TERM_REQUEST)
136Test_FSM{TWO}: Freeing instance
137Test_FSM{TWO}: Deallocated
138--- test_state_chg_T() done
Vadim Yanitskiyd2964a92022-07-19 06:08:42 +0700139
140--- test_state_chg_Ts()
141Total time passed: 0.000000 s
142Test_FSM{NULL}: Allocated
Vadim Yanitskiy477d99f2023-12-27 04:46:51 +0700143Test_FSM{NULL}: test_fsm_onleave() next_state=ONE
Vadim Yanitskiyd2964a92022-07-19 06:08:42 +0700144Test_FSM{NULL}: State change to ONE (T4242, 8s)
Vadim Yanitskiy477d99f2023-12-27 04:46:51 +0700145Test_FSM{ONE}: test_fsm_onenter() prev_state=NULL
Vadim Yanitskiyd2964a92022-07-19 06:08:42 +0700146Total time passed: 3.000000 s
147Total time passed: 5.500000 s
148Total time passed: 8.000000 s
149Test_FSM{ONE}: Timeout of T4242
150Test_FSM{ONE}: Terminating (cause = OSMO_FSM_TERM_REQUEST)
151Test_FSM{ONE}: Freeing instance
152Test_FSM{ONE}: Deallocated
153--- test_state_chg_Ts() done
154
155--- test_state_chg_Tms()
156Total time passed: 0.000000 s
157Test_FSM{NULL}: Allocated
Vadim Yanitskiy477d99f2023-12-27 04:46:51 +0700158Test_FSM{NULL}: test_fsm_onleave() next_state=ONE
Vadim Yanitskiyd2964a92022-07-19 06:08:42 +0700159Test_FSM{NULL}: State change to ONE (T4242, 1337ms)
Vadim Yanitskiy477d99f2023-12-27 04:46:51 +0700160Test_FSM{ONE}: test_fsm_onenter() prev_state=NULL
Vadim Yanitskiyd2964a92022-07-19 06:08:42 +0700161Total time passed: 0.500000 s
162Total time passed: 0.750000 s
163Total time passed: 1.100000 s
Vadim Yanitskiyd2964a92022-07-19 06:08:42 +0700164Total time passed: 1.300000 s
165Total time passed: 1.337000 s
Vadim Yanitskiy76bdbd42022-07-19 06:20:55 +0700166Test_FSM{ONE}: Timeout of T4242
Vadim Yanitskiyd2964a92022-07-19 06:08:42 +0700167Test_FSM{ONE}: Terminating (cause = OSMO_FSM_TERM_REQUEST)
168Test_FSM{ONE}: Freeing instance
169Test_FSM{ONE}: Deallocated
170--- test_state_chg_Tms() done