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_CodecPort all; |
| 19 | import from NS_Types all; |
Alexander Couzens | 3c268da | 2020-09-07 04:25:05 +0200 | [diff] [blame] | 20 | import from RAW_NS all; |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 21 | |
| 22 | /********************************************************************************** |
| 23 | * Modern Gb/IP bring-up test cases using IP Sub-Network Service (SNS) |
| 24 | **********************************************************************************/ |
| 25 | |
Harald Welte | c4d7beb | 2019-02-21 18:21:01 +0100 | [diff] [blame] | 26 | /* perform inbound SNS-SIZE procedure */ |
Harald Welte | bf76824 | 2019-02-21 22:19:21 +0100 | [diff] [blame] | 27 | function f_incoming_sns_size(template (omit) NsCause cause := omit, integer idx := 0) |
| 28 | runs on RAW_NS_CT { |
Harald Welte | b63c3a1 | 2019-02-22 23:27:12 +0100 | [diff] [blame] | 29 | log("f_incoming_sns_size(idx=", idx, ")"); |
Harald Welte | c4d7beb | 2019-02-21 18:21:01 +0100 | [diff] [blame] | 30 | var PDU_NS rx; |
Harald Welte | 90f1974 | 2020-11-06 19:34:40 +0100 | [diff] [blame] | 31 | var NSVCConfiguration nsvc_cfg := g_nsconfig[idx].nsvc[0]; |
Alexander Couzens | 7b1e44f | 2020-08-25 23:33:17 +0200 | [diff] [blame] | 32 | |
Harald Welte | 90f1974 | 2020-11-06 19:34:40 +0100 | [diff] [blame] | 33 | if (nsvc_cfg.provider.ip.address_family == AF_INET) { |
Alexander Couzens | 7b1e44f | 2020-08-25 23:33:17 +0200 | [diff] [blame] | 34 | /* expect one single SNS-SIZE with RESET flag; 4x v4 EP; no v6 EP */ |
| 35 | rx := f_ns_exp(tr_SNS_SIZE(g_nsconfig[idx].nsei, rst_flag := true, max_nsvcs := 8, |
| 36 | num_v4 := 4, num_v6 := omit), idx); |
| 37 | } else { |
| 38 | /* expect one single SNS-SIZE with RESET flag; no v4 EP; 4x v6 EP */ |
| 39 | rx := f_ns_exp(tr_SNS_SIZE(g_nsconfig[idx].nsei, rst_flag := true, max_nsvcs := 8, |
| 40 | num_v4 := omit, num_v6 := 4), idx); |
| 41 | } |
Harald Welte | bf76824 | 2019-02-21 22:19:21 +0100 | [diff] [blame] | 42 | 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] | 43 | } |
| 44 | |
| 45 | /* perform outbound SNS-SIZE procedure */ |
Harald Welte | bf76824 | 2019-02-21 22:19:21 +0100 | [diff] [blame] | 46 | function f_outgoing_sns_size(template (omit) NsCause cause := omit, integer idx:= 0) |
| 47 | runs on RAW_NS_CT { |
Harald Welte | b63c3a1 | 2019-02-22 23:27:12 +0100 | [diff] [blame] | 48 | log("f_outgoing_sns_size(idx=", idx, ")"); |
Harald Welte | c4d7beb | 2019-02-21 18:21:01 +0100 | [diff] [blame] | 49 | var PDU_NS rx; |
Harald Welte | 90f1974 | 2020-11-06 19:34:40 +0100 | [diff] [blame] | 50 | var NSVCConfiguration nsvc_cfg := g_nsconfig[idx].nsvc[0]; |
| 51 | |
| 52 | if (nsvc_cfg.provider.ip.address_family == AF_INET) { |
Alexander Couzens | 7b1e44f | 2020-08-25 23:33:17 +0200 | [diff] [blame] | 53 | NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_SIZE(g_nsconfig[idx].nsei, rst_flag := true, max_nsvcs := 1, |
| 54 | num_v4 := 1, num_v6 := omit) |
| 55 | )); |
| 56 | } else { |
| 57 | NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_SIZE(g_nsconfig[idx].nsei, rst_flag := true, max_nsvcs := 1, |
| 58 | num_v4 := omit, num_v6 := 1) |
| 59 | )); |
| 60 | } |
| 61 | /* expect one single SNS-SIZE with RESET flag; 4x v4 EP; no v6 EP */ |
Harald Welte | bf76824 | 2019-02-21 22:19:21 +0100 | [diff] [blame] | 62 | 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] | 63 | } |
| 64 | |
| 65 | /* perform inbound SNS-CONFIG procedure */ |
Harald Welte | bf76824 | 2019-02-21 22:19:21 +0100 | [diff] [blame] | 66 | function f_incoming_sns_config(template (omit) NsCause cause := omit, integer idx := 0) |
| 67 | runs on RAW_NS_CT { |
Harald Welte | b63c3a1 | 2019-02-22 23:27:12 +0100 | [diff] [blame] | 68 | log("f_incoming_sns_config(idx=", idx, ")"); |
Harald Welte | c4d7beb | 2019-02-21 18:21:01 +0100 | [diff] [blame] | 69 | var PDU_NS rx; |
Harald Welte | 90f1974 | 2020-11-06 19:34:40 +0100 | [diff] [blame] | 70 | var NSVCConfiguration nsvc_cfg := g_nsconfig[idx].nsvc[0]; |
Alexander Couzens | 7b1e44f | 2020-08-25 23:33:17 +0200 | [diff] [blame] | 71 | |
Harald Welte | 90f1974 | 2020-11-06 19:34:40 +0100 | [diff] [blame] | 72 | if (nsvc_cfg.provider.ip.address_family == AF_INET) { |
| 73 | var template IP4_Elements v4_elem := { tr_SNS_IPv4(nsvc_cfg.provider.ip.remote_ip, |
| 74 | nsvc_cfg.provider.ip.remote_udp_port) }; |
Alexander Couzens | 7b1e44f | 2020-08-25 23:33:17 +0200 | [diff] [blame] | 75 | rx := f_ns_exp(tr_SNS_CONFIG(g_nsconfig[idx].nsei, end_flag := true, v4 := v4_elem), idx); |
| 76 | } else { |
Harald Welte | 90f1974 | 2020-11-06 19:34:40 +0100 | [diff] [blame] | 77 | var template IP6_Elements v6_elem := { tr_SNS_IPv6(nsvc_cfg.provider.ip.remote_ip, |
| 78 | nsvc_cfg.provider.ip.remote_udp_port) }; |
Alexander Couzens | 7b1e44f | 2020-08-25 23:33:17 +0200 | [diff] [blame] | 79 | rx := f_ns_exp(tr_SNS_CONFIG(g_nsconfig[idx].nsei, end_flag := true, v6 := v6_elem), idx); |
| 80 | } |
Harald Welte | bf76824 | 2019-02-21 22:19:21 +0100 | [diff] [blame] | 81 | 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] | 82 | } |
| 83 | |
| 84 | /* perform outbound SNS-CONFIG procedure */ |
Harald Welte | bf76824 | 2019-02-21 22:19:21 +0100 | [diff] [blame] | 85 | function f_outgoing_sns_config(template (omit) NsCause cause := omit, integer idx := 0) |
| 86 | runs on RAW_NS_CT { |
Harald Welte | b63c3a1 | 2019-02-22 23:27:12 +0100 | [diff] [blame] | 87 | log("f_outgoing_sns_config(idx=", idx, ")"); |
Harald Welte | c4d7beb | 2019-02-21 18:21:01 +0100 | [diff] [blame] | 88 | var PDU_NS rx; |
Harald Welte | 90f1974 | 2020-11-06 19:34:40 +0100 | [diff] [blame] | 89 | var NSVCConfiguration nsvc_cfg := g_nsconfig[idx].nsvc[0]; |
| 90 | |
| 91 | if (nsvc_cfg.provider.ip.address_family == AF_INET) { |
| 92 | var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(nsvc_cfg.provider.ip.local_ip, |
| 93 | nsvc_cfg.provider.ip.local_udp_port) } |
Alexander Couzens | 7b1e44f | 2020-08-25 23:33:17 +0200 | [diff] [blame] | 94 | NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CONFIG(g_nsconfig[idx].nsei, true, v4))); |
| 95 | } else { |
Harald Welte | 90f1974 | 2020-11-06 19:34:40 +0100 | [diff] [blame] | 96 | var template (omit) IP6_Elements v6 := { ts_SNS_IPv6(nsvc_cfg.provider.ip.local_ip, |
| 97 | nsvc_cfg.provider.ip.local_udp_port) } |
Alexander Couzens | 7b1e44f | 2020-08-25 23:33:17 +0200 | [diff] [blame] | 98 | NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CONFIG(g_nsconfig[idx].nsei, true, omit, v6))); |
| 99 | } |
Harald Welte | bf76824 | 2019-02-21 22:19:21 +0100 | [diff] [blame] | 100 | 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] | 101 | } |
| 102 | |
Harald Welte | bf76824 | 2019-02-21 22:19:21 +0100 | [diff] [blame] | 103 | /* perform outbound SNS-CONFIG procedure (separate endpoints: 1 for control, 1 for user */ |
| 104 | function f_outgoing_sns_config_1c1u(template (omit) NsCause cause := omit, integer idx := 0) |
| 105 | runs on RAW_NS_CT { |
Harald Welte | b63c3a1 | 2019-02-22 23:27:12 +0100 | [diff] [blame] | 106 | log("f_outgoing_sns_config_1c1u(idx=", idx, ")"); |
Harald Welte | bf76824 | 2019-02-21 22:19:21 +0100 | [diff] [blame] | 107 | var PDU_NS rx; |
Harald Welte | 90f1974 | 2020-11-06 19:34:40 +0100 | [diff] [blame] | 108 | |
| 109 | if (mp_nsconfig.nsvc[0].provider.ip.address_family == AF_INET) { |
| 110 | var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(g_nsconfig[0].nsvc[0].provider.ip.local_ip, |
| 111 | g_nsconfig[0].nsvc[0].provider.ip.local_udp_port, 1, 0), |
| 112 | ts_SNS_IPv4(g_nsconfig[1].nsvc[0].provider.ip.local_ip, |
| 113 | g_nsconfig[1].nsvc[0].provider.ip.local_udp_port, 0, 1) }; |
Alexander Couzens | 7b1e44f | 2020-08-25 23:33:17 +0200 | [diff] [blame] | 114 | NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CONFIG(g_nsconfig[idx].nsei, true, v4))); |
| 115 | } else { |
Harald Welte | 90f1974 | 2020-11-06 19:34:40 +0100 | [diff] [blame] | 116 | var template (omit) IP6_Elements v6 := { ts_SNS_IPv6(g_nsconfig[0].nsvc[0].provider.ip.local_ip, |
| 117 | g_nsconfig[0].nsvc[0].provider.ip.local_udp_port, 1, 0), |
| 118 | ts_SNS_IPv6(g_nsconfig[1].nsvc[0].provider.ip.local_ip, |
| 119 | g_nsconfig[1].nsvc[0].provider.ip.local_udp_port, 0, 1) }; |
Alexander Couzens | 7b1e44f | 2020-08-25 23:33:17 +0200 | [diff] [blame] | 120 | NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CONFIG(g_nsconfig[idx].nsei, true, omit, v6))); |
| 121 | } |
Harald Welte | bf76824 | 2019-02-21 22:19:21 +0100 | [diff] [blame] | 122 | rx := f_ns_exp(tr_SNS_CONFIG_ACK(g_nsconfig[idx].nsei, cause), idx); |
| 123 | } |
| 124 | |
Harald Welte | ecd159e | 2019-03-16 13:36:07 +0100 | [diff] [blame] | 125 | /* perform outbound SNS-CONFIG procedure (separate endpoints: 1 for control, 1 for user */ |
| 126 | function f_outgoing_sns_config_1c1u_separate(template (omit) NsCause cause := omit, integer idx := 0) |
| 127 | runs on RAW_NS_CT { |
| 128 | log("f_outgoing_sns_config_1c1u_separate(idx=", idx, ")"); |
| 129 | var PDU_NS rx; |
Harald Welte | 90f1974 | 2020-11-06 19:34:40 +0100 | [diff] [blame] | 130 | if (mp_nsconfig.nsvc[0].provider.ip.address_family == AF_INET) { |
| 131 | var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(g_nsconfig[1].nsvc[0].provider.ip.local_ip, |
| 132 | g_nsconfig[1].nsvc[0].provider.ip.local_udp_port, 1, 0), |
| 133 | ts_SNS_IPv4(g_nsconfig[2].nsvc[0].provider.ip.local_ip, |
| 134 | g_nsconfig[2].nsvc[0].provider.ip.local_udp_port, 0, 1) }; |
Alexander Couzens | 7b1e44f | 2020-08-25 23:33:17 +0200 | [diff] [blame] | 135 | NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CONFIG(g_nsconfig[idx].nsei, true, v4))); |
| 136 | } else { |
Harald Welte | 90f1974 | 2020-11-06 19:34:40 +0100 | [diff] [blame] | 137 | var template (omit) IP6_Elements v6 := { ts_SNS_IPv6(g_nsconfig[1].nsvc[0].provider.ip.local_ip, |
| 138 | g_nsconfig[1].nsvc[0].provider.ip.local_udp_port, 1, 0), |
| 139 | ts_SNS_IPv6(g_nsconfig[2].nsvc[0].provider.ip.local_ip, |
| 140 | g_nsconfig[2].nsvc[0].provider.ip.local_udp_port, 0, 1) }; |
Alexander Couzens | 7b1e44f | 2020-08-25 23:33:17 +0200 | [diff] [blame] | 141 | NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CONFIG(g_nsconfig[idx].nsei, true, omit, v6))); |
| 142 | } |
Harald Welte | ecd159e | 2019-03-16 13:36:07 +0100 | [diff] [blame] | 143 | rx := f_ns_exp(tr_SNS_CONFIG_ACK(g_nsconfig[idx].nsei, cause), idx); |
| 144 | } |
| 145 | |
Alexander Couzens | 2a0ac80 | 2020-12-09 02:19:29 +0100 | [diff] [blame] | 146 | function f_outgoing_sns_add(integer idx_add, uint8_t w_sig := 1, uint8_t w_user := 1, integer idx := 0, template (omit) NsCause cause := omit) |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 147 | runs on RAW_NS_CT { |
| 148 | log("f_outgoing_sns_add(idx_add=", idx_add, ")"); |
| 149 | var PDU_NS rx; |
Alexander Couzens | a8fb621 | 2020-12-09 02:05:02 +0100 | [diff] [blame] | 150 | var NSVCConfiguration nsvc_cfg := g_nsconfig[idx_add].nsvc[0]; |
Harald Welte | 90f1974 | 2020-11-06 19:34:40 +0100 | [diff] [blame] | 151 | if (nsvc_cfg.provider.ip.address_family == AF_INET) { |
| 152 | var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(nsvc_cfg.provider.ip.local_ip, |
| 153 | nsvc_cfg.provider.ip.local_udp_port, |
Alexander Couzens | 7b1e44f | 2020-08-25 23:33:17 +0200 | [diff] [blame] | 154 | w_sig, w_user) }; |
| 155 | NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_ADD(g_nsconfig[idx].nsei, 23, v4))); |
Alexander Couzens | 2a0ac80 | 2020-12-09 02:19:29 +0100 | [diff] [blame] | 156 | rx := f_ns_exp(tr_SNS_ACK(g_nsconfig[idx].nsei, 23, cause, v4)); |
Alexander Couzens | 7b1e44f | 2020-08-25 23:33:17 +0200 | [diff] [blame] | 157 | } else { |
Harald Welte | 90f1974 | 2020-11-06 19:34:40 +0100 | [diff] [blame] | 158 | var template (omit) IP6_Elements v6 := { ts_SNS_IPv6(nsvc_cfg.provider.ip.local_ip, |
| 159 | nsvc_cfg.provider.ip.local_udp_port, |
Alexander Couzens | 7b1e44f | 2020-08-25 23:33:17 +0200 | [diff] [blame] | 160 | w_sig, w_user) }; |
| 161 | NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_ADD(g_nsconfig[idx].nsei, 23, omit, v6))); |
Alexander Couzens | 2a0ac80 | 2020-12-09 02:19:29 +0100 | [diff] [blame] | 162 | rx := f_ns_exp(tr_SNS_ACK(g_nsconfig[idx].nsei, 23, cause, omit, v6)); |
Alexander Couzens | 7b1e44f | 2020-08-25 23:33:17 +0200 | [diff] [blame] | 163 | } |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 164 | } |
| 165 | |
| 166 | function f_outgoing_sns_del(integer idx_del, uint8_t w_sig := 1, uint8_t w_user := 1, integer idx := 0) |
| 167 | runs on RAW_NS_CT { |
| 168 | log("f_outgoing_sns_del(idx_del=", idx_del, ")"); |
| 169 | var PDU_NS rx; |
Harald Welte | 90f1974 | 2020-11-06 19:34:40 +0100 | [diff] [blame] | 170 | var NSVCConfiguration nsvc_cfg := g_nsconfig[idx_del].nsvc[0]; |
| 171 | if (nsvc_cfg.provider.ip.address_family == AF_INET) { |
| 172 | var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(nsvc_cfg.provider.ip.local_ip, |
| 173 | nsvc_cfg.provider.ip.local_udp_port, |
Alexander Couzens | 7b1e44f | 2020-08-25 23:33:17 +0200 | [diff] [blame] | 174 | w_sig, w_user) }; |
| 175 | NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_DEL(g_nsconfig[idx].nsei, 24, omit, v4))); |
| 176 | rx := f_ns_exp(tr_SNS_ACK(g_nsconfig[idx].nsei, 24, omit, v4)); |
| 177 | } else { |
Harald Welte | 90f1974 | 2020-11-06 19:34:40 +0100 | [diff] [blame] | 178 | var template (omit) IP6_Elements v6 := { ts_SNS_IPv6(nsvc_cfg.provider.ip.local_ip, |
| 179 | nsvc_cfg.provider.ip.local_udp_port, |
Alexander Couzens | 7b1e44f | 2020-08-25 23:33:17 +0200 | [diff] [blame] | 180 | w_sig, w_user) }; |
| 181 | NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_DEL(g_nsconfig[idx].nsei, 24, omit, omit, v6))); |
| 182 | rx := f_ns_exp(tr_SNS_ACK(g_nsconfig[idx].nsei, 24, omit, omit, v6)); |
| 183 | } |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 184 | } |
| 185 | |
Harald Welte | 7209955 | 2019-02-23 15:09:22 +0100 | [diff] [blame] | 186 | function f_outgoing_sns_chg_weight(integer idx_chg, uint8_t w_sig, uint8_t w_user, integer idx := 0) |
| 187 | runs on RAW_NS_CT { |
| 188 | log("f_outgoing_sns_chg_weight(idx_chg=", idx_chg, ")"); |
| 189 | var PDU_NS rx; |
Harald Welte | 90f1974 | 2020-11-06 19:34:40 +0100 | [diff] [blame] | 190 | var NSVCConfiguration nsvc_cfg := g_nsconfig[idx_chg].nsvc[0]; |
| 191 | if (nsvc_cfg.provider.ip.address_family == AF_INET) { |
| 192 | var template (omit) IP4_Elements v4 := { ts_SNS_IPv4(nsvc_cfg.provider.ip.local_ip, |
| 193 | nsvc_cfg.provider.ip.local_udp_port, |
Alexander Couzens | 7b1e44f | 2020-08-25 23:33:17 +0200 | [diff] [blame] | 194 | w_sig, w_user) }; |
| 195 | NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CHG_WEIGHT(g_nsconfig[idx].nsei, 25, v4))); |
| 196 | rx := f_ns_exp(tr_SNS_ACK(g_nsconfig[idx].nsei, 25, omit, v4)); |
| 197 | } else { |
Harald Welte | 90f1974 | 2020-11-06 19:34:40 +0100 | [diff] [blame] | 198 | var template (omit) IP6_Elements v6 := { ts_SNS_IPv6(nsvc_cfg.provider.ip.local_ip, |
| 199 | nsvc_cfg.provider.ip.local_udp_port, |
Alexander Couzens | 7b1e44f | 2020-08-25 23:33:17 +0200 | [diff] [blame] | 200 | w_sig, w_user) }; |
| 201 | NSCP[idx].send(t_NS_Send(g_ns_conn_id[idx], ts_SNS_CHG_WEIGHT(g_nsconfig[idx].nsei, 25, omit, v6))); |
| 202 | rx := f_ns_exp(tr_SNS_ACK(g_nsconfig[idx].nsei, 25, omit, omit, v6)); |
| 203 | } |
Harald Welte | 7209955 | 2019-02-23 15:09:22 +0100 | [diff] [blame] | 204 | } |
| 205 | |
| 206 | |
| 207 | |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 208 | |
Harald Welte | bf76824 | 2019-02-21 22:19:21 +0100 | [diff] [blame] | 209 | |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 210 | /* PCU-originated SNS-SIZE: successful case */ |
Harald Welte | ea3c7e9 | 2019-03-01 19:34:55 +0100 | [diff] [blame] | 211 | testcase TC_sns_po_size_success() runs on RAW_Test_CT { |
Alexander Couzens | 2beaa20 | 2020-09-11 20:08:41 +0200 | [diff] [blame] | 212 | f_init_ns_codec(mp_nsconfig); |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 213 | f_init_pcuif(); |
| 214 | f_incoming_sns_size(); |
| 215 | f_sleep(1.0); |
| 216 | setverdict(pass); |
| 217 | } |
| 218 | |
| 219 | /* PCU-originated SNS-SIZE: NACK from our side */ |
Harald Welte | ea3c7e9 | 2019-03-01 19:34:55 +0100 | [diff] [blame] | 220 | testcase TC_sns_po_size_nack() runs on RAW_Test_CT { |
Alexander Couzens | 2beaa20 | 2020-09-11 20:08:41 +0200 | [diff] [blame] | 221 | f_init_ns_codec(mp_nsconfig); |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 222 | f_init_pcuif(); |
| 223 | f_incoming_sns_size(NS_CAUSE_PROTOCOL_ERROR_UNSPEIFIED); |
| 224 | /* FIXME: ensure we don't get a SNS-CONFIG */ |
| 225 | /* FIXME: ensure we get re-transmitted SNS-SIZE attempts */ |
| 226 | f_sleep(10.0); |
| 227 | setverdict(pass); |
| 228 | } |
| 229 | |
| 230 | /* PCU-originated SNS-CONFIG: successful case */ |
Harald Welte | ea3c7e9 | 2019-03-01 19:34:55 +0100 | [diff] [blame] | 231 | testcase TC_sns_po_config_success() runs on RAW_Test_CT { |
Alexander Couzens | 2beaa20 | 2020-09-11 20:08:41 +0200 | [diff] [blame] | 232 | f_init_ns_codec(mp_nsconfig); |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 233 | f_init_pcuif(); |
| 234 | f_incoming_sns_size(); |
| 235 | f_incoming_sns_config(); |
| 236 | f_sleep(1.0); |
| 237 | setverdict(pass); |
| 238 | } |
| 239 | |
| 240 | /* PCU-originated SNS-CONFIG: successful case */ |
Harald Welte | ea3c7e9 | 2019-03-01 19:34:55 +0100 | [diff] [blame] | 241 | testcase TC_sns_po_config_nack() runs on RAW_Test_CT { |
Alexander Couzens | 2beaa20 | 2020-09-11 20:08:41 +0200 | [diff] [blame] | 242 | f_init_ns_codec(mp_nsconfig); |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 243 | f_init_pcuif(); |
| 244 | f_incoming_sns_size(); |
| 245 | f_incoming_sns_config(NS_CAUSE_PROTOCOL_ERROR_UNSPEIFIED); |
| 246 | /* FIXME: ensure we get re-transmitted SNS-CONFIG attempts */ |
| 247 | f_sleep(10.0); |
| 248 | setverdict(pass); |
| 249 | } |
| 250 | |
| 251 | |
| 252 | /* SGSN-originated SNS-SIZE: successful case */ |
Harald Welte | ea3c7e9 | 2019-03-01 19:34:55 +0100 | [diff] [blame] | 253 | testcase TC_sns_so_config_success() runs on RAW_Test_CT { |
Alexander Couzens | 2beaa20 | 2020-09-11 20:08:41 +0200 | [diff] [blame] | 254 | f_init_ns_codec(mp_nsconfig); |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 255 | f_init_pcuif(); |
| 256 | f_incoming_sns_size(); |
| 257 | f_incoming_sns_config(); |
| 258 | f_outgoing_sns_config(); |
| 259 | |
| 260 | /* wait for one ALIVE cycle, then ACK any further ALIVE in the background */ |
| 261 | as_rx_alive_tx_ack(oneshot := true); |
| 262 | activate(as_rx_alive_tx_ack()); |
| 263 | |
| 264 | f_outgoing_ns_alive(); |
| 265 | |
| 266 | /* Expect BVC-RESET for signaling (0) and ptp BVCI */ |
Harald Welte | e97e3af | 2020-10-09 14:56:54 +0200 | [diff] [blame] | 267 | as_rx_bvc_reset_tx_ack(0, omit, omit, oneshot := true); |
| 268 | 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] | 269 | 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] | 270 | |
| 271 | /* 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] | 272 | as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvc[0].bvci, oneshot := true); |
| 273 | 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] | 274 | setverdict(pass); |
| 275 | } |
| 276 | |
Harald Welte | 64d0731 | 2019-03-20 09:48:39 +0100 | [diff] [blame] | 277 | 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] | 278 | /* Activate two NS codec ports */ |
Alexander Couzens | 2beaa20 | 2020-09-11 20:08:41 +0200 | [diff] [blame] | 279 | f_init_ns_codec(mp_nsconfig); |
| 280 | f_init_ns_codec(mp_nsconfig, 1); |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 281 | f_init_pcuif(); |
| 282 | /* Perform Size + BSS-originated config */ |
| 283 | f_incoming_sns_size(); |
| 284 | f_incoming_sns_config(); |
| 285 | /* perform SGSN-originated config using idx==0 for signalling and idx==1 for user traffic */ |
| 286 | f_outgoing_sns_config_1c1u(); |
| 287 | |
| 288 | /* wait for one ALIVE cycle, then ACK any further ALIVE in the background |
| 289 | * for both NS-VCs */ |
| 290 | as_rx_alive_tx_ack(oneshot := true, idx := 0); |
| 291 | activate(as_rx_alive_tx_ack(idx := 0)); |
| 292 | as_rx_alive_tx_ack(oneshot := true, idx := 1); |
| 293 | activate(as_rx_alive_tx_ack(idx := 1)); |
| 294 | |
| 295 | /* perform outgoing ALIVE procedure for both NS-VCs */ |
| 296 | f_outgoing_ns_alive(0); |
| 297 | f_outgoing_ns_alive(1); |
| 298 | |
Harald Welte | 64d0731 | 2019-03-20 09:48:39 +0100 | [diff] [blame] | 299 | if (sgsn_originated_reset) { |
Alexander Couzens | 195c9e7 | 2020-10-26 23:09:16 +0100 | [diff] [blame] | 300 | /* Expect BVC-RESET, but ignore it to prevent a race condition of BVC RESETs */ |
| 301 | var template PDU_NS pdu := tr_NS_UNITDATA(t_SduCtrlB, 0, decmatch tr_BVC_RESET(?, 0, omit)); |
| 302 | f_ns_exp(pdu); |
| 303 | /* SGSN originated BVC-RESET on an uninitialized signalling BVC */ |
Harald Welte | e97e3af | 2020-10-09 14:56:54 +0200 | [diff] [blame] | 304 | f_tx_bvc_reset_rx_ack(0, omit, omit); |
Alexander Couzens | 195c9e7 | 2020-10-26 23:09:16 +0100 | [diff] [blame] | 305 | |
| 306 | /* Expect BVC-RESET PTP BVC, but ignore it to prevent a race condition of BVC RESETs */ |
| 307 | pdu := tr_NS_UNITDATA(t_SduCtrlB, 0, decmatch tr_BVC_RESET(?, mp_gb_cfg.bvc[0].bvci, mp_gb_cfg.bvc[0].cell_id)); |
| 308 | f_ns_exp(pdu); |
| 309 | /* SGSN originated BVC-RESET on an uninitialized PTP BVC */ |
Harald Welte | e97e3af | 2020-10-09 14:56:54 +0200 | [diff] [blame] | 310 | 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] | 311 | } else { |
Alexander Couzens | 195c9e7 | 2020-10-26 23:09:16 +0100 | [diff] [blame] | 312 | /* Expect BVC-RESET for signaling BVCI=0 */ |
Harald Welte | e97e3af | 2020-10-09 14:56:54 +0200 | [diff] [blame] | 313 | as_rx_bvc_reset_tx_ack(0, omit, omit, oneshot := true); |
Alexander Couzens | 195c9e7 | 2020-10-26 23:09:16 +0100 | [diff] [blame] | 314 | /* Expect BVC-RESET from the PCU on PTP BVC */ |
Harald Welte | e97e3af | 2020-10-09 14:56:54 +0200 | [diff] [blame] | 315 | 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] | 316 | } |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 317 | /* Expect UNBLOCK for ptp BVCI on signaling NS-VC (idx==0) */ |
Harald Welte | 5339b2e | 2020-10-04 22:52:56 +0200 | [diff] [blame] | 318 | 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] | 319 | |
| 320 | /* wait for one FLOW-CONTROL BVC and then ACK any further in the future. Flow |
| 321 | * 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] | 322 | as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvc[0].bvci, oneshot := true, idx := 1); |
| 323 | 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] | 324 | } |
| 325 | |
| 326 | /* 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] | 327 | testcase TC_sns_1c1u() runs on RAW_Test_CT { |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 328 | f_sns_bringup_1c1u(); |
| 329 | setverdict(pass); |
| 330 | } |
| 331 | |
Harald Welte | 64d0731 | 2019-03-20 09:48:39 +0100 | [diff] [blame] | 332 | 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] | 333 | /* Activate two NS codec ports */ |
Alexander Couzens | 2beaa20 | 2020-09-11 20:08:41 +0200 | [diff] [blame] | 334 | f_init_ns_codec(mp_nsconfig); |
| 335 | f_init_ns_codec(mp_nsconfig, 1); |
| 336 | f_init_ns_codec(mp_nsconfig, 2); |
Harald Welte | ecd159e | 2019-03-16 13:36:07 +0100 | [diff] [blame] | 337 | f_init_pcuif(); |
| 338 | /* Perform Size + BSS-originated config */ |
| 339 | f_incoming_sns_size(); |
| 340 | f_incoming_sns_config(); |
| 341 | /* perform SGSN-originated config using idx==0 for signalling and idx==1 for user traffic */ |
| 342 | f_outgoing_sns_config_1c1u_separate(); |
| 343 | |
| 344 | /* wait for one ALIVE cycle, then ACK any further ALIVE in the background |
| 345 | * for both NS-VCs */ |
| 346 | as_rx_alive_tx_ack(oneshot := true, idx := 1); |
| 347 | activate(as_rx_alive_tx_ack(idx := 1)); |
| 348 | as_rx_alive_tx_ack(oneshot := true, idx := 2); |
| 349 | activate(as_rx_alive_tx_ack(idx := 2)); |
| 350 | /* ensure there's no NS-ALIVE received on idx==0 */ |
| 351 | f_ensure_no_ns(t_NS_ALIVE, idx := 0); |
| 352 | |
| 353 | /* perform outgoing ALIVE procedure for both NS-VCs */ |
| 354 | f_outgoing_ns_alive(1); |
| 355 | f_outgoing_ns_alive(2); |
| 356 | /* ensure there's no response to NS-ALIVE sent on idx==0 */ |
| 357 | f_outgoing_ns_alive_no_ack(idx := 0); |
| 358 | |
Harald Welte | 64d0731 | 2019-03-20 09:48:39 +0100 | [diff] [blame] | 359 | if (sgsn_originated_reset) { |
Alexander Couzens | 195c9e7 | 2020-10-26 23:09:16 +0100 | [diff] [blame] | 360 | /* Expect BVC-RESET, but ignore it to prevent a race condition of BVC RESETs */ |
| 361 | var template PDU_NS pdu := tr_NS_UNITDATA(t_SduCtrlB, 0, decmatch tr_BVC_RESET(?, 0, omit)); |
| 362 | f_ns_exp(pdu, idx := 1); |
| 363 | /* SGSN originated BVC-RESET on an uninitialized sign BVC */ |
Harald Welte | e97e3af | 2020-10-09 14:56:54 +0200 | [diff] [blame] | 364 | f_tx_bvc_reset_rx_ack(0, omit, omit, idx := 1); |
Alexander Couzens | 195c9e7 | 2020-10-26 23:09:16 +0100 | [diff] [blame] | 365 | |
| 366 | /* Expect BVC-RESET PTP BVC, but ignore it to prevent a race condition of BVC RESETs */ |
| 367 | pdu := tr_NS_UNITDATA(t_SduCtrlB, 0, decmatch tr_BVC_RESET(?, mp_gb_cfg.bvc[0].bvci, mp_gb_cfg.bvc[0].cell_id)); |
| 368 | f_ns_exp(pdu, idx := 1); |
Harald Welte | e97e3af | 2020-10-09 14:56:54 +0200 | [diff] [blame] | 369 | 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] | 370 | } else { |
Alexander Couzens | 195c9e7 | 2020-10-26 23:09:16 +0100 | [diff] [blame] | 371 | /* Expect BVC-RESET for signaling BVCI=0 */ |
Harald Welte | e97e3af | 2020-10-09 14:56:54 +0200 | [diff] [blame] | 372 | 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] | 373 | /* Expect BVC-RESET from the PCU on PTP BVC */ |
Harald Welte | e97e3af | 2020-10-09 14:56:54 +0200 | [diff] [blame] | 374 | 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] | 375 | } |
Harald Welte | ecd159e | 2019-03-16 13:36:07 +0100 | [diff] [blame] | 376 | /* Expect UNBLOCK for ptp BVCI on signaling NS-VC (idx==1) */ |
Harald Welte | 5339b2e | 2020-10-04 22:52:56 +0200 | [diff] [blame] | 377 | 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] | 378 | |
| 379 | /* wait for one FLOW-CONTROL BVC and then ACK any further in the future. Flow |
| 380 | * 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] | 381 | as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvc[0].bvci, oneshot := true, idx := 2); |
| 382 | 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] | 383 | } |
| 384 | |
| 385 | /* Test full IP-SNS bring-up with two NS-VCs, one sig-only and one user-only - and where |
| 386 | * the initial IP/port for the SNS procedure is *not* part of the NS-VCs later */ |
| 387 | testcase TC_sns_1c1u_separate() runs on RAW_Test_CT { |
| 388 | f_sns_bringup_1c1u_separate(); |
| 389 | setverdict(pass); |
| 390 | } |
| 391 | |
Harald Welte | 64d0731 | 2019-03-20 09:48:39 +0100 | [diff] [blame] | 392 | /* Test full IP-SNS bring-up with two NS-VCs, one sig-only and one user-only and use |
| 393 | * SGSN-originated BVC-RESET rather than BSS-originated */ |
| 394 | testcase TC_sns_1c1u_so_bvc_reset() runs on RAW_Test_CT { |
| 395 | f_sns_bringup_1c1u_separate(sgsn_originated_reset := true); |
| 396 | setverdict(pass); |
| 397 | } |
| 398 | |
| 399 | /* Transmit BVC-RESET before NS-ALIVE of PCU was ACKed: expect no response */ |
| 400 | testcase TC_sns_1c1u_so_bvc_reset_too_early() runs on RAW_Test_CT { |
| 401 | /* Activate two NS codec ports */ |
Alexander Couzens | 2beaa20 | 2020-09-11 20:08:41 +0200 | [diff] [blame] | 402 | f_init_ns_codec(mp_nsconfig); |
| 403 | f_init_ns_codec(mp_nsconfig, 1); |
| 404 | f_init_ns_codec(mp_nsconfig, 2); |
Harald Welte | 64d0731 | 2019-03-20 09:48:39 +0100 | [diff] [blame] | 405 | f_init_pcuif(); |
| 406 | /* Perform Size + BSS-originated config */ |
| 407 | f_incoming_sns_size(); |
| 408 | f_incoming_sns_config(); |
| 409 | /* perform SGSN-originated config using idx==0 for signalling and idx==1 for user traffic */ |
| 410 | f_outgoing_sns_config_1c1u_separate(); |
| 411 | |
| 412 | /* DON'T ACK ANY INBOUND NS-ALIVE HERE! */ |
| 413 | |
| 414 | /* perform outgoing ALIVE procedure for both NS-VCs */ |
| 415 | f_outgoing_ns_alive(1); |
| 416 | f_outgoing_ns_alive(2); |
| 417 | /* ensure there's no response to NS-ALIVE sent on idx==0 */ |
| 418 | f_outgoing_ns_alive_no_ack(idx := 0); |
| 419 | |
| 420 | /* Transmit BVC-RESET and expect no ACK*/ |
Harald Welte | e97e3af | 2020-10-09 14:56:54 +0200 | [diff] [blame] | 421 | f_tx_bvc_reset_rx_ack(0, omit, omit, idx := 1, exp_ack := false); |
| 422 | 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); |
Harald Welte | 64d0731 | 2019-03-20 09:48:39 +0100 | [diff] [blame] | 423 | } |
| 424 | |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 425 | /* Test adding new IP endpoints at runtime */ |
Harald Welte | ea3c7e9 | 2019-03-01 19:34:55 +0100 | [diff] [blame] | 426 | testcase TC_sns_add() runs on RAW_Test_CT { |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 427 | f_sns_bringup_1c1u(); |
| 428 | |
Alexander Couzens | 2373afc | 2020-12-09 02:19:49 +0100 | [diff] [blame] | 429 | /* create another NS codec port on the tester side */ |
Alexander Couzens | 2beaa20 | 2020-09-11 20:08:41 +0200 | [diff] [blame] | 430 | f_init_ns_codec(mp_nsconfig, 2); |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 431 | |
| 432 | f_outgoing_sns_add(idx_add := 2, w_sig := 0, w_user := 1, idx := 0); |
| 433 | |
| 434 | /* wait for one ALIVE cycle, then ACK any further ALIVE in the background */ |
| 435 | as_rx_alive_tx_ack(oneshot := true, idx := 2); |
| 436 | activate(as_rx_alive_tx_ack(idx := 2)); |
| 437 | |
| 438 | f_outgoing_ns_alive(2); |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 439 | setverdict(pass); |
| 440 | } |
| 441 | |
Alexander Couzens | 2a0ac80 | 2020-12-09 02:19:29 +0100 | [diff] [blame] | 442 | /* Test adding an already present IP endpoint at runtime */ |
| 443 | testcase TC_sns_add_nack() runs on RAW_Test_CT { |
| 444 | f_sns_bringup_1c1u(); |
| 445 | |
| 446 | f_outgoing_sns_add(idx_add := 0, w_sig := 0, w_user := 1, idx := 0, cause := NS_CAUSE_PROTOCOL_ERROR_UNSPEIFIED); |
| 447 | setverdict(pass); |
| 448 | } |
| 449 | |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 450 | /* Test deleting IP endpoints at runtime */ |
Harald Welte | ea3c7e9 | 2019-03-01 19:34:55 +0100 | [diff] [blame] | 451 | testcase TC_sns_del() runs on RAW_Test_CT { |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 452 | f_sns_bringup_1c1u(); |
| 453 | |
| 454 | f_outgoing_sns_del(idx_del := 1, w_sig := 0, w_user := 1, idx := 0); |
| 455 | /* FIXME: ensure we don't receive anything on just-deleted NS-VC anymore */ |
| 456 | setverdict(pass); |
| 457 | } |
| 458 | |
Harald Welte | 7209955 | 2019-02-23 15:09:22 +0100 | [diff] [blame] | 459 | /* Test changing weights at runtime */ |
Harald Welte | ea3c7e9 | 2019-03-01 19:34:55 +0100 | [diff] [blame] | 460 | testcase TC_sns_chg_weight() runs on RAW_Test_CT { |
Harald Welte | 7209955 | 2019-02-23 15:09:22 +0100 | [diff] [blame] | 461 | f_sns_bringup_1c1u(); |
| 462 | |
| 463 | /* change w_user from 1 to 200 */ |
| 464 | f_outgoing_sns_chg_weight(idx_chg := 1, w_sig := 0, w_user := 200, idx := 0); |
| 465 | setverdict(pass); |
| 466 | } |
| 467 | |
Harald Welte | 16e92f4 | 2019-03-02 00:03:44 +0100 | [diff] [blame] | 468 | import from PCUIF_Types all; |
| 469 | import from PCUIF_CodecPort all; |
| 470 | |
Harald Welte | 3b33583 | 2019-03-15 22:38:06 +0100 | [diff] [blame] | 471 | altstep as_pcu_activate() runs on RAW_PCU_CT { |
| 472 | var PCUIF_send_data sd; |
| 473 | [] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_ACT_REQ(?, ?, ?))) -> value sd { repeat; } |
| 474 | |
| 475 | } |
| 476 | |
Harald Welte | 16e92f4 | 2019-03-02 00:03:44 +0100 | [diff] [blame] | 477 | testcase TC_pcuif_rach() runs on RAW_Test_CT { |
| 478 | f_sns_bringup_1c1u(); |
Harald Welte | 3b33583 | 2019-03-15 22:38:06 +0100 | [diff] [blame] | 479 | activate(as_pcu_activate()); |
Harald Welte | 16e92f4 | 2019-03-02 00:03:44 +0100 | [diff] [blame] | 480 | |
Vadim Yanitskiy | 36558d9 | 2019-11-17 02:23:51 +0700 | [diff] [blame] | 481 | f_pcuif_tx(ts_PCUIF_RACH_IND(bts_nr:=0, trx_nr:=0, ts_nr:=0, ra:=23, |
| 482 | is_11bit:=0, burst_type:=BURST_TYPE_0, |
Harald Welte | 16e92f4 | 2019-03-02 00:03:44 +0100 | [diff] [blame] | 483 | fn:=42, arfcn:=871, qta:=0)); |
| 484 | PCU.receive(t_SD_PCUIF(g_pcu_conn_id, |
| 485 | tr_PCUIF_DATA_REQ(bts_nr:=0, trx_nr:=0, ts_nr:=0, block_nr:=?, fn:=?, |
| 486 | sapi:=PCU_IF_SAPI_AGCH, data:=?))); |
| 487 | setverdict(pass); |
| 488 | } |
| 489 | |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 490 | |
| 491 | |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 492 | control { |
| 493 | execute( TC_sns_po_size_success() ); |
| 494 | execute( TC_sns_po_size_nack() ); |
| 495 | execute( TC_sns_po_config_success() ); |
| 496 | execute( TC_sns_po_config_nack() ); |
| 497 | execute( TC_sns_so_config_success() ); |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 498 | execute( TC_sns_1c1u() ); |
Harald Welte | ecd159e | 2019-03-16 13:36:07 +0100 | [diff] [blame] | 499 | execute( TC_sns_1c1u_separate() ); |
Harald Welte | 64d0731 | 2019-03-20 09:48:39 +0100 | [diff] [blame] | 500 | execute( TC_sns_1c1u_so_bvc_reset() ); |
| 501 | execute( TC_sns_1c1u_so_bvc_reset_too_early() ); |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 502 | execute( TC_sns_add() ); |
Alexander Couzens | 2a0ac80 | 2020-12-09 02:19:29 +0100 | [diff] [blame] | 503 | execute( TC_sns_add_nack() ); |
Harald Welte | 630d0e6 | 2019-02-22 23:26:40 +0100 | [diff] [blame] | 504 | execute( TC_sns_del() ); |
Harald Welte | 7209955 | 2019-02-23 15:09:22 +0100 | [diff] [blame] | 505 | execute( TC_sns_chg_weight() ); |
Harald Welte | 16e92f4 | 2019-03-02 00:03:44 +0100 | [diff] [blame] | 506 | |
| 507 | execute( TC_pcuif_rach() ); |
Harald Welte | f7b7407 | 2019-02-20 20:48:50 +0100 | [diff] [blame] | 508 | } |
| 509 | |
| 510 | } |