diff options
author | Harald Welte <laforge@osmocom.org> | 2021-04-25 13:03:41 +0200 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2021-04-25 13:06:35 +0200 |
commit | 1c8d16c57057f821a372353614d74eb732ce5c80 (patch) | |
tree | 64048b63c22902e7bf1f4a061a66c107454ca624 /pcap-client | |
parent | a1f8e20bb3d78b5ff656f818346874674c482101 (diff) |
pcap-client: Don't bind to second 'traffic' udp port
if the tester runs on a different host/IP than the IUT (like in our
dockerized jenkins tests), then of course we cannot assume that
traffic sent by the tester can be received by the tester again.
So rather than binding/connecting two sockets, let's only use one
and send packets without caring if there is a remote receiver.
Change-Id: If826705c78c7a0ad0e633b7a320d7dd5e5561c27
Diffstat (limited to 'pcap-client')
-rw-r--r-- | pcap-client/OPCAP_CLIENT_Tests.ttcn | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/pcap-client/OPCAP_CLIENT_Tests.ttcn b/pcap-client/OPCAP_CLIENT_Tests.ttcn index 5f59cafc..e9fe406a 100644 --- a/pcap-client/OPCAP_CLIENT_Tests.ttcn +++ b/pcap-client/OPCAP_CLIENT_Tests.ttcn @@ -34,7 +34,7 @@ type component test_CT extends OPCAP_Adapter_CT { /* port to generate IP traffic that may or may not be captured */ port IPL4asp_PT IP; - var integer g_traffic_conn_id[2]; + var integer g_traffic_conn_id; }; private altstep as_Tguard() runs on test_CT { @@ -70,24 +70,12 @@ private function f_init() runs on test_CT { /* 0 -> 1 */ res := f_IPL4_connect(IP, mp_traffic_b.ip, mp_traffic_b.udp_port, mp_traffic_a.ip, mp_traffic_a.udp_port, -1, { udp:={} }); - g_traffic_conn_id[0] := res.connId; - - /* 1 -> 0 */ - res := f_IPL4_connect(IP, mp_traffic_a.ip, mp_traffic_a.udp_port, - mp_traffic_b.ip, mp_traffic_b.udp_port, -1, { udp:={} }); - g_traffic_conn_id[1] := res.connId; + g_traffic_conn_id := res.connId; } /* generate user traffic from A -> B */ function f_trafic_pkt_ab(octetstring payload) runs on test_CT { - IP.send(ASP_Send:{g_traffic_conn_id[0], omit, payload}) - IP.receive(ASP_RecvFrom:{g_traffic_conn_id[1], ?, ?, ?, ?, { udp:={} }, ?, payload}); -} - -/* generate user traffic from B -> A */ -function f_trafic_pkt_ba(octetstring payload) runs on test_CT { - IP.send(ASP_Send:{g_traffic_conn_id[1], omit, payload}) - IP.receive(ASP_RecvFrom:{g_traffic_conn_id[0], ?, ?, ?, ?, { udp:={} }, ?, payload}); + IP.send(ASP_Send:{g_traffic_conn_id, omit, payload}) } /* expect a specified UDP payload on the OPCAP connection 'idx' */ |