Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 1 | module NS_Tests { |
| 2 | |
| 3 | /* Osmocom NS test suite for NS over framerelay or udp ip.access style in TTCN-3 |
| 4 | * (C) 2021 sysmocom s.f.m.c. GmbH <info@sysmocom.de> |
| 5 | * Author: Alexander Couzens <lynxis@fe80.eu> |
| 6 | * All rights reserved. |
| 7 | * |
| 8 | * Released under the terms of GNU General Public License, Version 2 or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * SPDX-License-Identifier: GPL-2.0-or-later |
| 12 | */ |
| 13 | |
| 14 | import from General_Types all; |
| 15 | import from Osmocom_Types all; |
| 16 | import from Osmocom_Gb_Types all; |
| 17 | import from NS_Types all; |
| 18 | import from BSSGP_Types all; |
| 19 | import from UD_Types all; |
| 20 | import from NS_Emulation all; |
| 21 | import from Native_Functions all; |
| 22 | import from IPL4asp_Types all; |
| 23 | import from RAW_NS all; |
| 24 | import from Osmocom_VTY_Functions all; |
| 25 | import from TELNETasp_PortType all; |
| 26 | |
Alexander Couzens | de3dfaa | 2021-08-06 17:59:54 +0200 | [diff] [blame] | 27 | type enumerated SnsRole { |
| 28 | SNS_ROLE_BSS ('00'H), |
| 29 | SNS_ROLE_SGSN ('01'H) |
| 30 | }; |
| 31 | |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 32 | modulepar { |
Alexander Couzens | de3dfaa | 2021-08-06 17:59:54 +0200 | [diff] [blame] | 33 | SnsRole mp_sns_role := SNS_ROLE_BSS; |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 34 | OsmoNsDialect mp_dialect := NS2_DIALECT_IPACCESS; |
| 35 | NSConfiguration mp_nsconfig := { |
| 36 | nsei := 96, |
| 37 | role_sgsn := false, |
| 38 | handle_sns := false, |
| 39 | nsvc := { |
| 40 | { |
| 41 | provider := { |
| 42 | ip := { |
| 43 | address_family := AF_INET, |
| 44 | local_udp_port := 21000, |
| 45 | local_ip := "127.0.0.1", |
| 46 | remote_udp_port := 23000, |
Alexander Couzens | 87e44cf | 2021-02-03 15:15:27 +0100 | [diff] [blame] | 47 | remote_ip := "127.0.0.1", |
| 48 | data_weight := 2, |
| 49 | signalling_weight := 2 |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 50 | } |
| 51 | }, |
| 52 | nsvci := 97 |
Alexander Couzens | 6f17ecc | 2021-05-25 13:43:57 +0200 | [diff] [blame] | 53 | }, |
| 54 | { |
| 55 | provider := { |
| 56 | ip := { |
| 57 | address_family := AF_INET, |
| 58 | local_udp_port := 21000, |
| 59 | local_ip := "127.0.0.1", |
| 60 | remote_udp_port := 23001, |
| 61 | remote_ip := "127.0.0.1", |
| 62 | data_weight := 1, |
| 63 | signalling_weight := 1 |
| 64 | } |
| 65 | }, |
| 66 | nsvci := 98 |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 67 | } |
| 68 | } |
| 69 | }; |
arehbein | 2a6726c | 2022-11-30 22:40:43 +0100 | [diff] [blame] | 70 | NsIEI mp_ns_iei_num_ipv4_ep := NS_IEI_NUM_IPv4_EP; |
| 71 | NsIEI mp_ns_iei_num_ipv6_ep := NS_IEI_NUM_IPv6_EP; |
| 72 | NsIEI mp_ns_iei_nsei := NS_IEI_NSEI; |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 73 | } |
| 74 | |
| 75 | type component RAW_Test_CT extends RAW_NS_CT { |
| 76 | port TELNETasp_PT NSVTY; |
| 77 | } |
| 78 | |
| 79 | private function f_init_vty() runs on RAW_Test_CT { |
| 80 | map(self:NSVTY, system:NSVTY); |
| 81 | f_vty_set_prompts(NSVTY); |
| 82 | f_vty_transceive(NSVTY, "enable"); |
Alexander Couzens | 357c572 | 2021-09-06 01:20:18 +0200 | [diff] [blame] | 83 | f_vty_config2(NSVTY, {}, "mirror-mode disable"); |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 84 | f_vty_transceive(NSVTY, "nsvc nsei " & int2str(mp_nsconfig.nsei) & " force-unconfigured"); |
Alexander Couzens | bdef810 | 2021-09-03 23:18:27 +0200 | [diff] [blame] | 85 | if (mp_dialect == NS2_DIALECT_SNS) { |
| 86 | f_vty_config2(NSVTY, {"ns", "nse " & int2str(mp_nsconfig.nsei)}, "ip-sns-bind local"); |
| 87 | f_vty_config2(NSVTY, {"ns", "nse " & int2str(mp_nsconfig.nsei)}, "no ip-sns-bind local2"); |
| 88 | f_vty_config2(NSVTY, {"ns", "bind udp local"}, "ip-sns signalling-weight 1 data-weight 1"); |
| 89 | f_vty_config2(NSVTY, {"ns", "bind udp local2"}, "ip-sns signalling-weight 1 data-weight 1"); |
| 90 | } |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 91 | } |
| 92 | |
| 93 | /* ensure no matching message is received within 'tout' */ |
| 94 | function f_ensure_no_ns(integer idx := 0, boolean answer_alive := false, float tout := 3.0) |
| 95 | runs on RAW_Test_CT { |
| 96 | var PDU_NS nrf; |
| 97 | |
| 98 | timer T := tout; |
| 99 | var default d := activate(ax_rx_fail_on_any_ns(idx)); |
| 100 | T.start; |
| 101 | alt { |
| 102 | [answer_alive] as_rx_alive_tx_ack(); |
| 103 | [] T.timeout { |
| 104 | setverdict(pass); |
| 105 | } |
| 106 | } |
| 107 | deactivate(d); |
| 108 | } |
| 109 | |
| 110 | function f_fails_except_reset(integer idx := 0, float tout := 15.0) |
| 111 | runs on RAW_Test_CT { |
| 112 | var PDU_NS nrf; |
| 113 | timer T := 15.0; |
| 114 | T.start; |
| 115 | alt { |
| 116 | [] NSCP[idx].receive(tr_NS_RESET(*, *, *)) { |
| 117 | repeat; |
| 118 | } |
| 119 | [] NSCP[idx].receive(PDU_NS: ?) -> value nrf { |
| 120 | setverdict(fail, "Received unexpected NS: ", nrf); |
| 121 | mtc.stop; |
| 122 | } |
| 123 | [] T.timeout { |
| 124 | setverdict(pass); |
| 125 | } |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | testcase TC_tx_reset() runs on RAW_Test_CT { |
| 130 | f_init_vty(); |
| 131 | f_init_ns_codec(mp_nsconfig, guard_secs := 10.0); |
| 132 | |
| 133 | /* do a NS Reset procedure */ |
| 134 | f_outgoing_ns_reset(); |
| 135 | |
| 136 | setverdict(pass); |
| 137 | f_sleep(1.0); |
Alexander Couzens | 3674405 | 2021-09-06 00:39:07 +0200 | [diff] [blame] | 138 | f_clean_ns_codec(); |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 139 | } |
| 140 | |
| 141 | testcase TC_tx_reset_tx_alive() runs on RAW_Test_CT { |
| 142 | f_init_vty(); |
| 143 | f_init_ns_codec(mp_nsconfig, guard_secs := 10.0); |
| 144 | |
| 145 | /* do a NS Reset procedure */ |
| 146 | f_outgoing_ns_reset(); |
| 147 | |
| 148 | /* check outgoing NS procedure */ |
| 149 | f_outgoing_ns_alive(); |
| 150 | |
| 151 | setverdict(pass); |
| 152 | f_sleep(1.0); |
Alexander Couzens | 3674405 | 2021-09-06 00:39:07 +0200 | [diff] [blame] | 153 | f_clean_ns_codec(); |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 154 | } |
| 155 | |
| 156 | testcase TC_tx_reset_rx_alive() runs on RAW_Test_CT { |
| 157 | f_init_vty(); |
| 158 | f_init_ns_codec(mp_nsconfig, guard_secs := 10.0); |
| 159 | |
| 160 | /* do a NS Reset procedure */ |
| 161 | f_outgoing_ns_reset(); |
| 162 | |
| 163 | activate(as_rx_ns_unblock_ack()); |
| 164 | /* check outgoing NS procedure */ |
| 165 | as_rx_alive_tx_ack(oneshot := true); |
| 166 | |
| 167 | setverdict(pass); |
| 168 | f_sleep(1.0); |
Alexander Couzens | 3674405 | 2021-09-06 00:39:07 +0200 | [diff] [blame] | 169 | f_clean_ns_codec(); |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 170 | } |
| 171 | |
Alexander Couzens | 94d3d10 | 2021-09-06 00:20:42 +0200 | [diff] [blame] | 172 | /* 48.016 7.2.1 transmit a UNIT DATA over a BLOCKED NSVC when ttcn3 blocked it |
| 173 | * |
| 174 | * TTCN -> NS: reset |
| 175 | * TTCN <- NS: reset ack |
| 176 | * TTCN -> NS: unblock |
| 177 | * TTCN <- NS: unblock ack |
| 178 | * TTCN -> NS: block |
| 179 | * TTCN <- NS: block ack |
| 180 | * TTCN -> NS: unitdata |
| 181 | * TTCN <- NS: status (cause blocked) |
| 182 | */ |
| 183 | testcase TC_tx_block_unitdata_over_blocked() runs on RAW_Test_CT { |
| 184 | f_tx_block(); |
| 185 | f_sleep(1.0); |
| 186 | |
| 187 | NSCP[0].send(ts_NS_UNITDATA(t_SduCtrlB, 42, '0011234242230101'O)); |
| 188 | f_ns_exp(tr_NS_STATUS(NS_CAUSE_NSVC_BLOCKED)); |
| 189 | |
| 190 | setverdict(pass); |
| 191 | f_sleep(1.0); |
| 192 | f_clean_ns_codec(); |
| 193 | } |
| 194 | |
| 195 | /* 48.016 7.2.1 transmit a UNIT DATA over a BLOCKED NSVC when ns2 blocked it |
| 196 | * |
| 197 | * TTCN -> NS: reset |
| 198 | * TTCN <- NS: reset ack |
| 199 | * TTCN -> NS: unblock |
| 200 | * TTCN <- NS: unblock ack |
| 201 | * TTCN <- NS: block |
| 202 | * TTCN -> NS: block ack |
| 203 | * TTCN -> NS: unitdata |
| 204 | * TTCN <- NS: status (cause blocked) |
| 205 | */ |
| 206 | testcase TC_rx_block_unitdata_over_blocked() runs on RAW_Test_CT { |
Alexander Couzens | 2478804 | 2021-09-06 00:42:51 +0200 | [diff] [blame] | 207 | f_tx_block_by_vty(); |
Alexander Couzens | 94d3d10 | 2021-09-06 00:20:42 +0200 | [diff] [blame] | 208 | f_sleep(1.0); |
| 209 | |
| 210 | NSCP[0].send(ts_NS_UNITDATA(t_SduCtrlB, 42, '0011234242230101'O)); |
| 211 | f_ns_exp(tr_NS_STATUS(NS_CAUSE_NSVC_BLOCKED)); |
| 212 | |
| 213 | setverdict(pass); |
| 214 | f_sleep(1.0); |
| 215 | f_clean_ns_codec(); |
| 216 | } |
| 217 | |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 218 | /* 48.016 7.2 unblock procedure |
| 219 | * |
| 220 | * TTCN -> NS: reset |
| 221 | * TTCN <- NS: reset ack |
| 222 | * TTCN -> NS: unblock |
| 223 | * TTCN <- NS: unblock ack |
| 224 | */ |
Alexander Couzens | 357c572 | 2021-09-06 01:20:18 +0200 | [diff] [blame] | 225 | function f_tx_unblock() runs on RAW_Test_CT { |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 226 | f_init_vty(); |
| 227 | f_init_ns_codec(mp_nsconfig, guard_secs := 30.0); |
| 228 | |
| 229 | /* do a NS Reset procedure */ |
| 230 | f_outgoing_ns_reset(); |
| 231 | /* send alive acks */ |
| 232 | activate(as_rx_alive_tx_ack()); |
| 233 | |
| 234 | f_outgoing_ns_unblock(); |
| 235 | setverdict(pass); |
Alexander Couzens | 357c572 | 2021-09-06 01:20:18 +0200 | [diff] [blame] | 236 | } |
| 237 | |
| 238 | testcase TC_tx_unblock() runs on RAW_Test_CT { |
| 239 | f_tx_unblock(); |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 240 | f_sleep(1.0); |
Alexander Couzens | 3674405 | 2021-09-06 00:39:07 +0200 | [diff] [blame] | 241 | f_clean_ns_codec(); |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 242 | } |
| 243 | |
| 244 | /* 48.016 7.2 tx unblock retries |
| 245 | * |
| 246 | * TTCN -> NS: reset |
| 247 | * TTCN <- NS: reset ack |
| 248 | * TTCN -> NS: unblock |
| 249 | * TTCN <- NS: unblock ack |
| 250 | * TTCN -> NS: unblock |
| 251 | * TTCN <- NS: unblock ack |
| 252 | * TTCN -> NS: unblock |
| 253 | * TTCN <- NS: unblock ack |
| 254 | */ |
| 255 | testcase TC_tx_unblock_retries() runs on RAW_Test_CT { |
| 256 | f_init_vty(); |
| 257 | f_init_ns_codec(mp_nsconfig, guard_secs := 30.0); |
| 258 | |
| 259 | /* do a NS Reset procedure */ |
| 260 | f_outgoing_ns_reset(); |
| 261 | /* send alive acks */ |
| 262 | activate(as_rx_alive_tx_ack()); |
| 263 | |
| 264 | f_outgoing_ns_unblock(); |
| 265 | f_outgoing_ns_unblock(); |
| 266 | f_outgoing_ns_unblock(); |
| 267 | setverdict(pass); |
| 268 | f_sleep(1.0); |
Alexander Couzens | 3674405 | 2021-09-06 00:39:07 +0200 | [diff] [blame] | 269 | f_clean_ns_codec(); |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 270 | } |
| 271 | |
| 272 | /* 48.016 7.2 block procedure |
| 273 | * |
| 274 | * TTCN -> NS: reset |
| 275 | * TTCN <- NS: reset ack |
| 276 | * TTCN -> NS: unblock |
| 277 | * TTCN <- NS: unblock ack |
| 278 | * TTCN -> NS: block |
| 279 | * TTCN <- NS: block ack |
| 280 | */ |
Alexander Couzens | 94d3d10 | 2021-09-06 00:20:42 +0200 | [diff] [blame] | 281 | function f_tx_block(float guard_secs := 30.0) runs on RAW_Test_CT { |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 282 | f_init_vty(); |
Alexander Couzens | 94d3d10 | 2021-09-06 00:20:42 +0200 | [diff] [blame] | 283 | f_init_ns_codec(mp_nsconfig, guard_secs := guard_secs); |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 284 | |
| 285 | /* do a NS Reset procedure */ |
| 286 | f_outgoing_ns_reset(); |
| 287 | activate(as_rx_alive_tx_ack()); |
| 288 | |
| 289 | f_outgoing_ns_unblock(); |
| 290 | f_sleep(1.0); |
| 291 | |
| 292 | f_outgoing_ns_block(NS_CAUSE_EQUIPMENT_FAILURE); |
| 293 | setverdict(pass); |
| 294 | f_sleep(1.0); |
| 295 | } |
| 296 | |
Alexander Couzens | 94d3d10 | 2021-09-06 00:20:42 +0200 | [diff] [blame] | 297 | testcase TC_tx_block() runs on RAW_Test_CT { |
| 298 | f_tx_block() |
| 299 | f_clean_ns_codec(); |
| 300 | } |
| 301 | |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 302 | /* 48.016 7.2 block procedure by vty |
| 303 | * |
| 304 | * TTCN -> NS: reset |
| 305 | * TTCN <- NS: reset ack |
| 306 | * TTCN -> NS: unblock |
| 307 | * TTCN <- NS: unblock ack |
| 308 | * vty: block nsvc |
| 309 | * TTCN <- NS: block |
| 310 | * TTCN -> NS: block ack |
| 311 | */ |
Alexander Couzens | 2478804 | 2021-09-06 00:42:51 +0200 | [diff] [blame] | 312 | function f_tx_block_by_vty(float guard_secs := 30.0) runs on RAW_Test_CT { |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 313 | f_init_vty(); |
| 314 | f_init_ns_codec(mp_nsconfig, guard_secs := guard_secs); |
| 315 | |
| 316 | /* do a NS Reset procedure */ |
| 317 | f_outgoing_ns_reset(); |
| 318 | activate(as_rx_alive_tx_ack()); |
| 319 | |
| 320 | f_outgoing_ns_unblock(); |
| 321 | f_sleep(1.0); |
| 322 | |
| 323 | f_vty_transceive(NSVTY, "nsvc " & int2str(mp_nsconfig.nsvc[0].nsvci) & " block"); |
| 324 | |
| 325 | alt { |
| 326 | [] as_rx_ns_block_ack(oneshot := true, nsvci := mp_nsconfig.nsvc[0].nsvci); |
| 327 | } |
| 328 | setverdict(pass); |
| 329 | } |
| 330 | |
| 331 | testcase TC_tx_block_by_vty() runs on RAW_Test_CT { |
Alexander Couzens | 2478804 | 2021-09-06 00:42:51 +0200 | [diff] [blame] | 332 | f_tx_block_by_vty(30.0); |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 333 | f_sleep(1.0); |
Alexander Couzens | 3674405 | 2021-09-06 00:39:07 +0200 | [diff] [blame] | 334 | f_clean_ns_codec(); |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 335 | } |
| 336 | |
| 337 | /* 48.016 7.2 block precedure by vty and reset the NSVC. |
| 338 | * The NSVC should be still blocked after the reset. |
| 339 | */ |
| 340 | testcase TC_tx_block_by_vty_reset() runs on RAW_Test_CT { |
| 341 | timer T := 10.0; |
| 342 | |
Alexander Couzens | 2478804 | 2021-09-06 00:42:51 +0200 | [diff] [blame] | 343 | f_tx_block_by_vty(60.0); |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 344 | f_outgoing_ns_reset(); |
| 345 | |
| 346 | var default d := activate(ax_rx_fail_on_any_ns()); |
| 347 | T.start; |
| 348 | alt { |
| 349 | [] as_rx_alive_tx_ack(); |
| 350 | [] T.timeout { setverdict(pass); } |
| 351 | } |
| 352 | deactivate(d); |
Alexander Couzens | 3674405 | 2021-09-06 00:39:07 +0200 | [diff] [blame] | 353 | f_clean_ns_codec(); |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 354 | } |
| 355 | |
| 356 | /* 48.016 7.4.1 ignore unexpected NS_ALIVE ACK */ |
| 357 | testcase TC_no_reset_alive_ack() runs on RAW_Test_CT { |
| 358 | f_init_vty(); |
| 359 | f_init_ns_codec(mp_nsconfig, guard_secs := 30.0); |
| 360 | |
| 361 | NSCP[0].send(t_NS_ALIVE_ACK); |
| 362 | f_fails_except_reset(); |
| 363 | setverdict(pass); |
| 364 | f_sleep(1.0); |
Alexander Couzens | 3674405 | 2021-09-06 00:39:07 +0200 | [diff] [blame] | 365 | f_clean_ns_codec(); |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 366 | } |
| 367 | |
| 368 | /* 48.016 7.3.1 NS_RESET with wrong nsei */ |
| 369 | testcase TC_reset_wrong_nsei() runs on RAW_Test_CT { |
| 370 | f_init_vty(); |
| 371 | f_init_ns_codec(mp_nsconfig, guard_secs := 30.0); |
| 372 | |
| 373 | NSCP[0].send(ts_NS_RESET(NS_CAUSE_EQUIPMENT_FAILURE, g_nsconfig.nsvc[0].nsvci, g_nsconfig.nsei + 20)); |
| 374 | NSCP[0].receive(tr_NS_RESET_ACK(g_nsconfig.nsvc[0].nsvci, g_nsconfig.nsei)); |
| 375 | f_fails_except_reset(); |
| 376 | setverdict(pass); |
| 377 | f_sleep(1.0); |
Alexander Couzens | 3674405 | 2021-09-06 00:39:07 +0200 | [diff] [blame] | 378 | f_clean_ns_codec(); |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 379 | } |
| 380 | |
| 381 | /* 48.016 7.3.1 NS_RESET with wrong nsvci */ |
| 382 | testcase TC_reset_wrong_nsvci() runs on RAW_Test_CT { |
| 383 | f_init_vty(); |
| 384 | f_init_ns_codec(mp_nsconfig, guard_secs := 30.0); |
| 385 | |
| 386 | NSCP[0].send(ts_NS_RESET(NS_CAUSE_EQUIPMENT_FAILURE, g_nsconfig.nsvc[0].nsvci + 20, g_nsconfig.nsei)); |
| 387 | NSCP[0].receive(tr_NS_RESET_ACK(g_nsconfig.nsvc[0].nsvci, g_nsconfig.nsei)); |
| 388 | f_fails_except_reset(); |
| 389 | setverdict(pass); |
| 390 | f_sleep(1.0); |
Alexander Couzens | 3674405 | 2021-09-06 00:39:07 +0200 | [diff] [blame] | 391 | f_clean_ns_codec(); |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 392 | } |
| 393 | |
| 394 | /* 48.016 7.3.1 NS_RESET with wrong nsvci + nsei */ |
| 395 | testcase TC_reset_wrong_nsei_nsvci() runs on RAW_Test_CT { |
| 396 | f_init_vty(); |
| 397 | f_init_ns_codec(mp_nsconfig, guard_secs := 30.0); |
| 398 | |
| 399 | NSCP[0].send(ts_NS_RESET(NS_CAUSE_EQUIPMENT_FAILURE, g_nsconfig.nsvc[0].nsvci + 20, g_nsconfig.nsei + 20)); |
| 400 | NSCP[0].receive(tr_NS_RESET_ACK(g_nsconfig.nsvc[0].nsvci, g_nsconfig.nsei)); |
| 401 | f_fails_except_reset(); |
| 402 | setverdict(pass); |
| 403 | f_sleep(1.0); |
Alexander Couzens | 3674405 | 2021-09-06 00:39:07 +0200 | [diff] [blame] | 404 | f_clean_ns_codec(); |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 405 | } |
| 406 | |
| 407 | /* 48.016 7.3.1 NS_RESET_ACK with wrong nsei */ |
| 408 | testcase TC_reset_ack_wrong_nsei() runs on RAW_Test_CT { |
| 409 | f_init_vty(); |
| 410 | f_init_ns_codec(mp_nsconfig, guard_secs := 30.0); |
| 411 | |
| 412 | NSCP[0].receive(tr_NS_RESET(*, g_nsconfig.nsvc[0].nsvci, g_nsconfig.nsei)); |
| 413 | NSCP[0].send(ts_NS_RESET_ACK(g_nsconfig.nsvc[0].nsvci, g_nsconfig.nsei + 20)); |
| 414 | f_fails_except_reset(); |
| 415 | setverdict(pass); |
| 416 | f_sleep(1.0); |
Alexander Couzens | 3674405 | 2021-09-06 00:39:07 +0200 | [diff] [blame] | 417 | f_clean_ns_codec(); |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 418 | } |
| 419 | |
| 420 | /* 48.016 7.3.1 NS_RESET_ACK with wrong nsvci */ |
| 421 | testcase TC_reset_ack_wrong_nsvci() runs on RAW_Test_CT { |
| 422 | f_init_vty(); |
| 423 | f_init_ns_codec(mp_nsconfig, guard_secs := 30.0); |
| 424 | |
| 425 | NSCP[0].receive(tr_NS_RESET(*, g_nsconfig.nsvc[0].nsvci, g_nsconfig.nsei)); |
| 426 | NSCP[0].send(ts_NS_RESET_ACK(g_nsconfig.nsvc[0].nsvci + 20, g_nsconfig.nsei)); |
| 427 | f_fails_except_reset(); |
| 428 | setverdict(pass); |
| 429 | f_sleep(1.0); |
Alexander Couzens | 3674405 | 2021-09-06 00:39:07 +0200 | [diff] [blame] | 430 | f_clean_ns_codec(); |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 431 | } |
| 432 | |
| 433 | /* 48.016 7.3.1 NS_RESET_ACK with wrong nsvci + nsei */ |
| 434 | testcase TC_reset_ack_wrong_nsei_nsvci() runs on RAW_Test_CT { |
| 435 | f_init_vty(); |
| 436 | f_init_ns_codec(mp_nsconfig, guard_secs := 30.0); |
| 437 | |
| 438 | NSCP[0].receive(tr_NS_RESET(*, g_nsconfig.nsvc[0].nsvci, g_nsconfig.nsei)); |
| 439 | NSCP[0].send(ts_NS_RESET_ACK(g_nsconfig.nsvc[0].nsvci + 20, g_nsconfig.nsei + 20)); |
| 440 | f_fails_except_reset(); |
| 441 | setverdict(pass); |
| 442 | f_sleep(1.0); |
Alexander Couzens | 3674405 | 2021-09-06 00:39:07 +0200 | [diff] [blame] | 443 | f_clean_ns_codec(); |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 444 | } |
| 445 | |
| 446 | /* 48.016 7.3.1 ignore unexpected NS_RESET_ACK after NS_RESET+ALIVE */ |
| 447 | testcase TC_ignore_reset_ack() runs on RAW_Test_CT { |
| 448 | f_init_vty(); |
| 449 | f_init_ns_codec(mp_nsconfig, guard_secs := 30.0); |
| 450 | |
| 451 | /* do a NS Reset procedure */ |
| 452 | f_outgoing_ns_reset(); |
| 453 | |
| 454 | /* unblock and alive */ |
| 455 | alt { |
| 456 | [] as_rx_ns_unblock_ack(oneshot := true); |
| 457 | [] as_rx_alive_tx_ack(); |
| 458 | } |
| 459 | |
| 460 | NSCP[0].send(ts_NS_RESET_ACK(g_nsconfig.nsvc[0].nsvci, g_nsconfig.nsei)); |
| 461 | f_ensure_no_ns(answer_alive := true, tout := 15.0); |
| 462 | setverdict(pass); |
| 463 | f_sleep(1.0); |
Alexander Couzens | 3674405 | 2021-09-06 00:39:07 +0200 | [diff] [blame] | 464 | f_clean_ns_codec(); |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 465 | } |
| 466 | |
| 467 | /* 48.016 7.3 NS_RESET retries */ |
| 468 | testcase TC_reset_retries() runs on RAW_Test_CT { |
| 469 | var integer reset := 0; |
| 470 | |
| 471 | f_init_vty(); |
| 472 | f_init_ns_codec(mp_nsconfig, guard_secs := 30.0); |
| 473 | |
| 474 | alt { |
| 475 | [] NSCP[0].receive(tr_NS_RESET(*, *, *)) { |
| 476 | reset := reset + 1; |
| 477 | if (reset <= 3) { |
| 478 | repeat; |
| 479 | } else { |
| 480 | setverdict(pass); |
| 481 | } |
| 482 | } |
| 483 | } |
| 484 | |
| 485 | f_sleep(1.0); |
Alexander Couzens | 3674405 | 2021-09-06 00:39:07 +0200 | [diff] [blame] | 486 | f_clean_ns_codec(); |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 487 | } |
| 488 | |
| 489 | /* 48.016 behave RESET_ACK got dropped |
| 490 | * TTCN -> NS: reset |
| 491 | * TTCN <- NS: reset ack |
| 492 | * TTCN <- NS: unblock |
| 493 | * TTCN -> NS: reset |
| 494 | * TTCN <- NS: reset ack |
| 495 | * TTCN <- NS: unblock |
| 496 | */ |
| 497 | testcase TC_reset_on_block_reset() runs on RAW_Test_CT { |
| 498 | var integer i := 0; |
| 499 | |
| 500 | f_init_vty(); |
| 501 | f_init_ns_codec(mp_nsconfig, guard_secs := 30.0); |
| 502 | |
| 503 | f_outgoing_ns_reset(); |
| 504 | activate(as_rx_alive_tx_ack()); |
| 505 | |
| 506 | alt { |
| 507 | [] NSCP[0].receive(t_NS_UNBLOCK) { |
| 508 | NSCP[0].send(ts_NS_RESET(NS_CAUSE_EQUIPMENT_FAILURE, g_nsconfig.nsvc[0].nsvci, g_nsconfig.nsei)); |
| 509 | i := i + 1; |
| 510 | if (i < 3) { |
| 511 | repeat; |
| 512 | } else { |
| 513 | setverdict(pass); |
| 514 | } |
| 515 | } |
| 516 | [] NSCP[0].receive(tr_NS_RESET_ACK(g_nsconfig.nsvc[0].nsvci, g_nsconfig.nsei)) { repeat; } |
| 517 | } |
| 518 | |
| 519 | f_sleep(1.0); |
Alexander Couzens | 3674405 | 2021-09-06 00:39:07 +0200 | [diff] [blame] | 520 | f_clean_ns_codec(); |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 521 | } |
| 522 | |
| 523 | /* 48.016 7.4 test procedure for frame relay with a single nsvci */ |
| 524 | function f_alive_retries_single(boolean reset := false) runs on RAW_Test_CT { |
| 525 | f_init_vty(); |
| 526 | f_init_ns_codec(mp_nsconfig, guard_secs := 60.0); |
| 527 | |
| 528 | /* do a NS Reset procedure */ |
| 529 | f_outgoing_ns_reset(); |
| 530 | |
| 531 | alt { |
| 532 | [] as_rx_ns_unblock_ack(oneshot := true); |
| 533 | [] as_rx_alive_tx_ack(); |
| 534 | } |
| 535 | |
| 536 | /* wait for one alive and answer it */ |
| 537 | as_rx_alive_tx_ack(oneshot := true); |
| 538 | NSCP[0].receive(t_NS_ALIVE); |
| 539 | NSCP[0].receive(t_NS_ALIVE); |
| 540 | NSCP[0].receive(t_NS_ALIVE); |
| 541 | NSCP[0].receive(t_NS_ALIVE); |
| 542 | if (reset) { |
| 543 | NSCP[0].receive(tr_NS_RESET(*, g_nsconfig.nsvc[0].nsvci, g_nsconfig.nsei)); |
| 544 | } else { |
| 545 | f_ensure_no_ns(tout := 10.0); |
| 546 | } |
| 547 | |
| 548 | setverdict(pass); |
| 549 | f_sleep(1.0); |
| 550 | } |
| 551 | |
| 552 | testcase TC_alive_retries_single_reset() runs on RAW_Test_CT { |
| 553 | f_alive_retries_single(reset := true); |
Alexander Couzens | 3674405 | 2021-09-06 00:39:07 +0200 | [diff] [blame] | 554 | f_clean_ns_codec(); |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 555 | } |
| 556 | |
| 557 | testcase TC_alive_retries_single_no_resp() runs on RAW_Test_CT { |
| 558 | f_alive_retries_single(reset := false); |
Alexander Couzens | 3674405 | 2021-09-06 00:39:07 +0200 | [diff] [blame] | 559 | f_clean_ns_codec(); |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 560 | } |
| 561 | |
Alexander Couzens | cbee32a | 2021-02-27 20:50:20 +0100 | [diff] [blame] | 562 | /* 48.016 SNS test cases */ |
| 563 | |
| 564 | /* do a succesful SNS configuration */ |
arehbein | 2a6726c | 2022-11-30 22:40:43 +0100 | [diff] [blame] | 565 | function f_send_expect(in integer NSCP_IDX, in template (omit) PDU_NS pdu, |
| 566 | in NsCause c) runs on RAW_Test_CT { |
| 567 | log("Expected cause: ", c); |
| 568 | NSCP[NSCP_IDX].send(pdu); |
| 569 | f_ns_exp(tr_SNS_SIZE_ACK(g_nsconfig.nsei, c), NSCP_IDX); |
| 570 | } |
| 571 | |
| 572 | function f_set_num_of_ip_endpoints(inout template (omit) PDU_NS base, AddressFamily af) runs on RAW_Test_CT { |
| 573 | const integer NUM_IP := 1; |
| 574 | if (af == AF_INET) { |
| 575 | base.pDU_SNS_Size.numberOfIP4_Endpoints := |
| 576 | {iEI := int2oct(enum2int(mp_ns_iei_num_ipv4_ep), 1), |
| 577 | numberOfIP_Endpoints := int2oct(NUM_IP, 2)}; |
| 578 | } else { |
| 579 | base.pDU_SNS_Size.numberOfIP4_Endpoints := |
| 580 | {iEI := int2oct(enum2int(mp_ns_iei_num_ipv6_ep), 1), |
| 581 | numberOfIP_Endpoints := int2oct(NUM_IP, 2)}; |
| 582 | } |
| 583 | } |
| 584 | |
| 585 | /* Send SNS Size PDUs with invalid IEs */ |
| 586 | testcase TC_sns_sgsn_sns_size_syntactically_wrong_NSEI() runs on RAW_Test_CT { |
| 587 | f_init_vty(); |
| 588 | f_init_ns_codec(mp_nsconfig); |
| 589 | const integer IDX := 0; |
| 590 | /* Assumption: No connections to other NSEs for SUT and testcomponent */ |
| 591 | const integer sgsn_ip4_endpoints := lengthof(mp_nsconfig.nsvc); |
| 592 | const integer ip4_endpoints := lengthof(mp_nsconfig.nsvc); |
| 593 | const integer num_of_nsvcs := sgsn_ip4_endpoints * ip4_endpoints; |
| 594 | /* Template that would be accepted, only missing the number of IP endpoints |
| 595 | * (since there are no ternary operators in TTCN-3...) */ |
| 596 | var template (omit) PDU_NS ts_base_SNS_SIZE_configured := |
| 597 | ts_SNS_SIZE(g_nsconfig.nsei, rst_flag := true, max_nsvcs := num_of_nsvcs, |
| 598 | num_v4 := omit, num_v6 := omit); |
| 599 | var NSVCConfiguration nsvc_cfg := g_nsconfig.nsvc[IDX]; |
| 600 | |
| 601 | f_set_num_of_ip_endpoints(ts_base_SNS_SIZE_configured, g_nsconfig.nsvc[0].provider.ip.address_family); |
| 602 | /* Syntactical error here: length of 1 (has to be >=2) */ |
| 603 | ts_base_SNS_SIZE_configured.pDU_SNS_Size.nSEI_NS := |
| 604 | {iEI := int2oct(enum2int(mp_ns_iei_nsei), 1), ext := '0'B, lengthIndicator := {length1 := 1}, |
| 605 | nSEI := int2oct(g_nsconfig.nsei, 2)}; |
| 606 | const NsCause cause := NS_CAUSE_INVALID_ESSENTIAL_IE; |
| 607 | f_send_expect(IDX, ts_base_SNS_SIZE_configured, cause); |
| 608 | setverdict(pass); |
| 609 | f_clean_ns_codec(); |
| 610 | } |
| 611 | |
arehbein | 1b007f0 | 2022-11-30 23:01:48 +0100 | [diff] [blame^] | 612 | testcase TC_sns_sgsn_sns_size_invalid_num_of_ip_eps() runs on RAW_Test_CT { |
| 613 | f_init_vty(); |
| 614 | f_init_ns_codec(mp_nsconfig); |
| 615 | const integer IDX := 0; |
| 616 | const integer NUM_IP := 1; |
| 617 | log("f_outgoing_sns_size_invalid_num_of_ip_eps(idx=", IDX, ")"); |
| 618 | var NsCause cause; |
| 619 | /* Assumption: No connections to other NSEs for SUT and testcomponent */ |
| 620 | const integer sgsn_ip4_endpoints := lengthof(mp_nsconfig.nsvc); |
| 621 | const integer ip4_endpoints := lengthof(mp_nsconfig.nsvc); |
| 622 | const integer num_of_nsvcs := sgsn_ip4_endpoints * ip4_endpoints; |
| 623 | /* Template that would be accepted, only missing the number of IP endpoints |
| 624 | * (since there are no ternary operators in TTCN-3...) */ |
| 625 | var template (omit) PDU_NS ts_base_SNS_SIZE_configured := |
| 626 | ts_SNS_SIZE(g_nsconfig.nsei, rst_flag := true, max_nsvcs := num_of_nsvcs, |
| 627 | num_v4 := omit, num_v6 := omit); |
| 628 | /* Send IP4 endpoints when IP6 is configured and vice versa, in effect sending an unsupported type of NS-VC endpoints. */ |
| 629 | if (g_nsconfig.nsvc[0].provider.ip.address_family == AF_INET) { |
| 630 | ts_base_SNS_SIZE_configured.pDU_SNS_Size.numberOfIP6_Endpoints := |
| 631 | {iEI := int2oct(enum2int(mp_ns_iei_num_ipv6_ep), 1), numberOfIP_Endpoints := int2oct(NUM_IP, 2)}; |
| 632 | cause := NS_CAUSE_INVALID_NR_OF_IPv6_ENDPOINTS; |
| 633 | } else { |
| 634 | ts_base_SNS_SIZE_configured.pDU_SNS_Size.numberOfIP4_Endpoints := |
| 635 | {iEI := int2oct(enum2int(mp_ns_iei_num_ipv4_ep), 1), numberOfIP_Endpoints := int2oct(NUM_IP, 2)}; |
| 636 | cause := NS_CAUSE_INVALID_NR_OF_IPv4_ENDPOINTS; |
| 637 | } |
| 638 | f_send_expect(IDX, ts_base_SNS_SIZE_configured, cause); |
| 639 | setverdict(pass); |
| 640 | f_clean_ns_codec(); |
| 641 | } |
| 642 | |
Alexander Couzens | 79606cf | 2021-07-27 14:59:29 +0200 | [diff] [blame] | 643 | testcase TC_sns_bss_config_success() runs on RAW_Test_CT { |
Alexander Couzens | cbee32a | 2021-02-27 20:50:20 +0100 | [diff] [blame] | 644 | f_init_vty(); |
| 645 | f_init_ns_codec(mp_nsconfig); |
| 646 | f_incoming_sns_size(); |
| 647 | f_incoming_sns_config(); |
| 648 | f_outgoing_sns_config(); |
| 649 | setverdict(pass); |
| 650 | f_clean_ns_codec(); |
| 651 | } |
| 652 | |
Alexander Couzens | d5ac510 | 2021-02-27 20:53:37 +0100 | [diff] [blame] | 653 | testcase TC_sns_bss_change_weight() runs on RAW_Test_CT { |
Alexander Couzens | 60548b1 | 2021-04-14 19:39:26 +0200 | [diff] [blame] | 654 | g_handle_rx_alive := true; |
Alexander Couzens | d5ac510 | 2021-02-27 20:53:37 +0100 | [diff] [blame] | 655 | f_init_vty(); |
| 656 | f_init_ns_codec(mp_nsconfig); |
| 657 | f_incoming_sns_size(); |
| 658 | f_incoming_sns_config(); |
| 659 | f_outgoing_sns_config(); |
| 660 | activate(as_rx_alive_tx_ack()); |
| 661 | f_vty_config2(NSVTY, {"ns", "bind udp local"}, "ip-sns signalling-weight 99 data-weight 99"); |
| 662 | f_incoming_sns_chg_weight(); |
| 663 | setverdict(pass); |
| 664 | f_clean_ns_codec(); |
| 665 | } |
| 666 | |
Alexander Couzens | 6c723fb | 2021-03-01 00:12:00 +0100 | [diff] [blame] | 667 | /* receive 3x SNS_CHG_WEIGHT but never answer on it */ |
| 668 | testcase TC_sns_bss_change_weight_timeout() runs on RAW_Test_CT { |
| 669 | var integer i := 0; |
| 670 | var template PDU_NS rx; |
| 671 | var NSVCConfiguration nsvc_cfg; |
| 672 | |
Alexander Couzens | 60548b1 | 2021-04-14 19:39:26 +0200 | [diff] [blame] | 673 | g_handle_rx_alive := true; |
Alexander Couzens | 6c723fb | 2021-03-01 00:12:00 +0100 | [diff] [blame] | 674 | f_init_vty(); |
| 675 | f_init_ns_codec(mp_nsconfig); |
| 676 | f_incoming_sns_size(); |
| 677 | f_incoming_sns_config(); |
| 678 | f_outgoing_sns_config(); |
| 679 | activate(as_rx_alive_tx_ack()); |
| 680 | f_vty_config2(NSVTY, {"ns", "bind udp local"}, "ip-sns signalling-weight 99 data-weight 99"); |
| 681 | |
| 682 | nsvc_cfg := g_nsconfig.nsvc[0]; |
| 683 | if (nsvc_cfg.provider.ip.address_family == AF_INET) { |
| 684 | var template IP4_Elements v4_elem := { tr_SNS_IPv4(nsvc_cfg.provider.ip.remote_ip, |
| 685 | nsvc_cfg.provider.ip.remote_udp_port) }; |
| 686 | |
| 687 | rx := tr_SNS_CHG_WEIGHT(g_nsconfig.nsei, ?, v4 := v4_elem); |
| 688 | } else { |
| 689 | var template IP6_Elements v6_elem := { tr_SNS_IPv6(nsvc_cfg.provider.ip.remote_ip, |
| 690 | nsvc_cfg.provider.ip.remote_udp_port) }; |
| 691 | rx := tr_SNS_CHG_WEIGHT(g_nsconfig.nsei, ?, v4 := omit, v6 := v6_elem); |
| 692 | } |
| 693 | |
Alexander Couzens | 60548b1 | 2021-04-14 19:39:26 +0200 | [diff] [blame] | 694 | for (i := 0; i < 3; i := i + 1) { |
| 695 | f_ns_exp(rx); |
Alexander Couzens | 6c723fb | 2021-03-01 00:12:00 +0100 | [diff] [blame] | 696 | } |
| 697 | |
Alexander Couzens | a93cc36 | 2021-04-14 19:39:18 +0200 | [diff] [blame] | 698 | if (nsvc_cfg.provider.ip.address_family == AF_INET) { |
| 699 | /* expect one single SNS-SIZE with RESET flag; 4x v4 EP; no v6 EP */ |
| 700 | rx := f_ns_exp(tr_SNS_SIZE(g_nsconfig.nsei, rst_flag := true, max_nsvcs := ?, |
| 701 | num_v4 := ?, num_v6 := omit), 0); |
| 702 | } else { |
| 703 | /* expect one single SNS-SIZE with RESET flag; no v4 EP; 4x v6 EP */ |
| 704 | rx := f_ns_exp(tr_SNS_SIZE(g_nsconfig.nsei, rst_flag := true, max_nsvcs := ?, |
| 705 | num_v4 := omit, num_v6 := ?), 0); |
| 706 | } |
| 707 | |
Alexander Couzens | 6c723fb | 2021-03-01 00:12:00 +0100 | [diff] [blame] | 708 | setverdict(pass); |
| 709 | f_clean_ns_codec(); |
| 710 | } |
| 711 | |
Alexander Couzens | 6f17ecc | 2021-05-25 13:43:57 +0200 | [diff] [blame] | 712 | testcase TC_sns_bss_add() runs on RAW_Test_CT { |
| 713 | g_handle_rx_alive := true; |
| 714 | f_init_vty(); |
| 715 | f_init_ns_codec(mp_nsconfig); |
| 716 | f_init_ns_codec(mp_nsconfig, 1); |
| 717 | f_incoming_sns_size(); |
| 718 | f_incoming_sns_config(); |
| 719 | f_outgoing_sns_config(); |
| 720 | activate(as_rx_alive_tx_ack()); |
| 721 | f_vty_config2(NSVTY, {"ns", "nse " & int2str(g_nsconfig.nsei)}, "ip-sns-bind local2"); |
| 722 | f_incoming_sns_add(idx_add := 1); |
| 723 | as_rx_alive_tx_ack(oneshot := true, idx := 1); |
| 724 | setverdict(pass); |
| 725 | f_clean_ns_codec(); |
| 726 | } |
| 727 | |
| 728 | testcase TC_sns_bss_del() runs on RAW_Test_CT { |
| 729 | g_handle_rx_alive := true; |
| 730 | f_init_vty(); |
| 731 | f_init_ns_codec(mp_nsconfig); |
| 732 | f_init_ns_codec(mp_nsconfig, 1); |
| 733 | f_incoming_sns_size(); |
| 734 | f_incoming_sns_config(); |
| 735 | f_outgoing_sns_config(); |
| 736 | activate(as_rx_alive_tx_ack()); |
| 737 | f_vty_config2(NSVTY, {"ns", "nse " & int2str(g_nsconfig.nsei)}, "ip-sns-bind local2"); |
| 738 | f_incoming_sns_add(idx_add := 1); |
| 739 | as_rx_alive_tx_ack(oneshot := true, idx := 1); |
| 740 | |
| 741 | /* delete the endpoint */ |
| 742 | f_vty_config2(NSVTY, {"ns", "nse " & int2str(g_nsconfig.nsei)}, "no ip-sns-bind local2"); |
| 743 | f_incoming_sns_del(idx_del := 1); |
| 744 | setverdict(pass); |
| 745 | f_clean_ns_codec(); |
| 746 | } |
| 747 | |
Alexander Couzens | e23387a | 2021-06-06 23:15:42 +0200 | [diff] [blame] | 748 | /* 1. do SNS configuration |
| 749 | * 2. add a bind |
| 750 | * 3. receive the SNS_ADD |
| 751 | * 4. before answering the SNS_ADD, change the weight via vty and remove the bind |
| 752 | */ |
| 753 | testcase TC_sns_bss_add_change_del() runs on RAW_Test_CT { |
| 754 | var PDU_NS rx; |
| 755 | var NSVCConfiguration nsvc_cfg; |
| 756 | |
| 757 | g_handle_rx_alive := true; |
| 758 | f_init_vty(); |
| 759 | f_init_ns_codec(mp_nsconfig); |
| 760 | f_init_ns_codec(mp_nsconfig, 1); |
| 761 | f_incoming_sns_size(); |
| 762 | f_incoming_sns_config(); |
| 763 | f_outgoing_sns_config(); |
| 764 | activate(as_rx_alive_tx_ack()); |
| 765 | f_vty_config2(NSVTY, {"ns", "nse " & int2str(g_nsconfig.nsei)}, "ip-sns-bind local2"); |
| 766 | |
| 767 | /* rx SNS ADD */ |
| 768 | nsvc_cfg := g_nsconfig.nsvc[1]; |
| 769 | if (nsvc_cfg.provider.ip.address_family == AF_INET) { |
| 770 | var template (omit) IP4_Elements v4_elem := { ts_SNS_IPv4(nsvc_cfg.provider.ip.remote_ip, |
| 771 | nsvc_cfg.provider.ip.remote_udp_port, |
| 772 | 1, 1) }; |
| 773 | rx := f_ns_exp(tr_SNS_ADD(g_nsconfig.nsei, ?, v4 := v4_elem), 0); |
| 774 | } else { |
| 775 | var template (omit) IP6_Elements v6_elem := { ts_SNS_IPv6(nsvc_cfg.provider.ip.remote_ip, |
| 776 | nsvc_cfg.provider.ip.remote_udp_port, |
| 777 | 1, 1) }; |
| 778 | rx := f_ns_exp(tr_SNS_ADD(g_nsconfig.nsei, ?, omit, v6_elem), 0); |
| 779 | } |
| 780 | |
| 781 | /* delete the endpoint */ |
| 782 | f_vty_config2(NSVTY, {"ns", "bind udp local2"}, "ip-sns signalling-weight 99 data-weight 99"); |
| 783 | f_vty_config2(NSVTY, {"ns", "nse " & int2str(g_nsconfig.nsei)}, "no ip-sns-bind local2"); |
| 784 | |
| 785 | /* accept the SNS_ADD */ |
| 786 | NSCP[0].send(ts_SNS_ACK(g_nsconfig.nsei, rx.pDU_SNS_Add.transactionID)); |
| 787 | |
| 788 | f_incoming_sns_chg_weight(idx_chg := 1); |
| 789 | f_incoming_sns_del(idx_del := 1, w_sig := 99, w_user := 99); |
| 790 | setverdict(pass); |
| 791 | f_clean_ns_codec(); |
| 792 | } |
| 793 | |
Alexander Couzens | 31f8150 | 2021-07-12 18:15:01 +0200 | [diff] [blame] | 794 | /* Ensure the ns2 code doesn't crash when calling force unconfigured while sending SNS SIZE */ |
| 795 | testcase TC_sns_rx_size_force_unconf() runs on RAW_Test_CT { |
| 796 | g_handle_rx_alive := true; |
| 797 | f_init_vty(); |
| 798 | f_init_ns_codec(mp_nsconfig); |
| 799 | f_init_ns_codec(mp_nsconfig, 1); |
| 800 | f_ns_exp(tr_SNS_SIZE(mp_nsconfig.nsei, rst_flag := true, max_nsvcs := ?, |
| 801 | num_v4 := ?, num_v6 := omit)); |
| 802 | f_vty_transceive(NSVTY, "nsvc nsei " & int2str(mp_nsconfig.nsei) & " force-unconfigured"); |
| 803 | f_ns_exp(tr_SNS_SIZE(mp_nsconfig.nsei, rst_flag := true, max_nsvcs := ?, |
| 804 | num_v4 := ?, num_v6 := omit)); |
| 805 | setverdict(pass); |
| 806 | f_clean_ns_codec(); |
| 807 | } |
| 808 | |
Alexander Couzens | 1650b16 | 2021-06-13 04:05:56 +0200 | [diff] [blame] | 809 | /* Test if SNS fails when all signalling NSVCs failes |
| 810 | * 3GPP TS 48.016 § 7.4b.1.1 |
| 811 | * 1. do success SNS configuration |
| 812 | * 2. change sig weight of the seconds inactive bind |
| 813 | * 3. add second bind to SNS |
| 814 | * 4. stop reacting to NS_ALIVE on first NSVC (only NSVC with sig weight) |
| 815 | * 5. expect SNS SIZE |
Alexander Couzens | 8122ed2 | 2021-08-06 22:01:20 +0200 | [diff] [blame] | 816 | * |
| 817 | * Broken: the test case tests the wrong side. The signalling |
| 818 | * and data weight are valid for the other side. The correct |
| 819 | * test case needs to add a second bind on the ttcn3 side. |
Alexander Couzens | 1650b16 | 2021-06-13 04:05:56 +0200 | [diff] [blame] | 820 | */ |
| 821 | testcase TC_sns_bss_all_signalling_nsvcs_failed() runs on RAW_Test_CT { |
| 822 | g_handle_rx_alive := true; |
| 823 | f_init_vty(); |
| 824 | f_init_ns_codec(mp_nsconfig); |
| 825 | f_init_ns_codec(mp_nsconfig, 1); |
| 826 | f_incoming_sns_size(); |
| 827 | f_incoming_sns_config(); |
| 828 | f_outgoing_sns_config(); |
| 829 | var default d := activate(as_rx_alive_tx_ack()); |
| 830 | |
| 831 | f_vty_config2(NSVTY, {"ns", "bind udp local2"}, "ip-sns signalling-weight 0 data-weight 99"); |
| 832 | f_vty_config2(NSVTY, {"ns", "nse " & int2str(g_nsconfig.nsei)}, "ip-sns-bind local2"); |
| 833 | f_incoming_sns_add(idx_add := 1, w_sig := 0, w_user := 99); |
| 834 | as_rx_alive_tx_ack(oneshot := true, idx := 1); |
| 835 | activate(as_rx_alive_tx_ack(idx := 1)); |
| 836 | /* 2x NSVCs up, stop first NSVC */ |
| 837 | deactivate(d); |
| 838 | /* libosmocore will rotate the SNS binds on failure */ |
| 839 | NSCP[0].receive(t_NS_ALIVE); |
| 840 | NSCP[0].receive(t_NS_ALIVE); |
| 841 | NSCP[0].receive(t_NS_ALIVE); |
| 842 | f_incoming_sns_size(idx := 1); |
| 843 | |
| 844 | setverdict(pass); |
| 845 | f_clean_ns_codec(); |
| 846 | } |
| 847 | |
Alexander Couzens | fdfe638 | 2021-09-03 23:17:35 +0200 | [diff] [blame] | 848 | /* Test if SNS fails when removing a bind which has the last valid connection |
| 849 | * |
| 850 | * ns2 has 2 binds, ttcn3 1 bind. |
| 851 | * |
| 852 | * nsvcs: |
| 853 | * ns2 ttcn3 |
| 854 | * 1*-----------*1 |
| 855 | * / |
| 856 | * 2*-broken--/ |
| 857 | * |
| 858 | * remove the 1st ns2 bind. |
| 859 | */ |
| 860 | testcase TC_sns_bss_remove_bind_fail_sns() runs on RAW_Test_CT { |
| 861 | g_handle_rx_alive := true; |
| 862 | f_init_vty(); |
| 863 | f_init_ns_codec(mp_nsconfig); |
| 864 | f_init_ns_codec(mp_nsconfig, 1); |
| 865 | f_incoming_sns_size(); |
| 866 | f_incoming_sns_config(); |
| 867 | f_outgoing_sns_config(); |
| 868 | var default d := activate(as_rx_alive_tx_ack()); |
| 869 | |
| 870 | f_vty_config2(NSVTY, {"ns", "bind udp local2"}, "ip-sns signalling-weight 1 data-weight 1"); |
| 871 | f_vty_config2(NSVTY, {"ns", "nse " & int2str(g_nsconfig.nsei)}, "ip-sns-bind local2"); |
| 872 | f_incoming_sns_add(idx_add := 1, w_sig := 1, w_user := 1); |
| 873 | /* 2nd bind won't have a valid connection to the ttcn3 */ |
| 874 | NSCP[1].receive(t_NS_ALIVE); |
| 875 | NSCP[1].receive(t_NS_ALIVE); |
| 876 | NSCP[1].receive(t_NS_ALIVE); |
| 877 | NSCP[1].receive(t_NS_ALIVE); |
| 878 | NSCP[1].receive(t_NS_ALIVE); |
| 879 | f_sleep(1.0); |
| 880 | f_vty_config2(NSVTY, {"ns", "nse " & int2str(g_nsconfig.nsei)}, "no ip-sns-bind local"); |
| 881 | setverdict(pass); |
| 882 | f_clean_ns_codec(); |
| 883 | } |
| 884 | |
Alexander Couzens | 5eeebaa | 2021-07-12 18:15:42 +0200 | [diff] [blame] | 885 | testcase TC_idle() runs on RAW_Test_CT { |
| 886 | f_init_vty(); |
| 887 | f_init_ns_codec(mp_nsconfig, guard_secs := 30.0); |
| 888 | |
| 889 | /* do a NS Reset procedure */ |
| 890 | f_outgoing_ns_reset(); |
| 891 | activate(as_rx_alive_tx_ack()); |
| 892 | |
| 893 | f_outgoing_ns_unblock(); |
| 894 | f_sleep(30.0); |
| 895 | |
| 896 | setverdict(pass); |
| 897 | f_sleep(1.0); |
| 898 | f_clean_ns_codec(); |
| 899 | } |
| 900 | |
Alexander Couzens | 358c74c | 2021-08-06 18:01:06 +0200 | [diff] [blame] | 901 | testcase TC_sns_sgsn_config_success() runs on RAW_Test_CT { |
| 902 | f_init_vty(); |
| 903 | f_init_ns_codec(mp_nsconfig); |
| 904 | f_outgoing_sns_size(); |
| 905 | f_outgoing_sns_config(); |
| 906 | f_incoming_sns_config(); |
| 907 | setverdict(pass); |
| 908 | f_clean_ns_codec(); |
| 909 | } |
| 910 | |
Alexander Couzens | 13b3ec8 | 2021-09-06 17:45:54 +0200 | [diff] [blame] | 911 | /* Ensure a SIZE after a success full configuration is handled */ |
| 912 | testcase TC_sns_sgsn_size_after_success() runs on RAW_Test_CT { |
| 913 | f_init_vty(); |
| 914 | f_init_ns_codec(mp_nsconfig); |
| 915 | f_outgoing_sns_size(); |
| 916 | f_outgoing_sns_config(); |
| 917 | f_incoming_sns_config(); |
| 918 | NSCP[0].receive(t_NS_ALIVE); |
| 919 | |
| 920 | f_outgoing_sns_size(); |
| 921 | f_outgoing_sns_config(); |
| 922 | f_incoming_sns_config(); |
| 923 | setverdict(pass); |
| 924 | f_clean_ns_codec(); |
| 925 | } |
| 926 | |
Alexander Couzens | 717bb21 | 2021-09-04 01:23:42 +0200 | [diff] [blame] | 927 | /* Ensure a SNS SIZE ACK is transmitted from the correct port */ |
| 928 | testcase TC_sns_sgsn_size_correct_port() runs on RAW_Test_CT { |
| 929 | f_init_vty(); |
| 930 | f_init_ns_codec(mp_nsconfig); |
| 931 | f_init_ns_codec(mp_nsconfig, 1); |
| 932 | f_outgoing_sns_size(max_nsvcs := 10); |
| 933 | f_outgoing_sns_config(); |
| 934 | f_incoming_sns_config(); |
| 935 | NSCP[0].receive(t_NS_ALIVE); |
| 936 | f_outgoing_sns_size(max_nsvcs := 10, idx := 1); |
| 937 | setverdict(pass); |
| 938 | f_clean_ns_codec(); |
| 939 | } |
| 940 | |
Alexander Couzens | 6b51a3c | 2021-08-06 18:23:49 +0200 | [diff] [blame] | 941 | testcase TC_sns_sgsn_add() runs on RAW_Test_CT { |
| 942 | g_handle_rx_alive := true; |
| 943 | f_init_vty(); |
| 944 | f_init_ns_codec(mp_nsconfig); |
| 945 | f_init_ns_codec(mp_nsconfig, 1); |
| 946 | f_outgoing_sns_size(max_nsvcs := 4, num_ip := 4); |
| 947 | f_outgoing_sns_config(); |
| 948 | f_incoming_sns_config(); |
| 949 | activate(as_rx_alive_tx_ack()); |
| 950 | |
| 951 | f_vty_config2(NSVTY, {"ns", "nse " & int2str(g_nsconfig.nsei)}, "ip-sns-bind local2"); |
| 952 | f_incoming_sns_add(idx_add := 1); |
| 953 | as_rx_alive_tx_ack(oneshot := true, idx := 1); |
| 954 | |
| 955 | setverdict(pass); |
| 956 | f_clean_ns_codec(); |
| 957 | } |
| 958 | |
Alexander Couzens | 8a682d6 | 2021-08-06 22:24:47 +0200 | [diff] [blame] | 959 | testcase TC_sns_sgsn_del() runs on RAW_Test_CT { |
| 960 | g_handle_rx_alive := true; |
| 961 | f_init_vty(); |
| 962 | f_init_ns_codec(mp_nsconfig); |
| 963 | f_init_ns_codec(mp_nsconfig, 1); |
| 964 | f_outgoing_sns_size(max_nsvcs := 4, num_ip := 4); |
| 965 | f_outgoing_sns_config(); |
| 966 | f_incoming_sns_config(); |
| 967 | activate(as_rx_alive_tx_ack()); |
| 968 | |
| 969 | f_vty_config2(NSVTY, {"ns", "nse " & int2str(g_nsconfig.nsei)}, "ip-sns-bind local2"); |
| 970 | f_incoming_sns_add(idx_add := 1); |
| 971 | as_rx_alive_tx_ack(oneshot := true, idx := 1); |
| 972 | |
| 973 | /* delete the endpoint */ |
| 974 | f_vty_config2(NSVTY, {"ns", "nse " & int2str(g_nsconfig.nsei)}, "no ip-sns-bind local2"); |
| 975 | f_incoming_sns_del(idx_del := 1); |
| 976 | |
| 977 | setverdict(pass); |
| 978 | f_clean_ns_codec(); |
| 979 | } |
Alexander Couzens | 6b51a3c | 2021-08-06 18:23:49 +0200 | [diff] [blame] | 980 | |
Alexander Couzens | 3921fb5 | 2021-08-12 04:04:20 +0200 | [diff] [blame] | 981 | /* 1. do SNS configuration |
| 982 | * 2. add a bind |
| 983 | * 3. receive the SNS_ADD |
| 984 | * 4. before answering the SNS_ADD, change the weight via vty and remove the bind |
| 985 | */ |
| 986 | testcase TC_sns_sgsn_add_change_del() runs on RAW_Test_CT { |
| 987 | var PDU_NS rx; |
| 988 | var NSVCConfiguration nsvc_cfg; |
| 989 | |
| 990 | g_handle_rx_alive := true; |
| 991 | f_init_vty(); |
| 992 | f_init_ns_codec(mp_nsconfig); |
| 993 | f_init_ns_codec(mp_nsconfig, 1); |
| 994 | f_outgoing_sns_size(max_nsvcs := 4, num_ip := 4); |
| 995 | f_outgoing_sns_config(); |
| 996 | f_incoming_sns_config(); |
| 997 | activate(as_rx_alive_tx_ack()); |
| 998 | f_vty_config2(NSVTY, {"ns", "nse " & int2str(g_nsconfig.nsei)}, "ip-sns-bind local2"); |
| 999 | |
| 1000 | /* rx SNS ADD */ |
| 1001 | nsvc_cfg := g_nsconfig.nsvc[1]; |
| 1002 | if (nsvc_cfg.provider.ip.address_family == AF_INET) { |
| 1003 | var template (omit) IP4_Elements v4_elem := { ts_SNS_IPv4(nsvc_cfg.provider.ip.remote_ip, |
| 1004 | nsvc_cfg.provider.ip.remote_udp_port, |
| 1005 | 1, 1) }; |
| 1006 | rx := f_ns_exp(tr_SNS_ADD(g_nsconfig.nsei, ?, v4 := v4_elem), 0); |
| 1007 | } else { |
| 1008 | var template (omit) IP6_Elements v6_elem := { ts_SNS_IPv6(nsvc_cfg.provider.ip.remote_ip, |
| 1009 | nsvc_cfg.provider.ip.remote_udp_port, |
| 1010 | 1, 1) }; |
| 1011 | rx := f_ns_exp(tr_SNS_ADD(g_nsconfig.nsei, ?, omit, v6_elem), 0); |
| 1012 | } |
| 1013 | |
| 1014 | /* delete the endpoint */ |
| 1015 | f_vty_config2(NSVTY, {"ns", "bind udp local2"}, "ip-sns signalling-weight 99 data-weight 99"); |
| 1016 | f_vty_config2(NSVTY, {"ns", "nse " & int2str(g_nsconfig.nsei)}, "no ip-sns-bind local2"); |
| 1017 | |
| 1018 | /* accept the SNS_ADD */ |
| 1019 | NSCP[0].send(ts_SNS_ACK(g_nsconfig.nsei, rx.pDU_SNS_Add.transactionID)); |
| 1020 | |
| 1021 | f_incoming_sns_chg_weight(idx_chg := 1); |
| 1022 | f_incoming_sns_del(idx_del := 1, w_sig := 99, w_user := 99); |
| 1023 | setverdict(pass); |
| 1024 | f_clean_ns_codec(); |
| 1025 | } |
| 1026 | |
Alexander Couzens | 357c572 | 2021-09-06 01:20:18 +0200 | [diff] [blame] | 1027 | /* 48.016 7.2 transmit a UNITDATA over an ALIVE connection |
| 1028 | * |
| 1029 | * TTCN -> NS: reset |
| 1030 | * TTCN <- NS: reset ack |
| 1031 | * TTCN -> NS: unblock |
| 1032 | * TTCN <- NS: unblock ack |
| 1033 | * TTCN -> NS: unitdata |
| 1034 | * TTCN <- NS: unitdata (mirror) |
| 1035 | */ |
| 1036 | testcase TC_tx_unitdata() runs on RAW_Test_CT { |
| 1037 | f_tx_unblock(); |
| 1038 | |
| 1039 | f_vty_config2(NSVTY, {}, "mirror-mode enable"); |
| 1040 | NSCP[0].send(ts_NS_UNITDATA(t_SduCtrlB, 42, '0011234242230101'O)); |
| 1041 | f_ns_exp(tr_NS_UNITDATA(t_SduCtrlB, 42, '0011234242230101'O)); |
| 1042 | f_vty_config2(NSVTY, {}, "mirror-mode disable"); |
| 1043 | |
| 1044 | f_sleep(1.0); |
| 1045 | f_clean_ns_codec(); |
| 1046 | } |
| 1047 | |
Alexander Couzens | 9061ebd | 2021-09-07 01:00:23 +0200 | [diff] [blame] | 1048 | /* 48.016 7.2 ensure tx status (blocked) is correctly parsed |
| 1049 | * |
| 1050 | * TTCN -> NS: reset |
| 1051 | * TTCN <- NS: reset ack |
| 1052 | * TTCN -> NS: unblock |
| 1053 | * TTCN <- NS: unblock ack |
| 1054 | * TTCN -> NS: unitdata |
| 1055 | * TTCN <- NS: unitdata (mirror) |
| 1056 | * TTCN -> NS: status (blocked) |
| 1057 | * TTCN -> NS: unitdata |
| 1058 | * TTCN <- NS: status (blocked) |
| 1059 | */ |
| 1060 | testcase TC_mirror_unitdata_tx_status_blocked() runs on RAW_Test_CT { |
| 1061 | f_tx_unblock(); |
| 1062 | |
| 1063 | f_vty_config2(NSVTY, {}, "mirror-mode enable"); |
| 1064 | NSCP[0].send(ts_NS_UNITDATA(t_SduCtrlB, 42, '0011234242230101'O)); |
| 1065 | var PDU_NS pdu := f_ns_exp(tr_NS_UNITDATA(t_SduCtrlB, 42, '0011234242230101'O)); |
| 1066 | |
| 1067 | NSCP[0].send(ts_NS_STATUS(NS_CAUSE_NSVC_BLOCKED, pdu)); |
| 1068 | NSCP[0].send(ts_NS_UNITDATA(t_SduCtrlB, 42, '0011234242230101'O)); |
| 1069 | f_ns_exp(tr_NS_STATUS(NS_CAUSE_NSVC_BLOCKED)); |
| 1070 | |
| 1071 | f_vty_config2(NSVTY, {}, "mirror-mode disable"); |
| 1072 | f_sleep(1.0); |
| 1073 | f_clean_ns_codec(); |
| 1074 | } |
| 1075 | |
Alexander Couzens | 6d91691 | 2021-09-23 15:16:08 +0200 | [diff] [blame] | 1076 | /* 48.016 7.2 ensure tx status (blocked) is correctly parsed over a foreign NSVC |
| 1077 | * |
| 1078 | * 2x initialize NSVC (RESET/UNBLOCK) |
| 1079 | * TTCN 0-> NS: block (nsvci 1) |
| 1080 | * TTCN <-0 NS: block ack (nsvci 1) |
| 1081 | * TTCN 1-> NS: unit data (nsvci 1) |
| 1082 | * TTCN <-1 NS: status (blocked) |
| 1083 | */ |
| 1084 | testcase TC_tx_blocked_foreign_nsvc() runs on RAW_Test_CT { |
| 1085 | f_init_vty(); |
| 1086 | f_vty_config2(NSVTY, {}, "mirror-mode enable"); |
| 1087 | f_init_ns_codec(mp_nsconfig, idx := 0); |
| 1088 | f_init_ns_codec(mp_nsconfig, idx := 1); |
| 1089 | |
| 1090 | /* do a NS Reset procedure */ |
| 1091 | f_outgoing_ns_reset(idx := 0); |
| 1092 | f_outgoing_ns_reset(idx := 1); |
| 1093 | |
| 1094 | /* send alive acks */ |
| 1095 | activate(as_rx_alive_tx_ack(idx := 0)); |
| 1096 | activate(as_rx_alive_tx_ack(idx := 1)); |
| 1097 | |
| 1098 | f_outgoing_ns_unblock(idx := 0); |
| 1099 | f_outgoing_ns_unblock(idx := 1); |
| 1100 | |
| 1101 | /* both NSVC are alive and unblocked */ |
| 1102 | NSCP[0].send(ts_NS_BLOCK(NS_CAUSE_TRANSIT_NETWORK_FAILURE, g_nsconfig.nsvc[1].nsvci)); |
| 1103 | f_ns_exp(tr_NS_BLOCK_ACK(g_nsconfig.nsvc[1].nsvci)); |
| 1104 | |
| 1105 | NSCP[1].send(ts_NS_UNITDATA(t_SduCtrlB, 42, '0011234242230101'O)); |
| 1106 | f_ns_exp(tr_NS_STATUS(NS_CAUSE_NSVC_BLOCKED), idx := 1); |
| 1107 | |
| 1108 | setverdict(pass); |
| 1109 | f_clean_ns_codec(); |
| 1110 | } |
| 1111 | |
| 1112 | |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 1113 | control { |
Alexander Couzens | e48d355 | 2021-02-27 20:01:16 +0100 | [diff] [blame] | 1114 | if (mp_dialect == NS2_DIALECT_STATIC_RESETBLOCK or mp_dialect == NS2_DIALECT_IPACCESS) { |
| 1115 | execute( TC_tx_reset() ); |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 1116 | |
Alexander Couzens | e48d355 | 2021-02-27 20:01:16 +0100 | [diff] [blame] | 1117 | /* 48.016 7.2 Block procedure */ |
| 1118 | execute( TC_tx_block() ); |
| 1119 | execute( TC_tx_block_by_vty() ); |
| 1120 | execute( TC_tx_block_by_vty_reset() ); |
Alexander Couzens | 94d3d10 | 2021-09-06 00:20:42 +0200 | [diff] [blame] | 1121 | execute( TC_tx_block_unitdata_over_blocked() ); |
| 1122 | execute( TC_rx_block_unitdata_over_blocked() ); |
Alexander Couzens | 9061ebd | 2021-09-07 01:00:23 +0200 | [diff] [blame] | 1123 | execute( TC_mirror_unitdata_tx_status_blocked() ); |
Alexander Couzens | 6d91691 | 2021-09-23 15:16:08 +0200 | [diff] [blame] | 1124 | execute( TC_tx_blocked_foreign_nsvc() ); |
Alexander Couzens | e48d355 | 2021-02-27 20:01:16 +0100 | [diff] [blame] | 1125 | // execute( TC_block_other_nsvc() ); // reset, unblock, sleep(1), block over another nsvci |
| 1126 | /* 48.016 7.2 Unblock procedure */ |
| 1127 | execute( TC_tx_unblock() ); |
| 1128 | execute( TC_tx_unblock_retries() ); |
| 1129 | // execute( TC_rx_unblock_tx_unblock() ); // wait for an rx unblock pdu, send an unblock pdu, expect unblock ack pdu |
| 1130 | // execute( TC_unblockable() ); // block a NS-VCI via vty, try block procedure |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 1131 | |
Alexander Couzens | e48d355 | 2021-02-27 20:01:16 +0100 | [diff] [blame] | 1132 | /* 48.016 7.2.1 Block Abnormal Condition */ |
| 1133 | /* 48.016 7.2.1 Unblock Abnormal Condition */ |
| 1134 | /* 48.016 7.3.1 Abnormal Condition */ |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 1135 | execute( TC_reset_wrong_nsei() ); |
| 1136 | execute( TC_reset_wrong_nsvci() ); |
| 1137 | execute( TC_reset_wrong_nsei_nsvci() ); |
| 1138 | execute( TC_reset_ack_wrong_nsei() ); |
| 1139 | execute( TC_reset_ack_wrong_nsvci() ); |
| 1140 | execute( TC_reset_ack_wrong_nsei_nsvci() ); |
| 1141 | execute( TC_reset_retries() ); |
| 1142 | execute( TC_reset_on_block_reset() ); |
Alexander Couzens | e48d355 | 2021-02-27 20:01:16 +0100 | [diff] [blame] | 1143 | execute( TC_ignore_reset_ack() ); |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 1144 | |
Alexander Couzens | e48d355 | 2021-02-27 20:01:16 +0100 | [diff] [blame] | 1145 | /* 48.016 7.4 Test procedure on frame relay */ |
| 1146 | execute( TC_tx_reset_tx_alive() ); |
| 1147 | execute( TC_tx_reset_rx_alive() ); |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 1148 | |
Alexander Couzens | e48d355 | 2021-02-27 20:01:16 +0100 | [diff] [blame] | 1149 | /* 48.016 7.4.1 Abnormal Condition */ |
| 1150 | if (mp_dialect == NS2_DIALECT_STATIC_RESETBLOCK) { |
| 1151 | // execute( TC_alive_retries_multi() ); // check if alive retries works and block over an alive nsvc |
| 1152 | execute( TC_alive_retries_single_reset() ); |
| 1153 | } else if (mp_dialect == NS2_DIALECT_IPACCESS) { |
| 1154 | execute( TC_alive_retries_single_no_resp() ); |
| 1155 | } |
| 1156 | |
| 1157 | execute( TC_no_reset_alive_ack() ); |
Alexander Couzens | 357c572 | 2021-09-06 01:20:18 +0200 | [diff] [blame] | 1158 | execute( TC_tx_unitdata() ); |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 1159 | } |
Alexander Couzens | cbee32a | 2021-02-27 20:50:20 +0100 | [diff] [blame] | 1160 | |
| 1161 | if (mp_dialect == NS2_DIALECT_SNS) { |
Alexander Couzens | de3dfaa | 2021-08-06 17:59:54 +0200 | [diff] [blame] | 1162 | if (mp_sns_role == SNS_ROLE_BSS) { |
| 1163 | /* BSS test cases */ |
| 1164 | execute( TC_sns_bss_config_success() ); |
| 1165 | execute( TC_sns_bss_change_weight() ); |
| 1166 | execute( TC_sns_bss_change_weight_timeout() ); |
| 1167 | execute( TC_sns_bss_add() ); |
| 1168 | execute( TC_sns_bss_del() ); |
| 1169 | execute( TC_sns_bss_add_change_del() ); |
Alexander Couzens | 8122ed2 | 2021-08-06 22:01:20 +0200 | [diff] [blame] | 1170 | /* execute( TC_sns_bss_all_signalling_nsvcs_failed() ); */ |
Alexander Couzens | de3dfaa | 2021-08-06 17:59:54 +0200 | [diff] [blame] | 1171 | execute( TC_sns_rx_size_force_unconf() ); |
Alexander Couzens | fdfe638 | 2021-09-03 23:17:35 +0200 | [diff] [blame] | 1172 | execute( TC_sns_bss_remove_bind_fail_sns() ); |
Alexander Couzens | de3dfaa | 2021-08-06 17:59:54 +0200 | [diff] [blame] | 1173 | } |
Alexander Couzens | 358c74c | 2021-08-06 18:01:06 +0200 | [diff] [blame] | 1174 | |
| 1175 | if (mp_sns_role == SNS_ROLE_SGSN) { |
| 1176 | execute( TC_sns_sgsn_config_success() ); |
Alexander Couzens | 6b51a3c | 2021-08-06 18:23:49 +0200 | [diff] [blame] | 1177 | execute( TC_sns_sgsn_add() ); |
Alexander Couzens | 8a682d6 | 2021-08-06 22:24:47 +0200 | [diff] [blame] | 1178 | execute( TC_sns_sgsn_del() ); |
Alexander Couzens | 3921fb5 | 2021-08-12 04:04:20 +0200 | [diff] [blame] | 1179 | execute( TC_sns_sgsn_add_change_del() ); |
Alexander Couzens | 717bb21 | 2021-09-04 01:23:42 +0200 | [diff] [blame] | 1180 | execute( TC_sns_sgsn_size_correct_port() ); |
Alexander Couzens | 13b3ec8 | 2021-09-06 17:45:54 +0200 | [diff] [blame] | 1181 | execute( TC_sns_sgsn_size_after_success() ); |
arehbein | 2a6726c | 2022-11-30 22:40:43 +0100 | [diff] [blame] | 1182 | execute( TC_sns_sgsn_sns_size_syntactically_wrong_NSEI() ); |
arehbein | 1b007f0 | 2022-11-30 23:01:48 +0100 | [diff] [blame^] | 1183 | execute( TC_sns_sgsn_sns_size_invalid_num_of_ip_eps() ); |
Alexander Couzens | 358c74c | 2021-08-06 18:01:06 +0200 | [diff] [blame] | 1184 | } |
Alexander Couzens | cbee32a | 2021-02-27 20:50:20 +0100 | [diff] [blame] | 1185 | } |
Alexander Couzens | 20cd41e | 2021-01-11 02:56:03 +0100 | [diff] [blame] | 1186 | } |
| 1187 | |
| 1188 | } |