diff mbox series

[ovs-dev,v2,10/13] tests: Use fmt_pkt in 2 HVs, 3 LS, 1 lport/LS, ...

Message ID 20231114205417.175004-11-mmichels@redhat.com
State Accepted
Headers show
Series Convert some tests to use fmt_pkt. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/github-robot-_ovn-kubernetes success github build: passed

Commit Message

Mark Michelson Nov. 14, 2023, 8:54 p.m. UTC
... 2 peer LRs, static routes.

Execution time: 4.114s
Execution time on "main" branch: 3.428s

Signed-off-by: Mark Michelson <mmichels@redhat.com>
---
 tests/ovn.at | 49 +++++++++++++++++++++++++++++--------------------
 1 file changed, 29 insertions(+), 20 deletions(-)
diff mbox series

Patch

diff --git a/tests/ovn.at b/tests/ovn.at
index a394e67bf..e3568b171 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -6186,6 +6186,7 @@  AT_CLEANUP
 
 OVN_FOR_EACH_NORTHD([
 AT_SETUP([2 HVs, 3 LS, 1 lport/LS, 2 peer LRs, static routes])
+AT_SKIP_IF([test $HAVE_SCAPY = no])
 ovn_start
 
 # Logical network:
@@ -6280,36 +6281,44 @@  ovn-sbctl dump-flows > sbflows
 AT_CAPTURE_FILE([sbflows])
 
 # Send ip packets between foo1 and alice1
-src_mac="f00000010203"
-dst_mac="000000010203"
-src_ip=`ip_to_hex 192 168 1 2`
-dst_ip=`ip_to_hex 172 16 1 2`
-packet=${dst_mac}${src_mac}08004500001c0000000040110000${src_ip}${dst_ip}0035111100080000
+src_mac="f0:00:00:01:02:03"
+dst_mac="00:00:00:01:02:03"
+src_ip=192.168.1.2
+dst_ip=172.16.1.2
+packet=$(fmt_pkt "Ether(dst='${dst_mac}', src='${src_mac}')/ \
+                  IP(src='${src_ip}', dst='${dst_ip}')/ \
+                  UDP(sport=53, dport=4369)")
 as hv1 ovs-appctl netdev-dummy/receive hv1-vif1 $packet
 
 # Send ip packets between foo1 and bob1
-src_mac="f00000010203"
-dst_mac="000000010203"
-src_ip=`ip_to_hex 192 168 1 2`
-dst_ip=`ip_to_hex 172 16 2 2`
-packet=${dst_mac}${src_mac}08004500001c0000000040110000${src_ip}${dst_ip}0035111100080000
+src_mac="f0:00:00:01:02:03"
+dst_mac="00:00:00:01:02:03"
+src_ip=192.168.1.2
+dst_ip=172.16.2.2
+packet=$(fmt_pkt "Ether(dst='${dst_mac}', src='${src_mac}')/ \
+                  IP(src='${src_ip}', dst='${dst_ip}')/ \
+                  UDP(sport=53, dport=4369)")
 as hv1 ovs-appctl netdev-dummy/receive hv1-vif1 $packet
 
 # Packet to Expect at bob1
-src_mac="000000010205"
-dst_mac="f00000010205"
-src_ip=`ip_to_hex 192 168 1 2`
-dst_ip=`ip_to_hex 172 16 2 2`
-echo "${dst_mac}${src_mac}08004500001c000000003e110200${src_ip}${dst_ip}0035111100080000" > expected
+src_mac="00:00:00:01:02:05"
+dst_mac="f0:00:00:01:02:05"
+src_ip=192.168.1.2
+dst_ip=172.16.2.2
+echo $(fmt_pkt "Ether(dst='${dst_mac}', src='${src_mac}')/ \
+                  IP(src='${src_ip}', dst='${dst_ip}', ttl=0x3e)/ \
+                  UDP(sport=53, dport=4369)") > expected
 
 OVN_CHECK_PACKETS([hv2/vif1-tx.pcap], [expected])
 
 # Packet to Expect at alice1
-src_mac="000000010204"
-dst_mac="f00000010204"
-src_ip=`ip_to_hex 192 168 1 2`
-dst_ip=`ip_to_hex 172 16 1 2`
-echo "${dst_mac}${src_mac}08004500001c000000003e110200${src_ip}${dst_ip}0035111100080000" > expected
+src_mac="00:00:00:01:02:04"
+dst_mac="f0:00:00:01:02:04"
+src_ip=192.168.1.2
+dst_ip=172.16.1.2
+echo $(fmt_pkt "Ether(dst='${dst_mac}', src='${src_mac}')/ \
+                  IP(src='${src_ip}', dst='${dst_ip}', ttl=0x3e)/ \
+                  UDP(sport=53, dport=4369)") > expected
 
 OVN_CHECK_PACKETS([hv1/vif2-tx.pcap], [expected])