Change in osmo-ttcn3-hacks[master]: pcap-client: Don't bind to second 'traffic' udp port

laforge gerrit-no-reply at lists.osmocom.org
Sun Apr 25 11:09:14 UTC 2021


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/23882 )


Change subject: pcap-client: Don't bind to second 'traffic' udp port
......................................................................

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
---
M pcap-client/OPCAP_CLIENT_Tests.ttcn
1 file changed, 3 insertions(+), 15 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/82/23882/1

diff --git a/pcap-client/OPCAP_CLIENT_Tests.ttcn b/pcap-client/OPCAP_CLIENT_Tests.ttcn
index 5f59caf..e9fe406 100644
--- a/pcap-client/OPCAP_CLIENT_Tests.ttcn
+++ b/pcap-client/OPCAP_CLIENT_Tests.ttcn
@@ -34,7 +34,7 @@
 
 	/* 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 @@
 	/* 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' */

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/23882
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: If826705c78c7a0ad0e633b7a320d7dd5e5561c27
Gerrit-Change-Number: 23882
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210425/9dd0399b/attachment.htm>


More information about the gerrit-log mailing list