diff mbox series

[ovs-dev] tests: Make packet-type-aware.at hash independent

Message ID AM4PR07MB30739947A51AD6DE401232289FC10@AM4PR07MB3073.eurprd07.prod.outlook.com
State Accepted
Headers show
Series [ovs-dev] tests: Make packet-type-aware.at hash independent | expand

Commit Message

Balazs Nemeth Feb. 26, 2018, 9:10 a.m. UTC
When compiling with -msse4.2 a test case of packet-type-aware.at will
fail due to the CRC32 based hash function is different from mhash.
Fix this issue with parsing the port statistics one-by-one.

Signed-off-by: Balazs Nemeth <balazs.nemeth@ericsson.com>
CC: Jan Scheurich <jan.scheurich@ericsson.com>
CC: Zoltan Balogh <zoltan.balogh@ericsson.com>
Fixes: 00135b869d7c ("xlate: fix xport lookup for recirc")
---
 tests/packet-type-aware.at | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

--
1.9.1

Comments

Ben Pfaff Feb. 26, 2018, 10:37 p.m. UTC | #1
On Mon, Feb 26, 2018 at 09:10:35AM +0000, Balazs Nemeth wrote:
> When compiling with -msse4.2 a test case of packet-type-aware.at will
> fail due to the CRC32 based hash function is different from mhash.
> Fix this issue with parsing the port statistics one-by-one.
> 
> Signed-off-by: Balazs Nemeth <balazs.nemeth@ericsson.com>
> CC: Jan Scheurich <jan.scheurich@ericsson.com>
> CC: Zoltan Balogh <zoltan.balogh@ericsson.com>
> Fixes: 00135b869d7c ("xlate: fix xport lookup for recirc")

Thanks, I applied this to master and backported as far as branch-2.8.  I
changed it to use the ovs-ofctl feature where it can dump an individual
port, which I doubt had any other tests in the tree:

diff --git a/tests/packet-type-aware.at b/tests/packet-type-aware.at
index f43095c60a45..23f9037abc5c 100644
--- a/tests/packet-type-aware.at
+++ b/tests/packet-type-aware.at
@@ -1027,10 +1027,12 @@ tunnel(src=20.0.0.2,dst=20.0.0.1,flags(-df-csum)),recirc_id(0x1),in_port(gre_sys
 ovs-appctl time/warp 1000
 
 AT_CHECK([
-    ovs-ofctl dump-ports int-br
-], [0], [OFPST_PORT reply (xid=0x2): 2 ports
+    ovs-ofctl dump-ports int-br LOCAL
+    ovs-ofctl dump-ports int-br 2
+], [0], [OFPST_PORT reply (xid=0x2): 1 ports
   port LOCAL: rx pkts=0, bytes=0, drop=?, errs=?, frame=?, over=?, crc=?
            tx pkts=4, bytes=392, drop=?, errs=?, coll=?
+OFPST_PORT reply (xid=0x2): 1 ports
   port  2: rx pkts=4, bytes=352, drop=?, errs=?, frame=?, over=?, crc=?
            tx pkts=0, bytes=0, drop=?, errs=?, coll=?
 ])
diff mbox series

Patch

diff --git a/tests/packet-type-aware.at b/tests/packet-type-aware.at
index f43095c..c289bb4 100644
--- a/tests/packet-type-aware.at
+++ b/tests/packet-type-aware.at
@@ -1027,10 +1027,15 @@  tunnel(src=20.0.0.2,dst=20.0.0.1,flags(-df-csum)),recirc_id(0x1),in_port(gre_sys
 ovs-appctl time/warp 1000

 AT_CHECK([
-    ovs-ofctl dump-ports int-br
-], [0], [OFPST_PORT reply (xid=0x2): 2 ports
+    ovs-ofctl dump-ports int-br | grep -A1 LOCAL:
+], [0], [dnl
   port LOCAL: rx pkts=0, bytes=0, drop=?, errs=?, frame=?, over=?, crc=?
            tx pkts=4, bytes=392, drop=?, errs=?, coll=?
+])
+
+AT_CHECK([
+    ovs-ofctl dump-ports int-br | grep -A1 2:
+], [0], [dnl
   port  2: rx pkts=4, bytes=352, drop=?, errs=?, frame=?, over=?, crc=?
            tx pkts=0, bytes=0, drop=?, errs=?, coll=?
 ])