Harald Welte | 136e737 | 2016-05-29 10:53:17 +0900 | [diff] [blame] | 1 | Checking FSM allocation |
Harald Welte | 31c0fef | 2017-04-16 17:26:30 +0200 | [diff] [blame] | 2 | [0;mTest_FSM(my_id){NULL}: Allocated |
Stefan Sperling | 888dc7d | 2018-02-26 19:17:02 +0100 | [diff] [blame] | 3 | [0;mTest_FSM(my_id){NULL}: Received Event EV_B |
| 4 | [0;mTest_FSM(my_id){NULL}: Event EV_B not permitted |
| 5 | [0;mTest_FSM(my_id){NULL}: Received Event EV_A |
Neels Hofmeyr | 050f2d3 | 2018-05-31 15:30:15 +0200 | [diff] [blame] | 6 | [0;mTest_FSM(my_id){NULL}: State change to ONE (no timeout) |
Stefan Sperling | 888dc7d | 2018-02-26 19:17:02 +0100 | [diff] [blame] | 7 | [0;mTest_FSM(my_id){ONE}: Received Event EV_B |
Neels Hofmeyr | 050f2d3 | 2018-05-31 15:30:15 +0200 | [diff] [blame] | 8 | [0;mTest_FSM(my_id){ONE}: State change to TWO (T2342, 1s) |
Harald Welte | 31c0fef | 2017-04-16 17:26:30 +0200 | [diff] [blame] | 9 | [0;mTest_FSM(my_id){TWO}: Timeout of T2342 |
Harald Welte | 136e737 | 2016-05-29 10:53:17 +0900 | [diff] [blame] | 10 | [0;mTimer |
Neels Hofmeyr | d8f175c | 2018-04-09 00:42:22 +0200 | [diff] [blame] | 11 | [0;mTest_FSM(my_id){TWO}: Deallocated |
Neels Hofmeyr | 975ee6b | 2018-04-09 00:42:12 +0200 | [diff] [blame] | 12 | [0;m |
| 13 | --- test_id_api() |
| 14 | Test_FSM{NULL}: Allocated |
| 15 | [0;m osmo_fsm_inst_name() == "Test_FSM" |
Neels Hofmeyr | 71f76a1 | 2018-03-31 16:30:25 +0200 | [diff] [blame] | 16 | osmo_fsm_inst_find_by_name("Test_FSM") == fi |
Neels Hofmeyr | 975ee6b | 2018-04-09 00:42:12 +0200 | [diff] [blame] | 17 | osmo_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 |
| 22 | osmo_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 |
| 27 | osmo_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 |
| 31 | osmo_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 |
| 35 | osmo_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 |
| 40 | osmo_fsm_inst_update_id("") |
Neels Hofmeyr | 6e8c088 | 2018-04-09 02:28:34 +0200 | [diff] [blame] | 41 | Attempting to set illegal id for FSM instance of type 'Test_FSM': "" |
Neels Hofmeyr | 975ee6b | 2018-04-09 00:42:12 +0200 | [diff] [blame] | 42 | [0;m rc == -22, ok |
| 43 | osmo_fsm_inst_name() == "Test_FSM(arbitrary_id)" |
| 44 | osmo_fsm_inst_find_by_name("Test_FSM(arbitrary_id)") == fi |
| 45 | osmo_fsm_inst_update_id("invalid.id") |
Neels Hofmeyr | 6e8c088 | 2018-04-09 02:28:34 +0200 | [diff] [blame] | 46 | Attempting to set illegal id for FSM instance of type 'Test_FSM': "invalid.id" |
Neels Hofmeyr | 975ee6b | 2018-04-09 00:42:12 +0200 | [diff] [blame] | 47 | [0;m rc == -22, ok |
| 48 | osmo_fsm_inst_name() == "Test_FSM(arbitrary_id)" |
| 49 | osmo_fsm_inst_find_by_name("Test_FSM(arbitrary_id)") == fi |
Neels Hofmeyr | a64c45a | 2018-03-31 16:34:49 +0200 | [diff] [blame] | 50 | --- id format tests... |
| 51 | osmo_fsm_inst_update_id_f("format%cid", '.') |
| 52 | Attempting to set illegal id for FSM instance of type 'Test_FSM': "format.id" |
| 53 | [0;m rc == -22, ok |
| 54 | osmo_fsm_inst_name() == "Test_FSM(arbitrary_id)" |
| 55 | osmo_fsm_inst_find_by_name("Test_FSM(arbitrary_id)") == fi |
| 56 | osmo_fsm_inst_update_id_f("%s", "") |
| 57 | Attempting to set illegal id for FSM instance of type 'Test_FSM': "" |
| 58 | [0;m rc == -22, ok |
| 59 | osmo_fsm_inst_name() == "Test_FSM(arbitrary_id)" |
| 60 | osmo_fsm_inst_find_by_name("Test_FSM(arbitrary_id)") == fi |
| 61 | osmo_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 |
| 65 | osmo_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 |
| 69 | osmo_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 |
| 73 | osmo_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 Hofmeyr | 975ee6b | 2018-04-09 00:42:12 +0200 | [diff] [blame] | 77 | |
| 78 | --- test_id_api() done |
| 79 | |
| 80 | Test_FSM(arbitrary_id){NULL}: Terminating (cause = OSMO_FSM_TERM_REQUEST) |
| 81 | [0;mTest_FSM(arbitrary_id){NULL}: Freeing instance |
| 82 | [0;mTest_FSM(arbitrary_id){NULL}: Deallocated |
Neels Hofmeyr | 407df02 | 2018-05-25 18:20:06 +0200 | [diff] [blame] | 83 | [0;m |
| 84 | --- test_state_chg_keep_timer() |
| 85 | Test_FSM{NULL}: Allocated |
Neels Hofmeyr | 050f2d3 | 2018-05-31 15:30:15 +0200 | [diff] [blame] | 86 | [0;mTest_FSM{NULL}: State change to ONE (no timeout) |
| 87 | [0;mTest_FSM{ONE}: State change to TWO (no timeout) |
Neels Hofmeyr | 407df02 | 2018-05-25 18:20:06 +0200 | [diff] [blame] | 88 | [0;mTest_FSM{TWO}: Terminating (cause = OSMO_FSM_TERM_REQUEST) |
| 89 | [0;mTest_FSM{TWO}: Freeing instance |
| 90 | [0;mTest_FSM{TWO}: Deallocated |
| 91 | [0;mTotal time passed: 0.000000 s |
| 92 | Test_FSM{NULL}: Allocated |
Neels Hofmeyr | 050f2d3 | 2018-05-31 15:30:15 +0200 | [diff] [blame] | 93 | [0;mTest_FSM{NULL}: State change to ONE (T10, 10s) |
Neels Hofmeyr | 407df02 | 2018-05-25 18:20:06 +0200 | [diff] [blame] | 94 | [0;mTotal time passed: 2.000342 s |
Neels Hofmeyr | 050f2d3 | 2018-05-31 15:30:15 +0200 | [diff] [blame] | 95 | Test_FSM{ONE}: State change to TWO (keeping T10, 7.999s remaining) |
Neels Hofmeyr | 407df02 | 2018-05-25 18:20:06 +0200 | [diff] [blame] | 96 | [0;mTotal time passed: 2.000342 s |
| 97 | Total time passed: 9.999999 s |
| 98 | Total time passed: 10.000000 s |
| 99 | Test_FSM{TWO}: Timeout of T10 |
| 100 | [0;mTest_FSM{TWO}: Terminating (cause = OSMO_FSM_TERM_REQUEST) |
| 101 | [0;mTest_FSM{TWO}: Freeing instance |
| 102 | [0;mTest_FSM{TWO}: Deallocated |
| 103 | [0;m--- test_state_chg_keep_timer() done |
Neels Hofmeyr | bd5a1dc | 2019-01-28 15:38:09 +0100 | [diff] [blame] | 104 | |
| 105 | --- test_state_chg_T() |
| 106 | Test_FSM{NULL}: Allocated |
Neels Hofmeyr | 050f2d3 | 2018-05-31 15:30:15 +0200 | [diff] [blame] | 107 | [0;mTest_FSM{NULL}: State change to ONE (T42, 23s) |
| 108 | [0;mTest_FSM{ONE}: State change to TWO (no timeout) |
Neels Hofmeyr | bd5a1dc | 2019-01-28 15:38:09 +0100 | [diff] [blame] | 109 | [0;mTest_FSM{TWO}: Terminating (cause = OSMO_FSM_TERM_REQUEST) |
| 110 | [0;mTest_FSM{TWO}: Freeing instance |
| 111 | [0;mTest_FSM{TWO}: Deallocated |
| 112 | [0;mTest_FSM{NULL}: Allocated |
Neels Hofmeyr | 050f2d3 | 2018-05-31 15:30:15 +0200 | [diff] [blame] | 113 | [0;mTest_FSM{NULL}: State change to ONE (T42, 23s) |
| 114 | [0;mTest_FSM{ONE}: State change to TWO (no timeout) |
Neels Hofmeyr | bd5a1dc | 2019-01-28 15:38:09 +0100 | [diff] [blame] | 115 | [0;mTest_FSM{TWO}: Terminating (cause = OSMO_FSM_TERM_REQUEST) |
| 116 | [0;mTest_FSM{TWO}: Freeing instance |
| 117 | [0;mTest_FSM{TWO}: Deallocated |
| 118 | [0;m--- test_state_chg_T() done |