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