Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 1 | module PCU_Tests_SNS { |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 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; |
Pau Espin Pedrol | 8dd59fb | 2020-04-29 15:08:16 +0200 | [diff] [blame] | 14 | import from PCU_Tests_NS all; |
Pau Espin Pedrol | 0e6ed2e | 2020-04-29 14:33:13 +0200 | [diff] [blame] | 15 | import from SGSN_Components all; |
Harald Welte | c4d7beb | 2019-02-21 18:21:01 +0100 | [diff] [blame] | 16 | import from Osmocom_Gb_Types all; |
Harald Welte | 90f1974 | 2020-11-06 19:34:40 +0100 | [diff] [blame] | 17 | import from NS_Emulation all; |
Harald Welte | c4d7beb | 2019-02-21 18:21:01 +0100 | [diff] [blame] | 18 | import from NS_Types all; |
Alexander Couzens | 3c268da | 2020-09-07 04:25:05 +0200 | [diff] [blame] | 19 | import from RAW_NS all; |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 20 | |
| 21 | /********************************************************************************** |
| 22 | * Modern Gb/IP bring-up test cases using IP Sub-Network Service (SNS) |
| 23 | **********************************************************************************/ |
| 24 | |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 25 | /* PCU-originated SNS-SIZE: successful case */ |
Harald Welte | ea3c7e9 | 2019-03-01 19:34:55 +0100 | [diff] [blame] | 26 | testcase TC_sns_po_size_success() runs on RAW_Test_CT { |
Alexander Couzens | 2beaa20 | 2020-09-11 20:08:41 +0200 | [diff] [blame] | 27 | f_init_ns_codec(mp_nsconfig); |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 28 | f_init_pcuif(); |
| 29 | f_incoming_sns_size(); |
| 30 | f_sleep(1.0); |
| 31 | setverdict(pass); |
Alexander Couzens | c316572 | 2021-01-11 02:51:45 +0100 | [diff] [blame] | 32 | f_clean_ns_codec(); |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 33 | } |
| 34 | |
| 35 | /* PCU-originated SNS-SIZE: NACK from our side */ |
Harald Welte | ea3c7e9 | 2019-03-01 19:34:55 +0100 | [diff] [blame] | 36 | testcase TC_sns_po_size_nack() runs on RAW_Test_CT { |
Alexander Couzens | 2beaa20 | 2020-09-11 20:08:41 +0200 | [diff] [blame] | 37 | f_init_ns_codec(mp_nsconfig); |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 38 | f_init_pcuif(); |
| 39 | f_incoming_sns_size(NS_CAUSE_PROTOCOL_ERROR_UNSPEIFIED); |
| 40 | /* FIXME: ensure we don't get a SNS-CONFIG */ |
| 41 | /* FIXME: ensure we get re-transmitted SNS-SIZE attempts */ |
| 42 | f_sleep(10.0); |
| 43 | setverdict(pass); |
Alexander Couzens | c316572 | 2021-01-11 02:51:45 +0100 | [diff] [blame] | 44 | f_clean_ns_codec(); |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 45 | } |
| 46 | |
| 47 | /* PCU-originated SNS-CONFIG: successful case */ |
Harald Welte | ea3c7e9 | 2019-03-01 19:34:55 +0100 | [diff] [blame] | 48 | testcase TC_sns_po_config_success() runs on RAW_Test_CT { |
Alexander Couzens | 2beaa20 | 2020-09-11 20:08:41 +0200 | [diff] [blame] | 49 | f_init_ns_codec(mp_nsconfig); |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 50 | f_init_pcuif(); |
| 51 | f_incoming_sns_size(); |
| 52 | f_incoming_sns_config(); |
| 53 | f_sleep(1.0); |
| 54 | setverdict(pass); |
Alexander Couzens | c316572 | 2021-01-11 02:51:45 +0100 | [diff] [blame] | 55 | f_clean_ns_codec(); |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 56 | } |
| 57 | |
| 58 | /* PCU-originated SNS-CONFIG: successful case */ |
Harald Welte | ea3c7e9 | 2019-03-01 19:34:55 +0100 | [diff] [blame] | 59 | testcase TC_sns_po_config_nack() runs on RAW_Test_CT { |
Alexander Couzens | 2beaa20 | 2020-09-11 20:08:41 +0200 | [diff] [blame] | 60 | f_init_ns_codec(mp_nsconfig); |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 61 | f_init_pcuif(); |
| 62 | f_incoming_sns_size(); |
| 63 | f_incoming_sns_config(NS_CAUSE_PROTOCOL_ERROR_UNSPEIFIED); |
| 64 | /* FIXME: ensure we get re-transmitted SNS-CONFIG attempts */ |
| 65 | f_sleep(10.0); |
| 66 | setverdict(pass); |
Alexander Couzens | c316572 | 2021-01-11 02:51:45 +0100 | [diff] [blame] | 67 | f_clean_ns_codec(); |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 68 | } |
| 69 | |
| 70 | |
| 71 | /* SGSN-originated SNS-SIZE: successful case */ |
Harald Welte | ea3c7e9 | 2019-03-01 19:34:55 +0100 | [diff] [blame] | 72 | testcase TC_sns_so_config_success() runs on RAW_Test_CT { |
Alexander Couzens | 2beaa20 | 2020-09-11 20:08:41 +0200 | [diff] [blame] | 73 | f_init_ns_codec(mp_nsconfig); |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 74 | f_init_pcuif(); |
| 75 | f_incoming_sns_size(); |
| 76 | f_incoming_sns_config(); |
| 77 | f_outgoing_sns_config(); |
| 78 | |
| 79 | /* wait for one ALIVE cycle, then ACK any further ALIVE in the background */ |
| 80 | as_rx_alive_tx_ack(oneshot := true); |
| 81 | activate(as_rx_alive_tx_ack()); |
| 82 | |
| 83 | f_outgoing_ns_alive(); |
| 84 | |
| 85 | /* Expect BVC-RESET for signaling (0) and ptp BVCI */ |
Harald Welte | e97e3af | 2020-10-09 14:56:54 +0200 | [diff] [blame] | 86 | as_rx_bvc_reset_tx_ack(0, omit, omit, oneshot := true); |
| 87 | as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvc[0].bvci, mp_gb_cfg.bvc[0].cell_id, omit, oneshot := true); |
Harald Welte | 5339b2e | 2020-10-04 22:52:56 +0200 | [diff] [blame] | 88 | as_rx_bvc_unblock_tx_ack(mp_gb_cfg.bvc[0].bvci, oneshot := true); |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 89 | |
| 90 | /* wait for one FLOW-CONTROL BVC and then ACK any further in the future */ |
Harald Welte | 5339b2e | 2020-10-04 22:52:56 +0200 | [diff] [blame] | 91 | as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvc[0].bvci, oneshot := true); |
| 92 | activate(as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvc[0].bvci)); |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 93 | setverdict(pass); |
Alexander Couzens | c316572 | 2021-01-11 02:51:45 +0100 | [diff] [blame] | 94 | f_clean_ns_codec(); |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 95 | } |
| 96 | |
Harald Welte | 64d0731 | 2019-03-20 09:48:39 +0100 | [diff] [blame] | 97 | 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] | 98 | /* Activate two NS codec ports */ |
Alexander Couzens | 2beaa20 | 2020-09-11 20:08:41 +0200 | [diff] [blame] | 99 | f_init_ns_codec(mp_nsconfig); |
| 100 | f_init_ns_codec(mp_nsconfig, 1); |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 101 | f_init_pcuif(); |
| 102 | /* Perform Size + BSS-originated config */ |
| 103 | f_incoming_sns_size(); |
| 104 | f_incoming_sns_config(); |
| 105 | /* perform SGSN-originated config using idx==0 for signalling and idx==1 for user traffic */ |
| 106 | f_outgoing_sns_config_1c1u(); |
| 107 | |
| 108 | /* wait for one ALIVE cycle, then ACK any further ALIVE in the background |
| 109 | * for both NS-VCs */ |
| 110 | as_rx_alive_tx_ack(oneshot := true, idx := 0); |
| 111 | activate(as_rx_alive_tx_ack(idx := 0)); |
| 112 | as_rx_alive_tx_ack(oneshot := true, idx := 1); |
| 113 | activate(as_rx_alive_tx_ack(idx := 1)); |
| 114 | |
| 115 | /* perform outgoing ALIVE procedure for both NS-VCs */ |
| 116 | f_outgoing_ns_alive(0); |
| 117 | f_outgoing_ns_alive(1); |
| 118 | |
Harald Welte | 64d0731 | 2019-03-20 09:48:39 +0100 | [diff] [blame] | 119 | if (sgsn_originated_reset) { |
Alexander Couzens | 195c9e7 | 2020-10-26 23:09:16 +0100 | [diff] [blame] | 120 | /* Expect BVC-RESET, but ignore it to prevent a race condition of BVC RESETs */ |
| 121 | var template PDU_NS pdu := tr_NS_UNITDATA(t_SduCtrlB, 0, decmatch tr_BVC_RESET(?, 0, omit)); |
| 122 | f_ns_exp(pdu); |
| 123 | /* SGSN originated BVC-RESET on an uninitialized signalling BVC */ |
Harald Welte | e97e3af | 2020-10-09 14:56:54 +0200 | [diff] [blame] | 124 | f_tx_bvc_reset_rx_ack(0, omit, omit); |
Alexander Couzens | 195c9e7 | 2020-10-26 23:09:16 +0100 | [diff] [blame] | 125 | |
| 126 | /* Expect BVC-RESET PTP BVC, but ignore it to prevent a race condition of BVC RESETs */ |
| 127 | pdu := tr_NS_UNITDATA(t_SduCtrlB, 0, decmatch tr_BVC_RESET(?, mp_gb_cfg.bvc[0].bvci, mp_gb_cfg.bvc[0].cell_id)); |
| 128 | f_ns_exp(pdu); |
| 129 | /* SGSN originated BVC-RESET on an uninitialized PTP BVC */ |
Harald Welte | e97e3af | 2020-10-09 14:56:54 +0200 | [diff] [blame] | 130 | f_tx_bvc_reset_rx_ack(mp_gb_cfg.bvc[0].bvci, omit, mp_gb_cfg.bvc[0].cell_id); |
Harald Welte | 64d0731 | 2019-03-20 09:48:39 +0100 | [diff] [blame] | 131 | } else { |
Alexander Couzens | 195c9e7 | 2020-10-26 23:09:16 +0100 | [diff] [blame] | 132 | /* Expect BVC-RESET for signaling BVCI=0 */ |
Harald Welte | e97e3af | 2020-10-09 14:56:54 +0200 | [diff] [blame] | 133 | as_rx_bvc_reset_tx_ack(0, omit, omit, oneshot := true); |
Alexander Couzens | 195c9e7 | 2020-10-26 23:09:16 +0100 | [diff] [blame] | 134 | /* Expect BVC-RESET from the PCU on PTP BVC */ |
Harald Welte | e97e3af | 2020-10-09 14:56:54 +0200 | [diff] [blame] | 135 | as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvc[0].bvci, mp_gb_cfg.bvc[0].cell_id, omit, oneshot := true); |
Harald Welte | 64d0731 | 2019-03-20 09:48:39 +0100 | [diff] [blame] | 136 | } |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 137 | /* Expect UNBLOCK for ptp BVCI on signaling NS-VC (idx==0) */ |
Harald Welte | 5339b2e | 2020-10-04 22:52:56 +0200 | [diff] [blame] | 138 | as_rx_bvc_unblock_tx_ack(mp_gb_cfg.bvc[0].bvci, oneshot := true); |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 139 | |
| 140 | /* wait for one FLOW-CONTROL BVC and then ACK any further in the future. Flow |
| 141 | * control happens on the p-t-p BVCI and hence on index 1 */ |
Harald Welte | 5339b2e | 2020-10-04 22:52:56 +0200 | [diff] [blame] | 142 | as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvc[0].bvci, oneshot := true, idx := 1); |
| 143 | activate(as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvc[0].bvci, idx := 1)); |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 144 | } |
| 145 | |
| 146 | /* 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] | 147 | testcase TC_sns_1c1u() runs on RAW_Test_CT { |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 148 | f_sns_bringup_1c1u(); |
| 149 | setverdict(pass); |
Alexander Couzens | c316572 | 2021-01-11 02:51:45 +0100 | [diff] [blame] | 150 | f_clean_ns_codec(); |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 151 | } |
| 152 | |
Harald Welte | 64d0731 | 2019-03-20 09:48:39 +0100 | [diff] [blame] | 153 | 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] | 154 | /* Activate two NS codec ports */ |
Alexander Couzens | 2beaa20 | 2020-09-11 20:08:41 +0200 | [diff] [blame] | 155 | f_init_ns_codec(mp_nsconfig); |
| 156 | f_init_ns_codec(mp_nsconfig, 1); |
| 157 | f_init_ns_codec(mp_nsconfig, 2); |
Harald Welte | ecd159e | 2019-03-16 13:36:07 +0100 | [diff] [blame] | 158 | f_init_pcuif(); |
| 159 | /* Perform Size + BSS-originated config */ |
| 160 | f_incoming_sns_size(); |
| 161 | f_incoming_sns_config(); |
| 162 | /* perform SGSN-originated config using idx==0 for signalling and idx==1 for user traffic */ |
| 163 | f_outgoing_sns_config_1c1u_separate(); |
| 164 | |
| 165 | /* wait for one ALIVE cycle, then ACK any further ALIVE in the background |
| 166 | * for both NS-VCs */ |
| 167 | as_rx_alive_tx_ack(oneshot := true, idx := 1); |
| 168 | activate(as_rx_alive_tx_ack(idx := 1)); |
| 169 | as_rx_alive_tx_ack(oneshot := true, idx := 2); |
| 170 | activate(as_rx_alive_tx_ack(idx := 2)); |
| 171 | /* ensure there's no NS-ALIVE received on idx==0 */ |
| 172 | f_ensure_no_ns(t_NS_ALIVE, idx := 0); |
| 173 | |
| 174 | /* perform outgoing ALIVE procedure for both NS-VCs */ |
| 175 | f_outgoing_ns_alive(1); |
| 176 | f_outgoing_ns_alive(2); |
| 177 | /* ensure there's no response to NS-ALIVE sent on idx==0 */ |
| 178 | f_outgoing_ns_alive_no_ack(idx := 0); |
| 179 | |
Harald Welte | 64d0731 | 2019-03-20 09:48:39 +0100 | [diff] [blame] | 180 | if (sgsn_originated_reset) { |
Alexander Couzens | 195c9e7 | 2020-10-26 23:09:16 +0100 | [diff] [blame] | 181 | /* Expect BVC-RESET, but ignore it to prevent a race condition of BVC RESETs */ |
| 182 | var template PDU_NS pdu := tr_NS_UNITDATA(t_SduCtrlB, 0, decmatch tr_BVC_RESET(?, 0, omit)); |
| 183 | f_ns_exp(pdu, idx := 1); |
| 184 | /* SGSN originated BVC-RESET on an uninitialized sign BVC */ |
Harald Welte | e97e3af | 2020-10-09 14:56:54 +0200 | [diff] [blame] | 185 | f_tx_bvc_reset_rx_ack(0, omit, omit, idx := 1); |
Alexander Couzens | 195c9e7 | 2020-10-26 23:09:16 +0100 | [diff] [blame] | 186 | |
| 187 | /* Expect BVC-RESET PTP BVC, but ignore it to prevent a race condition of BVC RESETs */ |
| 188 | pdu := tr_NS_UNITDATA(t_SduCtrlB, 0, decmatch tr_BVC_RESET(?, mp_gb_cfg.bvc[0].bvci, mp_gb_cfg.bvc[0].cell_id)); |
| 189 | f_ns_exp(pdu, idx := 1); |
Harald Welte | e97e3af | 2020-10-09 14:56:54 +0200 | [diff] [blame] | 190 | f_tx_bvc_reset_rx_ack(mp_gb_cfg.bvc[0].bvci, omit, mp_gb_cfg.bvc[0].cell_id, idx := 1); |
Harald Welte | 64d0731 | 2019-03-20 09:48:39 +0100 | [diff] [blame] | 191 | } else { |
Alexander Couzens | 195c9e7 | 2020-10-26 23:09:16 +0100 | [diff] [blame] | 192 | /* Expect BVC-RESET for signaling BVCI=0 */ |
Harald Welte | e97e3af | 2020-10-09 14:56:54 +0200 | [diff] [blame] | 193 | as_rx_bvc_reset_tx_ack(0, omit, omit, oneshot := true, idx := 1); |
Alexander Couzens | 195c9e7 | 2020-10-26 23:09:16 +0100 | [diff] [blame] | 194 | /* Expect BVC-RESET from the PCU on PTP BVC */ |
Harald Welte | e97e3af | 2020-10-09 14:56:54 +0200 | [diff] [blame] | 195 | as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvc[0].bvci, mp_gb_cfg.bvc[0].cell_id, omit, oneshot := true, idx := 1); |
Harald Welte | 64d0731 | 2019-03-20 09:48:39 +0100 | [diff] [blame] | 196 | } |
Harald Welte | ecd159e | 2019-03-16 13:36:07 +0100 | [diff] [blame] | 197 | /* Expect UNBLOCK for ptp BVCI on signaling NS-VC (idx==1) */ |
Harald Welte | 5339b2e | 2020-10-04 22:52:56 +0200 | [diff] [blame] | 198 | as_rx_bvc_unblock_tx_ack(mp_gb_cfg.bvc[0].bvci, oneshot := true, idx := 1); |
Harald Welte | ecd159e | 2019-03-16 13:36:07 +0100 | [diff] [blame] | 199 | |
| 200 | /* wait for one FLOW-CONTROL BVC and then ACK any further in the future. Flow |
| 201 | * control happens on the p-t-p BVCI and hence on index 1 */ |
Harald Welte | 5339b2e | 2020-10-04 22:52:56 +0200 | [diff] [blame] | 202 | as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvc[0].bvci, oneshot := true, idx := 2); |
| 203 | activate(as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvc[0].bvci, idx := 2)); |
Harald Welte | ecd159e | 2019-03-16 13:36:07 +0100 | [diff] [blame] | 204 | } |
| 205 | |
| 206 | /* Test full IP-SNS bring-up with two NS-VCs, one sig-only and one user-only - and where |
| 207 | * the initial IP/port for the SNS procedure is *not* part of the NS-VCs later */ |
| 208 | testcase TC_sns_1c1u_separate() runs on RAW_Test_CT { |
| 209 | f_sns_bringup_1c1u_separate(); |
| 210 | setverdict(pass); |
Alexander Couzens | c316572 | 2021-01-11 02:51:45 +0100 | [diff] [blame] | 211 | f_clean_ns_codec(); |
Harald Welte | ecd159e | 2019-03-16 13:36:07 +0100 | [diff] [blame] | 212 | } |
| 213 | |
Harald Welte | 64d0731 | 2019-03-20 09:48:39 +0100 | [diff] [blame] | 214 | /* Test full IP-SNS bring-up with two NS-VCs, one sig-only and one user-only and use |
| 215 | * SGSN-originated BVC-RESET rather than BSS-originated */ |
| 216 | testcase TC_sns_1c1u_so_bvc_reset() runs on RAW_Test_CT { |
| 217 | f_sns_bringup_1c1u_separate(sgsn_originated_reset := true); |
| 218 | setverdict(pass); |
Alexander Couzens | c316572 | 2021-01-11 02:51:45 +0100 | [diff] [blame] | 219 | f_clean_ns_codec(); |
Harald Welte | 64d0731 | 2019-03-20 09:48:39 +0100 | [diff] [blame] | 220 | } |
| 221 | |
| 222 | /* Transmit BVC-RESET before NS-ALIVE of PCU was ACKed: expect no response */ |
| 223 | testcase TC_sns_1c1u_so_bvc_reset_too_early() runs on RAW_Test_CT { |
| 224 | /* Activate two NS codec ports */ |
Alexander Couzens | 2beaa20 | 2020-09-11 20:08:41 +0200 | [diff] [blame] | 225 | f_init_ns_codec(mp_nsconfig); |
| 226 | f_init_ns_codec(mp_nsconfig, 1); |
| 227 | f_init_ns_codec(mp_nsconfig, 2); |
Harald Welte | 64d0731 | 2019-03-20 09:48:39 +0100 | [diff] [blame] | 228 | f_init_pcuif(); |
| 229 | /* Perform Size + BSS-originated config */ |
| 230 | f_incoming_sns_size(); |
| 231 | f_incoming_sns_config(); |
| 232 | /* perform SGSN-originated config using idx==0 for signalling and idx==1 for user traffic */ |
| 233 | f_outgoing_sns_config_1c1u_separate(); |
| 234 | |
| 235 | /* DON'T ACK ANY INBOUND NS-ALIVE HERE! */ |
| 236 | |
| 237 | /* perform outgoing ALIVE procedure for both NS-VCs */ |
| 238 | f_outgoing_ns_alive(1); |
| 239 | f_outgoing_ns_alive(2); |
| 240 | /* ensure there's no response to NS-ALIVE sent on idx==0 */ |
| 241 | f_outgoing_ns_alive_no_ack(idx := 0); |
| 242 | |
| 243 | /* Transmit BVC-RESET and expect no ACK*/ |
Harald Welte | e97e3af | 2020-10-09 14:56:54 +0200 | [diff] [blame] | 244 | f_tx_bvc_reset_rx_ack(0, omit, omit, idx := 1, exp_ack := false); |
| 245 | f_tx_bvc_reset_rx_ack(mp_gb_cfg.bvc[0].bvci, omit, mp_gb_cfg.bvc[0].cell_id, idx := 1, exp_ack := false); |
Alexander Couzens | c316572 | 2021-01-11 02:51:45 +0100 | [diff] [blame] | 246 | f_clean_ns_codec(); |
Harald Welte | 64d0731 | 2019-03-20 09:48:39 +0100 | [diff] [blame] | 247 | } |
| 248 | |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 249 | /* Test adding new IP endpoints at runtime */ |
Harald Welte | ea3c7e9 | 2019-03-01 19:34:55 +0100 | [diff] [blame] | 250 | testcase TC_sns_add() runs on RAW_Test_CT { |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 251 | f_sns_bringup_1c1u(); |
| 252 | |
Alexander Couzens | 2373afc | 2020-12-09 02:19:49 +0100 | [diff] [blame] | 253 | /* create another NS codec port on the tester side */ |
Alexander Couzens | 2beaa20 | 2020-09-11 20:08:41 +0200 | [diff] [blame] | 254 | f_init_ns_codec(mp_nsconfig, 2); |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 255 | |
| 256 | f_outgoing_sns_add(idx_add := 2, w_sig := 0, w_user := 1, idx := 0); |
| 257 | |
| 258 | /* wait for one ALIVE cycle, then ACK any further ALIVE in the background */ |
| 259 | as_rx_alive_tx_ack(oneshot := true, idx := 2); |
| 260 | activate(as_rx_alive_tx_ack(idx := 2)); |
| 261 | |
| 262 | f_outgoing_ns_alive(2); |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 263 | setverdict(pass); |
Alexander Couzens | c316572 | 2021-01-11 02:51:45 +0100 | [diff] [blame] | 264 | f_clean_ns_codec(); |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 265 | } |
| 266 | |
Alexander Couzens | 2a0ac80 | 2020-12-09 02:19:29 +0100 | [diff] [blame] | 267 | /* Test adding an already present IP endpoint at runtime */ |
| 268 | testcase TC_sns_add_nack() runs on RAW_Test_CT { |
| 269 | f_sns_bringup_1c1u(); |
| 270 | |
| 271 | f_outgoing_sns_add(idx_add := 0, w_sig := 0, w_user := 1, idx := 0, cause := NS_CAUSE_PROTOCOL_ERROR_UNSPEIFIED); |
| 272 | setverdict(pass); |
Alexander Couzens | c316572 | 2021-01-11 02:51:45 +0100 | [diff] [blame] | 273 | f_clean_ns_codec(); |
Alexander Couzens | 2a0ac80 | 2020-12-09 02:19:29 +0100 | [diff] [blame] | 274 | } |
| 275 | |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 276 | /* Test deleting IP endpoints at runtime */ |
Harald Welte | ea3c7e9 | 2019-03-01 19:34:55 +0100 | [diff] [blame] | 277 | testcase TC_sns_del() runs on RAW_Test_CT { |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 278 | f_sns_bringup_1c1u(); |
| 279 | |
| 280 | f_outgoing_sns_del(idx_del := 1, w_sig := 0, w_user := 1, idx := 0); |
| 281 | /* FIXME: ensure we don't receive anything on just-deleted NS-VC anymore */ |
| 282 | setverdict(pass); |
Alexander Couzens | c316572 | 2021-01-11 02:51:45 +0100 | [diff] [blame] | 283 | f_clean_ns_codec(); |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 284 | } |
| 285 | |
Harald Welte | 7209955 | 2019-02-23 15:09:22 +0100 | [diff] [blame] | 286 | /* Test changing weights at runtime */ |
Harald Welte | ea3c7e9 | 2019-03-01 19:34:55 +0100 | [diff] [blame] | 287 | testcase TC_sns_chg_weight() runs on RAW_Test_CT { |
Harald Welte | 7209955 | 2019-02-23 15:09:22 +0100 | [diff] [blame] | 288 | f_sns_bringup_1c1u(); |
| 289 | |
| 290 | /* change w_user from 1 to 200 */ |
| 291 | f_outgoing_sns_chg_weight(idx_chg := 1, w_sig := 0, w_user := 200, idx := 0); |
| 292 | setverdict(pass); |
Alexander Couzens | c316572 | 2021-01-11 02:51:45 +0100 | [diff] [blame] | 293 | f_clean_ns_codec(); |
Harald Welte | 7209955 | 2019-02-23 15:09:22 +0100 | [diff] [blame] | 294 | } |
| 295 | |
Harald Welte | 16e92f4 | 2019-03-02 00:03:44 +0100 | [diff] [blame] | 296 | import from PCUIF_Types all; |
| 297 | import from PCUIF_CodecPort all; |
| 298 | |
Harald Welte | 3b33583 | 2019-03-15 22:38:06 +0100 | [diff] [blame] | 299 | altstep as_pcu_activate() runs on RAW_PCU_CT { |
| 300 | var PCUIF_send_data sd; |
| 301 | [] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_ACT_REQ(?, ?, ?))) -> value sd { repeat; } |
| 302 | |
| 303 | } |
| 304 | |
Harald Welte | 16e92f4 | 2019-03-02 00:03:44 +0100 | [diff] [blame] | 305 | testcase TC_pcuif_rach() runs on RAW_Test_CT { |
| 306 | f_sns_bringup_1c1u(); |
Harald Welte | 3b33583 | 2019-03-15 22:38:06 +0100 | [diff] [blame] | 307 | activate(as_pcu_activate()); |
Harald Welte | 16e92f4 | 2019-03-02 00:03:44 +0100 | [diff] [blame] | 308 | |
Vadim Yanitskiy | 36558d9 | 2019-11-17 02:23:51 +0700 | [diff] [blame] | 309 | f_pcuif_tx(ts_PCUIF_RACH_IND(bts_nr:=0, trx_nr:=0, ts_nr:=0, ra:=23, |
| 310 | is_11bit:=0, burst_type:=BURST_TYPE_0, |
Harald Welte | 16e92f4 | 2019-03-02 00:03:44 +0100 | [diff] [blame] | 311 | fn:=42, arfcn:=871, qta:=0)); |
| 312 | PCU.receive(t_SD_PCUIF(g_pcu_conn_id, |
| 313 | tr_PCUIF_DATA_REQ(bts_nr:=0, trx_nr:=0, ts_nr:=0, block_nr:=?, fn:=?, |
| 314 | sapi:=PCU_IF_SAPI_AGCH, data:=?))); |
| 315 | setverdict(pass); |
Alexander Couzens | c316572 | 2021-01-11 02:51:45 +0100 | [diff] [blame] | 316 | f_clean_ns_codec(); |
Harald Welte | 16e92f4 | 2019-03-02 00:03:44 +0100 | [diff] [blame] | 317 | } |
| 318 | |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 319 | |
| 320 | |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 321 | control { |
| 322 | execute( TC_sns_po_size_success() ); |
| 323 | execute( TC_sns_po_size_nack() ); |
| 324 | execute( TC_sns_po_config_success() ); |
| 325 | execute( TC_sns_po_config_nack() ); |
| 326 | execute( TC_sns_so_config_success() ); |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 327 | execute( TC_sns_1c1u() ); |
Harald Welte | ecd159e | 2019-03-16 13:36:07 +0100 | [diff] [blame] | 328 | execute( TC_sns_1c1u_separate() ); |
Harald Welte | 64d0731 | 2019-03-20 09:48:39 +0100 | [diff] [blame] | 329 | execute( TC_sns_1c1u_so_bvc_reset() ); |
| 330 | execute( TC_sns_1c1u_so_bvc_reset_too_early() ); |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 331 | execute( TC_sns_add() ); |
Alexander Couzens | 2a0ac80 | 2020-12-09 02:19:29 +0100 | [diff] [blame] | 332 | execute( TC_sns_add_nack() ); |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 333 | execute( TC_sns_del() ); |
Harald Welte | 7209955 | 2019-02-23 15:09:22 +0100 | [diff] [blame] | 334 | execute( TC_sns_chg_weight() ); |
Harald Welte | 16e92f4 | 2019-03-02 00:03:44 +0100 | [diff] [blame] | 335 | |
| 336 | execute( TC_pcuif_rach() ); |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 337 | } |
| 338 | |
| 339 | } |