blob: 4cc5ca405a3662ddd94b3fa41ab82fd5536431e9 [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
6Test_FSM(my_id){NULL}: State change to ONE (no timeout)
7Test_FSM(my_id){ONE}: Received Event EV_B
8Test_FSM(my_id){ONE}: State change to TWO (T2342, 1s)
9Test_FSM(my_id){TWO}: Timeout of T2342
10Timer
11Test_FSM(my_id){TWO}: Deallocated
12
Neels Hofmeyr975ee6b2018-04-09 00:42:12 +020013--- test_id_api()
14Test_FSM{NULL}: Allocated
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +020015 osmo_fsm_inst_name() == "Test_FSM"
Neels Hofmeyr71f76a12018-03-31 16:30:25 +020016 osmo_fsm_inst_find_by_name("Test_FSM") == fi
Neels Hofmeyr975ee6b2018-04-09 00:42:12 +020017osmo_fsm_inst_update_id("my_id")
18 rc == 0, ok
19 osmo_fsm_inst_name() == "Test_FSM(my_id)"
20 osmo_fsm_inst_find_by_name("Test_FSM(my_id)") == fi
21 osmo_fsm_inst_find_by_id("my_id") == fi
22osmo_fsm_inst_update_id("another_id")
23 rc == 0, ok
24 osmo_fsm_inst_name() == "Test_FSM(another_id)"
25 osmo_fsm_inst_find_by_name("Test_FSM(another_id)") == fi
26 osmo_fsm_inst_find_by_id("another_id") == fi
27osmo_fsm_inst_update_id(NULL)
28 rc == 0, ok
29 osmo_fsm_inst_name() == "Test_FSM"
30 osmo_fsm_inst_find_by_name("Test_FSM") == 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("arbitrary_id")
36 rc == 0, ok
37 osmo_fsm_inst_name() == "Test_FSM(arbitrary_id)"
38 osmo_fsm_inst_find_by_name("Test_FSM(arbitrary_id)") == fi
39 osmo_fsm_inst_find_by_id("arbitrary_id") == fi
40osmo_fsm_inst_update_id("")
Neels Hofmeyr6e8c0882018-04-09 02:28:34 +020041Attempting to set illegal id for FSM instance of type 'Test_FSM': ""
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +020042 rc == -22, ok
Neels Hofmeyr975ee6b2018-04-09 00:42:12 +020043 osmo_fsm_inst_name() == "Test_FSM(arbitrary_id)"
44 osmo_fsm_inst_find_by_name("Test_FSM(arbitrary_id)") == fi
45osmo_fsm_inst_update_id("invalid.id")
Neels Hofmeyr6e8c0882018-04-09 02:28:34 +020046Attempting to set illegal id for FSM instance of type 'Test_FSM': "invalid.id"
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +020047 rc == -22, ok
Neels Hofmeyr975ee6b2018-04-09 00:42:12 +020048 osmo_fsm_inst_name() == "Test_FSM(arbitrary_id)"
49 osmo_fsm_inst_find_by_name("Test_FSM(arbitrary_id)") == fi
Neels Hofmeyra64c45a2018-03-31 16:34:49 +020050--- id format tests...
51osmo_fsm_inst_update_id_f("format%cid", '.')
52Attempting to set illegal id for FSM instance of type 'Test_FSM': "format.id"
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +020053 rc == -22, ok
Neels Hofmeyra64c45a2018-03-31 16:34:49 +020054 osmo_fsm_inst_name() == "Test_FSM(arbitrary_id)"
55 osmo_fsm_inst_find_by_name("Test_FSM(arbitrary_id)") == fi
56osmo_fsm_inst_update_id_f("%s", "")
57Attempting to set illegal id for FSM instance of type 'Test_FSM': ""
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +020058 rc == -22, ok
Neels Hofmeyra64c45a2018-03-31 16:34:49 +020059 osmo_fsm_inst_name() == "Test_FSM(arbitrary_id)"
60 osmo_fsm_inst_find_by_name("Test_FSM(arbitrary_id)") == fi
61osmo_fsm_inst_update_id_f("format%xid%d", 0x23, 42)
62 rc == 0, ok
63 osmo_fsm_inst_name() == "Test_FSM(format23id42)"
64 osmo_fsm_inst_find_by_name("Test_FSM(format23id42)") == fi
65osmo_fsm_inst_update_id_f(NULL, )
66 rc == 0, ok
67 osmo_fsm_inst_name() == "Test_FSM"
68 osmo_fsm_inst_find_by_name("Test_FSM") == 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("%s%c%s", "arbitrary", '_', "id")
74 rc == 0, ok
75 osmo_fsm_inst_name() == "Test_FSM(arbitrary_id)"
76 osmo_fsm_inst_find_by_name("Test_FSM(arbitrary_id)") == fi
Neels Hofmeyr975ee6b2018-04-09 00:42:12 +020077
78--- test_id_api() done
79
80Test_FSM(arbitrary_id){NULL}: Terminating (cause = OSMO_FSM_TERM_REQUEST)
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +020081Test_FSM(arbitrary_id){NULL}: Freeing instance
82Test_FSM(arbitrary_id){NULL}: Deallocated
83
Neels Hofmeyr407df022018-05-25 18:20:06 +020084--- test_state_chg_keep_timer()
85Test_FSM{NULL}: Allocated
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +020086Test_FSM{NULL}: State change to ONE (no timeout)
87Test_FSM{ONE}: State change to TWO (no timeout)
88Test_FSM{TWO}: Terminating (cause = OSMO_FSM_TERM_REQUEST)
89Test_FSM{TWO}: Freeing instance
90Test_FSM{TWO}: Deallocated
91Total time passed: 0.000000 s
Neels Hofmeyr407df022018-05-25 18:20:06 +020092Test_FSM{NULL}: Allocated
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +020093Test_FSM{NULL}: State change to ONE (T10, 10s)
94Total time passed: 2.000342 s
Neels Hofmeyr050f2d32018-05-31 15:30:15 +020095Test_FSM{ONE}: State change to TWO (keeping T10, 7.999s remaining)
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +020096Total time passed: 2.000342 s
Neels Hofmeyr407df022018-05-25 18:20:06 +020097Total time passed: 9.999999 s
98Total time passed: 10.000000 s
99Test_FSM{TWO}: Timeout of T10
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +0200100Test_FSM{TWO}: Terminating (cause = OSMO_FSM_TERM_REQUEST)
101Test_FSM{TWO}: Freeing instance
102Test_FSM{TWO}: Deallocated
103--- test_state_chg_keep_timer() done
Neels Hofmeyrbd5a1dc2019-01-28 15:38:09 +0100104
105--- test_state_chg_T()
106Test_FSM{NULL}: Allocated
Pau Espin Pedroleb028fa2020-07-20 16:46:54 +0200107Test_FSM{NULL}: State change to ONE (T42, 23s)
108Test_FSM{ONE}: State change to TWO (no timeout)
109Test_FSM{TWO}: Terminating (cause = OSMO_FSM_TERM_REQUEST)
110Test_FSM{TWO}: Freeing instance
111Test_FSM{TWO}: Deallocated
112Test_FSM{NULL}: Allocated
113Test_FSM{NULL}: State change to ONE (T42, 23s)
114Test_FSM{ONE}: State change to TWO (no timeout)
115Test_FSM{TWO}: Terminating (cause = OSMO_FSM_TERM_REQUEST)
116Test_FSM{TWO}: Freeing instance
117Test_FSM{TWO}: Deallocated
118--- test_state_chg_T() done