Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 1 | module PCU_Tests_RAW_SNS { |
| 2 | |
| 3 | import from Osmocom_Types all; |
| 4 | import from PCU_Tests all; |
| 5 | import from PCU_Tests_RAW all; |
Harald Welte | c4d7beb | 2019-02-21 18:21:01 +0100 | [diff] [blame] | 6 | import from Osmocom_Gb_Types all; |
| 7 | import from NS_CodecPort all; |
| 8 | import from NS_Types all; |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 9 | |
| 10 | /********************************************************************************** |
| 11 | * Modern Gb/IP bring-up test cases using IP Sub-Network Service (SNS) |
| 12 | **********************************************************************************/ |
| 13 | |
Harald Welte | c4d7beb | 2019-02-21 18:21:01 +0100 | [diff] [blame] | 14 | /* perform inbound SNS-SIZE procedure */ |
Harald Welte | bf76824 | 2019-02-21 22:19:21 +0100 | [diff] [blame] | 15 | function f_incoming_sns_size(template (omit) NsCause cause := omit, integer idx := 0) |
| 16 | runs on RAW_NS_CT { |
Harald Welte | b63c3a1 | 2019-02-22 23:27:12 +0100 | [diff] [blame] | 17 | log("f_incoming_sns_size(idx=", idx, ")"); |
Harald Welte | c4d7beb | 2019-02-21 18:21:01 +0100 | [diff] [blame] | 18 | var PDU_NS rx; |
| 19 | /* expect one single SNS-SIZE with RESET flag; one remote v4 EP; no v6 EP */ |
Harald Welte | bf76824 | 2019-02-21 22:19:21 +0100 | [diff] [blame] | 20 | rx := f_ns_exp(tr_SNS_SIZE(g_nsconfig[idx].nsei, rst_flag := true, max_nsvcs := 8, |
| 21 | num_v4 := 4, num_v6 := omit), idx); |
| 22 | NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_SIZE_ACK(g_nsconfig[idx].nsei, cause))); |
Harald Welte | c4d7beb | 2019-02-21 18:21:01 +0100 | [diff] [blame] | 23 | } |
| 24 | |
| 25 | /* perform outbound SNS-SIZE procedure */ |
Harald Welte | bf76824 | 2019-02-21 22:19:21 +0100 | [diff] [blame] | 26 | function f_outgoing_sns_size(template (omit) NsCause cause := omit, integer idx:= 0) |
| 27 | runs on RAW_NS_CT { |
Harald Welte | b63c3a1 | 2019-02-22 23:27:12 +0100 | [diff] [blame] | 28 | log("f_outgoing_sns_size(idx=", idx, ")"); |
Harald Welte | c4d7beb | 2019-02-21 18:21:01 +0100 | [diff] [blame] | 29 | var PDU_NS rx; |
Harald Welte | bf76824 | 2019-02-21 22:19:21 +0100 | [diff] [blame] | 30 | NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_SIZE(g_nsconfig[idx].nsei, rst_flag := true, max_nsvcs := 1, |
Harald Welte | c4d7beb | 2019-02-21 18:21:01 +0100 | [diff] [blame] | 31 | num_v4 := 1, num_v6 := omit) |
| 32 | )); |
| 33 | /* expect one single SNS-SIZE with RESET flag; one remote v4 EP; no v6 EP */ |
Harald Welte | bf76824 | 2019-02-21 22:19:21 +0100 | [diff] [blame] | 34 | rx := f_ns_exp(tr_SNS_SIZE_ACK(g_nsconfig[idx].nsei, cause), idx); |
Harald Welte | c4d7beb | 2019-02-21 18:21:01 +0100 | [diff] [blame] | 35 | } |
| 36 | |
| 37 | /* perform inbound SNS-CONFIG procedure */ |
Harald Welte | bf76824 | 2019-02-21 22:19:21 +0100 | [diff] [blame] | 38 | function f_incoming_sns_config(template (omit) NsCause cause := omit, integer idx := 0) |
| 39 | runs on RAW_NS_CT { |
Harald Welte | b63c3a1 | 2019-02-22 23:27:12 +0100 | [diff] [blame] | 40 | log("f_incoming_sns_config(idx=", idx, ")"); |
Harald Welte | c4d7beb | 2019-02-21 18:21:01 +0100 | [diff] [blame] | 41 | var PDU_NS rx; |
Harald Welte | 7e6a35c | 2019-03-16 18:36:08 +0100 | [diff] [blame] | 42 | var template IP4_Elements v4_elem := { tr_SNS_IPv4(mp_nsconfig.remote_ip, |
| 43 | mp_nsconfig.remote_udp_port) }; |
| 44 | rx := f_ns_exp(tr_SNS_CONFIG(g_nsconfig[idx].nsei, end_flag := true, v4 := v4_elem), idx); |
Harald Welte | bf76824 | 2019-02-21 22:19:21 +0100 | [diff] [blame] | 45 | NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CONFIG_ACK(g_nsconfig[idx].nsei, cause))); |
Harald Welte | c4d7beb | 2019-02-21 18:21:01 +0100 | [diff] [blame] | 46 | } |
| 47 | |
| 48 | /* perform outbound SNS-CONFIG procedure */ |
Harald Welte | bf76824 | 2019-02-21 22:19:21 +0100 | [diff] [blame] | 49 | function f_outgoing_sns_config(template (omit) NsCause cause := omit, integer idx := 0) |
| 50 | runs on RAW_NS_CT { |
Harald Welte | b63c3a1 | 2019-02-22 23:27:12 +0100 | [diff] [blame] | 51 | log("f_outgoing_sns_config(idx=", idx, ")"); |
Harald Welte | c4d7beb | 2019-02-21 18:21:01 +0100 | [diff] [blame] | 52 | var PDU_NS rx; |
Harald Welte | bf76824 | 2019-02-21 22:19:21 +0100 | [diff] [blame] | 53 | var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(g_nsconfig[idx].local_ip, |
| 54 | g_nsconfig[idx].local_udp_port) } |
| 55 | NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CONFIG(g_nsconfig[idx].nsei, true, v4))); |
| 56 | rx := f_ns_exp(tr_SNS_CONFIG_ACK(g_nsconfig[idx].nsei, cause), idx); |
Harald Welte | c4d7beb | 2019-02-21 18:21:01 +0100 | [diff] [blame] | 57 | } |
| 58 | |
Harald Welte | bf76824 | 2019-02-21 22:19:21 +0100 | [diff] [blame] | 59 | /* perform outbound SNS-CONFIG procedure (separate endpoints: 1 for control, 1 for user */ |
| 60 | function f_outgoing_sns_config_1c1u(template (omit) NsCause cause := omit, integer idx := 0) |
| 61 | runs on RAW_NS_CT { |
Harald Welte | b63c3a1 | 2019-02-22 23:27:12 +0100 | [diff] [blame] | 62 | log("f_outgoing_sns_config_1c1u(idx=", idx, ")"); |
Harald Welte | bf76824 | 2019-02-21 22:19:21 +0100 | [diff] [blame] | 63 | var PDU_NS rx; |
| 64 | var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(g_nsconfig[0].local_ip, |
| 65 | g_nsconfig[0].local_udp_port, 1, 0), |
| 66 | ts_SNS_IPv4(g_nsconfig[1].local_ip, |
| 67 | g_nsconfig[1].local_udp_port, 0, 1) }; |
| 68 | NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CONFIG(g_nsconfig[idx].nsei, true, v4))); |
| 69 | rx := f_ns_exp(tr_SNS_CONFIG_ACK(g_nsconfig[idx].nsei, cause), idx); |
| 70 | } |
| 71 | |
Harald Welte | ecd159e | 2019-03-16 13:36:07 +0100 | [diff] [blame] | 72 | /* perform outbound SNS-CONFIG procedure (separate endpoints: 1 for control, 1 for user */ |
| 73 | function f_outgoing_sns_config_1c1u_separate(template (omit) NsCause cause := omit, integer idx := 0) |
| 74 | runs on RAW_NS_CT { |
| 75 | log("f_outgoing_sns_config_1c1u_separate(idx=", idx, ")"); |
| 76 | var PDU_NS rx; |
| 77 | var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(g_nsconfig[1].local_ip, |
| 78 | g_nsconfig[1].local_udp_port, 1, 0), |
| 79 | ts_SNS_IPv4(g_nsconfig[2].local_ip, |
| 80 | g_nsconfig[2].local_udp_port, 0, 1) }; |
| 81 | NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CONFIG(g_nsconfig[idx].nsei, true, v4))); |
| 82 | rx := f_ns_exp(tr_SNS_CONFIG_ACK(g_nsconfig[idx].nsei, cause), idx); |
| 83 | } |
| 84 | |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 85 | function f_outgoing_sns_add(integer idx_add, uint8_t w_sig := 1, uint8_t w_user := 1, integer idx := 0) |
| 86 | runs on RAW_NS_CT { |
| 87 | log("f_outgoing_sns_add(idx_add=", idx_add, ")"); |
| 88 | var PDU_NS rx; |
| 89 | var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(g_nsconfig[idx_add].local_ip, |
| 90 | g_nsconfig[idx_add].local_udp_port, |
| 91 | w_sig, w_user) }; |
| 92 | NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_ADD(g_nsconfig[idx].nsei, 23, v4))); |
| 93 | rx := f_ns_exp(tr_SNS_ACK(g_nsconfig[idx].nsei, 23, omit, v4)); |
| 94 | } |
| 95 | |
| 96 | function f_outgoing_sns_del(integer idx_del, uint8_t w_sig := 1, uint8_t w_user := 1, integer idx := 0) |
| 97 | runs on RAW_NS_CT { |
| 98 | log("f_outgoing_sns_del(idx_del=", idx_del, ")"); |
| 99 | var PDU_NS rx; |
| 100 | var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(g_nsconfig[idx_del].local_ip, |
| 101 | g_nsconfig[idx_del].local_udp_port, |
| 102 | w_sig, w_user) }; |
| 103 | NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_DEL(g_nsconfig[idx].nsei, 24, omit, v4))); |
| 104 | rx := f_ns_exp(tr_SNS_ACK(g_nsconfig[idx].nsei, 24, omit, v4)); |
| 105 | } |
| 106 | |
Harald Welte | 7209955 | 2019-02-23 15:09:22 +0100 | [diff] [blame] | 107 | function f_outgoing_sns_chg_weight(integer idx_chg, uint8_t w_sig, uint8_t w_user, integer idx := 0) |
| 108 | runs on RAW_NS_CT { |
| 109 | log("f_outgoing_sns_chg_weight(idx_chg=", idx_chg, ")"); |
| 110 | var PDU_NS rx; |
| 111 | var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(g_nsconfig[idx_chg].local_ip, |
| 112 | g_nsconfig[idx_chg].local_udp_port, |
| 113 | w_sig, w_user) }; |
| 114 | NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CHG_WEIGHT(g_nsconfig[idx].nsei, 25, v4))); |
| 115 | rx := f_ns_exp(tr_SNS_ACK(g_nsconfig[idx].nsei, 25, omit, v4)); |
| 116 | } |
| 117 | |
| 118 | |
| 119 | |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 120 | |
Harald Welte | bf76824 | 2019-02-21 22:19:21 +0100 | [diff] [blame] | 121 | |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 122 | /* PCU-originated SNS-SIZE: successful case */ |
Harald Welte | ea3c7e9 | 2019-03-01 19:34:55 +0100 | [diff] [blame] | 123 | testcase TC_sns_po_size_success() runs on RAW_Test_CT { |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 124 | f_init_ns_codec(); |
| 125 | f_init_pcuif(); |
| 126 | f_incoming_sns_size(); |
| 127 | f_sleep(1.0); |
| 128 | setverdict(pass); |
| 129 | } |
| 130 | |
| 131 | /* PCU-originated SNS-SIZE: NACK from our side */ |
Harald Welte | ea3c7e9 | 2019-03-01 19:34:55 +0100 | [diff] [blame] | 132 | testcase TC_sns_po_size_nack() runs on RAW_Test_CT { |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 133 | f_init_ns_codec(); |
| 134 | f_init_pcuif(); |
| 135 | f_incoming_sns_size(NS_CAUSE_PROTOCOL_ERROR_UNSPEIFIED); |
| 136 | /* FIXME: ensure we don't get a SNS-CONFIG */ |
| 137 | /* FIXME: ensure we get re-transmitted SNS-SIZE attempts */ |
| 138 | f_sleep(10.0); |
| 139 | setverdict(pass); |
| 140 | } |
| 141 | |
| 142 | /* PCU-originated SNS-CONFIG: successful case */ |
Harald Welte | ea3c7e9 | 2019-03-01 19:34:55 +0100 | [diff] [blame] | 143 | testcase TC_sns_po_config_success() runs on RAW_Test_CT { |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 144 | f_init_ns_codec(); |
| 145 | f_init_pcuif(); |
| 146 | f_incoming_sns_size(); |
| 147 | f_incoming_sns_config(); |
| 148 | f_sleep(1.0); |
| 149 | setverdict(pass); |
| 150 | } |
| 151 | |
| 152 | /* PCU-originated SNS-CONFIG: successful case */ |
Harald Welte | ea3c7e9 | 2019-03-01 19:34:55 +0100 | [diff] [blame] | 153 | testcase TC_sns_po_config_nack() runs on RAW_Test_CT { |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 154 | f_init_ns_codec(); |
| 155 | f_init_pcuif(); |
| 156 | f_incoming_sns_size(); |
| 157 | f_incoming_sns_config(NS_CAUSE_PROTOCOL_ERROR_UNSPEIFIED); |
| 158 | /* FIXME: ensure we get re-transmitted SNS-CONFIG attempts */ |
| 159 | f_sleep(10.0); |
| 160 | setverdict(pass); |
| 161 | } |
| 162 | |
| 163 | |
| 164 | /* SGSN-originated SNS-SIZE: successful case */ |
Harald Welte | ea3c7e9 | 2019-03-01 19:34:55 +0100 | [diff] [blame] | 165 | testcase TC_sns_so_config_success() runs on RAW_Test_CT { |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 166 | f_init_ns_codec(); |
| 167 | f_init_pcuif(); |
| 168 | f_incoming_sns_size(); |
| 169 | f_incoming_sns_config(); |
| 170 | f_outgoing_sns_config(); |
| 171 | |
| 172 | /* wait for one ALIVE cycle, then ACK any further ALIVE in the background */ |
| 173 | as_rx_alive_tx_ack(oneshot := true); |
| 174 | activate(as_rx_alive_tx_ack()); |
| 175 | |
| 176 | f_outgoing_ns_alive(); |
| 177 | |
| 178 | /* Expect BVC-RESET for signaling (0) and ptp BVCI */ |
| 179 | as_rx_bvc_reset_tx_ack(0, oneshot := true); |
| 180 | as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvci, oneshot := true); |
| 181 | as_rx_bvc_unblock_tx_ack(mp_gb_cfg.bvci, oneshot := true); |
| 182 | |
| 183 | /* wait for one FLOW-CONTROL BVC and then ACK any further in the future */ |
Harald Welte | 33ad57b | 2019-03-15 17:14:14 +0100 | [diff] [blame] | 184 | as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvci, oneshot := true); |
| 185 | activate(as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvci)); |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 186 | setverdict(pass); |
| 187 | } |
| 188 | |
Harald Welte | ea3c7e9 | 2019-03-01 19:34:55 +0100 | [diff] [blame] | 189 | private function f_sns_bringup_1c1u() runs on RAW_Test_CT { |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 190 | /* Activate two NS codec ports */ |
| 191 | f_init_ns_codec(); |
| 192 | f_init_ns_codec(1); |
| 193 | f_init_pcuif(); |
| 194 | /* Perform Size + BSS-originated config */ |
| 195 | f_incoming_sns_size(); |
| 196 | f_incoming_sns_config(); |
| 197 | /* perform SGSN-originated config using idx==0 for signalling and idx==1 for user traffic */ |
| 198 | f_outgoing_sns_config_1c1u(); |
| 199 | |
| 200 | /* wait for one ALIVE cycle, then ACK any further ALIVE in the background |
| 201 | * for both NS-VCs */ |
| 202 | as_rx_alive_tx_ack(oneshot := true, idx := 0); |
| 203 | activate(as_rx_alive_tx_ack(idx := 0)); |
| 204 | as_rx_alive_tx_ack(oneshot := true, idx := 1); |
| 205 | activate(as_rx_alive_tx_ack(idx := 1)); |
| 206 | |
| 207 | /* perform outgoing ALIVE procedure for both NS-VCs */ |
| 208 | f_outgoing_ns_alive(0); |
| 209 | f_outgoing_ns_alive(1); |
| 210 | |
| 211 | /* Expect BVC-RESET for signaling (0) and ptp BVCI */ |
| 212 | as_rx_bvc_reset_tx_ack(0, oneshot := true); |
| 213 | as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvci, oneshot := true); |
| 214 | /* Expect UNBLOCK for ptp BVCI on signaling NS-VC (idx==0) */ |
| 215 | as_rx_bvc_unblock_tx_ack(mp_gb_cfg.bvci, oneshot := true); |
| 216 | |
| 217 | /* wait for one FLOW-CONTROL BVC and then ACK any further in the future. Flow |
| 218 | * control happens on the p-t-p BVCI and hence on index 1 */ |
| 219 | as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvci, oneshot := true, idx := 1); |
| 220 | activate(as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvci, idx := 1)); |
| 221 | } |
| 222 | |
| 223 | /* Test full IP-SNS bring-up with two NS-VCs, one sig-only and one user-only */ |
Harald Welte | ea3c7e9 | 2019-03-01 19:34:55 +0100 | [diff] [blame] | 224 | testcase TC_sns_1c1u() runs on RAW_Test_CT { |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 225 | f_sns_bringup_1c1u(); |
| 226 | setverdict(pass); |
| 227 | } |
| 228 | |
Harald Welte | ecd159e | 2019-03-16 13:36:07 +0100 | [diff] [blame] | 229 | private function f_sns_bringup_1c1u_separate() runs on RAW_Test_CT { |
| 230 | /* Activate two NS codec ports */ |
| 231 | f_init_ns_codec(); |
| 232 | f_init_ns_codec(1); |
| 233 | f_init_ns_codec(2); |
| 234 | f_init_pcuif(); |
| 235 | /* Perform Size + BSS-originated config */ |
| 236 | f_incoming_sns_size(); |
| 237 | f_incoming_sns_config(); |
| 238 | /* perform SGSN-originated config using idx==0 for signalling and idx==1 for user traffic */ |
| 239 | f_outgoing_sns_config_1c1u_separate(); |
| 240 | |
| 241 | /* wait for one ALIVE cycle, then ACK any further ALIVE in the background |
| 242 | * for both NS-VCs */ |
| 243 | as_rx_alive_tx_ack(oneshot := true, idx := 1); |
| 244 | activate(as_rx_alive_tx_ack(idx := 1)); |
| 245 | as_rx_alive_tx_ack(oneshot := true, idx := 2); |
| 246 | activate(as_rx_alive_tx_ack(idx := 2)); |
| 247 | /* ensure there's no NS-ALIVE received on idx==0 */ |
| 248 | f_ensure_no_ns(t_NS_ALIVE, idx := 0); |
| 249 | |
| 250 | /* perform outgoing ALIVE procedure for both NS-VCs */ |
| 251 | f_outgoing_ns_alive(1); |
| 252 | f_outgoing_ns_alive(2); |
| 253 | /* ensure there's no response to NS-ALIVE sent on idx==0 */ |
| 254 | f_outgoing_ns_alive_no_ack(idx := 0); |
| 255 | |
| 256 | /* Expect BVC-RESET for signaling BVCI=0 and ptp BVCI */ |
| 257 | as_rx_bvc_reset_tx_ack(0, oneshot := true, idx := 1); |
| 258 | as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvci, oneshot := true, idx := 1); |
| 259 | /* Expect UNBLOCK for ptp BVCI on signaling NS-VC (idx==1) */ |
| 260 | as_rx_bvc_unblock_tx_ack(mp_gb_cfg.bvci, oneshot := true, idx := 1); |
| 261 | |
| 262 | /* wait for one FLOW-CONTROL BVC and then ACK any further in the future. Flow |
| 263 | * control happens on the p-t-p BVCI and hence on index 1 */ |
| 264 | as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvci, oneshot := true, idx := 2); |
| 265 | activate(as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvci, idx := 2)); |
| 266 | } |
| 267 | |
| 268 | /* Test full IP-SNS bring-up with two NS-VCs, one sig-only and one user-only - and where |
| 269 | * the initial IP/port for the SNS procedure is *not* part of the NS-VCs later */ |
| 270 | testcase TC_sns_1c1u_separate() runs on RAW_Test_CT { |
| 271 | f_sns_bringup_1c1u_separate(); |
| 272 | setverdict(pass); |
| 273 | } |
| 274 | |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 275 | /* Test adding new IP endpoints at runtime */ |
Harald Welte | ea3c7e9 | 2019-03-01 19:34:55 +0100 | [diff] [blame] | 276 | testcase TC_sns_add() runs on RAW_Test_CT { |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 277 | f_sns_bringup_1c1u(); |
| 278 | |
| 279 | /* crate another NS codec port on the tester side */ |
| 280 | f_init_ns_codec(2); |
| 281 | |
| 282 | f_outgoing_sns_add(idx_add := 2, w_sig := 0, w_user := 1, idx := 0); |
| 283 | |
| 284 | /* wait for one ALIVE cycle, then ACK any further ALIVE in the background */ |
| 285 | as_rx_alive_tx_ack(oneshot := true, idx := 2); |
| 286 | activate(as_rx_alive_tx_ack(idx := 2)); |
| 287 | |
| 288 | f_outgoing_ns_alive(2); |
| 289 | /* TODO: Should we expect FLOW-CONTROL BVC here too? */ |
| 290 | setverdict(pass); |
| 291 | } |
| 292 | |
| 293 | /* Test deleting IP endpoints at runtime */ |
Harald Welte | ea3c7e9 | 2019-03-01 19:34:55 +0100 | [diff] [blame] | 294 | testcase TC_sns_del() runs on RAW_Test_CT { |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 295 | f_sns_bringup_1c1u(); |
| 296 | |
| 297 | f_outgoing_sns_del(idx_del := 1, w_sig := 0, w_user := 1, idx := 0); |
| 298 | /* FIXME: ensure we don't receive anything on just-deleted NS-VC anymore */ |
| 299 | setverdict(pass); |
| 300 | } |
| 301 | |
Harald Welte | 7209955 | 2019-02-23 15:09:22 +0100 | [diff] [blame] | 302 | /* Test changing weights at runtime */ |
Harald Welte | ea3c7e9 | 2019-03-01 19:34:55 +0100 | [diff] [blame] | 303 | testcase TC_sns_chg_weight() runs on RAW_Test_CT { |
Harald Welte | 7209955 | 2019-02-23 15:09:22 +0100 | [diff] [blame] | 304 | f_sns_bringup_1c1u(); |
| 305 | |
| 306 | /* change w_user from 1 to 200 */ |
| 307 | f_outgoing_sns_chg_weight(idx_chg := 1, w_sig := 0, w_user := 200, idx := 0); |
| 308 | setverdict(pass); |
| 309 | } |
| 310 | |
Harald Welte | 16e92f4 | 2019-03-02 00:03:44 +0100 | [diff] [blame] | 311 | import from PCUIF_Types all; |
| 312 | import from PCUIF_CodecPort all; |
| 313 | |
| 314 | private function f_pcuif_tx(template (value) PCUIF_Message msg) runs on RAW_PCU_CT { |
| 315 | PCU.send(t_SD_PCUIF(g_pcu_conn_id, msg)); |
| 316 | } |
| 317 | |
Harald Welte | 3b33583 | 2019-03-15 22:38:06 +0100 | [diff] [blame] | 318 | altstep as_pcu_activate() runs on RAW_PCU_CT { |
| 319 | var PCUIF_send_data sd; |
| 320 | [] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_ACT_REQ(?, ?, ?))) -> value sd { repeat; } |
| 321 | |
| 322 | } |
| 323 | |
Harald Welte | 16e92f4 | 2019-03-02 00:03:44 +0100 | [diff] [blame] | 324 | testcase TC_pcuif_rach() runs on RAW_Test_CT { |
| 325 | f_sns_bringup_1c1u(); |
Harald Welte | 3b33583 | 2019-03-15 22:38:06 +0100 | [diff] [blame] | 326 | activate(as_pcu_activate()); |
Harald Welte | 16e92f4 | 2019-03-02 00:03:44 +0100 | [diff] [blame] | 327 | |
| 328 | f_pcuif_tx(ts_PCUIF_RACH_IND(bts_nr:=0, ra:=23, is_11bit:=0, burst_type:=BURST_TYPE_0, |
| 329 | fn:=42, arfcn:=871, qta:=0)); |
| 330 | PCU.receive(t_SD_PCUIF(g_pcu_conn_id, |
| 331 | tr_PCUIF_DATA_REQ(bts_nr:=0, trx_nr:=0, ts_nr:=0, block_nr:=?, fn:=?, |
| 332 | sapi:=PCU_IF_SAPI_AGCH, data:=?))); |
| 333 | setverdict(pass); |
| 334 | } |
| 335 | |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 336 | |
| 337 | |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 338 | control { |
| 339 | execute( TC_sns_po_size_success() ); |
| 340 | execute( TC_sns_po_size_nack() ); |
| 341 | execute( TC_sns_po_config_success() ); |
| 342 | execute( TC_sns_po_config_nack() ); |
| 343 | execute( TC_sns_so_config_success() ); |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 344 | execute( TC_sns_1c1u() ); |
Harald Welte | ecd159e | 2019-03-16 13:36:07 +0100 | [diff] [blame] | 345 | execute( TC_sns_1c1u_separate() ); |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 346 | execute( TC_sns_add() ); |
| 347 | execute( TC_sns_del() ); |
Harald Welte | 7209955 | 2019-02-23 15:09:22 +0100 | [diff] [blame] | 348 | execute( TC_sns_chg_weight() ); |
Harald Welte | 16e92f4 | 2019-03-02 00:03:44 +0100 | [diff] [blame] | 349 | |
| 350 | execute( TC_pcuif_rach() ); |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 351 | } |
| 352 | |
| 353 | } |