summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2018-02-09 10:04:26 -0800
committerBen Pfaff <blp@ovn.org>2018-02-13 10:43:13 -0800
commit0d71302e36c4ad290cb3b36363b48756fb438c59 (patch)
tree2b2095496fb8d2c94d891e57047deea4c9f4712a /tests
parent31292693fc3a845a5f40102fcbf500cfe3167290 (diff)
downloadopenvswitch-0d71302e36c4ad290cb3b36363b48756fb438c59.tar.gz
ofp-util, ofp-parse: Break up into many separate modules.
ofp-util had been far too large and monolithic for a long time. This commit breaks it up into units that make some logical sense. It also moves the pieces of ofp-parse that were specific to each unit into the relevant unit. Most of this commit is just moving code around. Signed-off-by: Ben Pfaff <blp@ovn.org> Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/learn.at2
-rw-r--r--tests/ofp-print.at14
-rw-r--r--tests/ovs-ofctl.at38
-rw-r--r--tests/test-classifier.c1
-rw-r--r--tests/test-flows.c2
-rw-r--r--tests/test-odp.c2
-rw-r--r--tests/test-vconn.c1
7 files changed, 29 insertions, 31 deletions
diff --git a/tests/learn.at b/tests/learn.at
index 406a827aa..5f1d6df9d 100644
--- a/tests/learn.at
+++ b/tests/learn.at
@@ -28,7 +28,7 @@ AT_CLEANUP
AT_SETUP([learning action - parsing and formatting - illegal in_port_oxm])
AT_CHECK([[ovs-ofctl parse-flow 'actions=learn(table=1, in_port_oxm=123456)']],
[1], [], [stderr])
-AT_CHECK([sed -e 's/.*|ofp_util|WARN|//' < stderr], [0],
+AT_CHECK([sed -e 's/.*|ofp_port|WARN|//' < stderr], [0],
[[port 123456 is outside the supported range 0 through ffff or 0xffffff00 through 0xffffffff
ovs-ofctl: table=1, in_port_oxm=123456: in_port_oxm value 123456 cannot be parsed as a subfield (123456: unknown field `123456') or an immediate value (123456: port value out of range for in_port_oxm)
]], [[]])
diff --git a/tests/ofp-print.at b/tests/ofp-print.at
index 821087ce1..106160951 100644
--- a/tests/ofp-print.at
+++ b/tests/ofp-print.at
@@ -876,9 +876,9 @@ AT_CHECK([ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print "\
" 2], [0], [dnl
OFPT_FLOW_MOD (xid=0x0): ADD priority=65535,arp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,arp_spa=192.168.0.2,arp_tpa=192.168.0.1,arp_op=2 idle:5 buf:0x10e out_port:0 actions=output:3
], [dnl
-ofp_util|INFO|normalization changed ofp_match, details:
-ofp_util|INFO| pre: arp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,arp_spa=192.168.0.2,arp_tpa=192.168.0.1,arp_op=2,nw_tos=0,tp_src=0,tp_dst=0
-ofp_util|INFO|post: arp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,arp_spa=192.168.0.2,arp_tpa=192.168.0.1,arp_op=2
+ofp_match|INFO|normalization changed ofp_match, details:
+ofp_match|INFO| pre: arp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,arp_spa=192.168.0.2,arp_tpa=192.168.0.1,arp_op=2,nw_tos=0,tp_src=0,tp_dst=0
+ofp_match|INFO|post: arp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,arp_spa=192.168.0.2,arp_tpa=192.168.0.1,arp_op=2
])
AT_CLEANUP
@@ -934,9 +934,9 @@ AT_CHECK([ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print "\
" 3], [0], [dnl
OFPT_FLOW_MOD (xid=0x0): ADD arp,in_port=1,dl_vlan=65535,dl_vlan_pcp=0,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,nw_src=192.168.0.2,nw_dst=192.168.0.1,arp_op=2,nw_tos=0,tp_src=0,tp_dst=0 idle:5 pri:65535 buf:0x10e out_port:0 actions=output:3
], [dnl
-ofp_util|INFO|normalization changed ofp_match, details:
-ofp_util|INFO| pre: arp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,arp_spa=192.168.0.2,arp_tpa=192.168.0.1,arp_op=2,nw_tos=0,tp_src=0,tp_dst=0
-ofp_util|INFO|post: arp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,arp_spa=192.168.0.2,arp_tpa=192.168.0.1,arp_op=2
+ofp_match|INFO|normalization changed ofp_match, details:
+ofp_match|INFO| pre: arp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,arp_spa=192.168.0.2,arp_tpa=192.168.0.1,arp_op=2,nw_tos=0,tp_src=0,tp_dst=0
+ofp_match|INFO|post: arp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:06,dl_dst=50:54:00:00:00:05,arp_spa=192.168.0.2,arp_tpa=192.168.0.1,arp_op=2
])
AT_CLEANUP
@@ -3617,7 +3617,7 @@ OFPT_BUNDLE_ADD_MESSAGE (OF1.4) (xid=0x0): ***decode error: OFPBFC_MSG_UNSUP***
00000000 05 22 00 20 00 00 00 00-00 00 00 01 00 00 00 01 |.". ............|
00000010 05 00 00 10 00 00 00 00-00 00 00 00 00 00 00 00 |................|
], [dnl
-ofp_util|WARN|OFPT_HELLO message not allowed inside OFPT14_BUNDLE_ADD_MESSAGE
+ofp_bundle|WARN|OFPT_HELLO message not allowed inside OFPT14_BUNDLE_ADD_MESSAGE
])
AT_CLEANUP
diff --git a/tests/ovs-ofctl.at b/tests/ovs-ofctl.at
index f8d43adcc..e1fc8299a 100644
--- a/tests/ovs-ofctl.at
+++ b/tests/ovs-ofctl.at
@@ -1316,9 +1316,9 @@ dnl Ignore nw_proto if not IP or ARP:
# dl_type=0x1234,nw_proto=5
# normal: 3: cf -> ef
# normal: 25: 05 -> 00
-& ofp_util|INFO|normalization changed ofp_match, details:
-& ofp_util|INFO| pre: dl_type=0x1234,nw_proto=5
-& ofp_util|INFO|post: dl_type=0x1234
+& ofp_match|INFO|normalization changed ofp_match, details:
+& ofp_match|INFO| pre: dl_type=0x1234,nw_proto=5
+& ofp_match|INFO|post: dl_type=0x1234
003820cf xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 1234 xx 05 xxxx dnl
xxxxxxxx xxxxxxxx xxxx xxxx
@@ -1331,9 +1331,9 @@ dnl Ignore nw_tos if not IP:
# 24: 05 -> 04
# normal: 1: 18 -> 38
# normal: 24: 04 -> 00
-& ofp_util|INFO|normalization changed ofp_match, details:
-& ofp_util|INFO| pre: arp,nw_tos=4
-& ofp_util|INFO|post: arp
+& ofp_match|INFO|normalization changed ofp_match, details:
+& ofp_match|INFO| pre: arp,nw_tos=4
+& ofp_match|INFO|post: arp
001820ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 05 xx xxxx dnl
xxxxxxxx xxxxxxxx xxxx xxxx
@@ -1390,9 +1390,9 @@ dnl Ignore nw_src if not IP or ARP:
# normal: 28: c0 -> 00
# normal: 29: a8 -> 00
# normal: 30: 80 -> 00
-& ofp_util|INFO|normalization changed ofp_match, details:
-& ofp_util|INFO| pre: dl_type=0x1234,nw_src=192.168.128.0/24
-& ofp_util|INFO|post: dl_type=0x1234
+& ofp_match|INFO|normalization changed ofp_match, details:
+& ofp_match|INFO| pre: dl_type=0x1234,nw_src=192.168.128.0/24
+& ofp_match|INFO|post: dl_type=0x1234
003808ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 1234 xx xx xxxx dnl
c0a88055 xxxxxxxx xxxx xxxx
@@ -1403,9 +1403,9 @@ dnl Ignore nw_dst if not IP or ARP:
# normal: 32: c0 -> 00
# normal: 33: a8 -> 00
# normal: 34: 80 -> 00
-& ofp_util|INFO|normalization changed ofp_match, details:
-& ofp_util|INFO| pre: dl_type=0x1234,nw_dst=192.168.128.0/24
-& ofp_util|INFO|post: dl_type=0x1234
+& ofp_match|INFO|normalization changed ofp_match, details:
+& ofp_match|INFO| pre: dl_type=0x1234,nw_dst=192.168.128.0/24
+& ofp_match|INFO|post: dl_type=0x1234
003220ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 1234 xx xx xxxx dnl
xxxxxxxx c0a88055 xxxx xxxx
@@ -1446,9 +1446,9 @@ dnl Ignore tp_src if not TCP/UDP/SCTP:
# normal: 3: 8f -> cf
# normal: 36: 01 -> 00
# normal: 37: bb -> 00
-& ofp_util|INFO|normalization changed ofp_match, details:
-& ofp_util|INFO| pre: ip,nw_proto=21,tp_src=443
-& ofp_util|INFO|post: ip,nw_proto=21
+& ofp_match|INFO|normalization changed ofp_match, details:
+& ofp_match|INFO| pre: ip,nw_proto=21,tp_src=443
+& ofp_match|INFO|post: ip,nw_proto=21
0038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 15 xxxx dnl
xxxxxxxx xxxxxxxx 01bb xxxx
@@ -1483,7 +1483,7 @@ AT_DATA([test-data], [dnl
00000000 00 000000 0000000000000000ffffffffffffffff
# bad ofp11_match: OFPBMC_BAD_VALUE
-& ofp_util|WARN|port 305419896 is outside the supported range 0 through 65279 or 0xffffff00 through 0xffffffff
+& ofp_port|WARN|port 305419896 is outside the supported range 0 through 65279 or 0xffffff00 through 0xffffffff
0000 0058 12345678 000003fe dnl
000000000000ffffffffffff 000000000000ffffffffffff dnl
0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
@@ -2651,9 +2651,9 @@ AT_SETUP([ovs-ofctl add-flow reports non-normalized flows])
OVS_VSWITCHD_START
AT_CHECK([ovs-ofctl TESTABLE_LOG add-flow br0 nw_src=1.2.3.4,actions=5],
[0], [], [dnl
-ofp_util|INFO|normalization changed ofp_match, details:
-ofp_util|INFO| pre: nw_src=1.2.3.4
-ofp_util|INFO|post: @&t@
+ofp_match|INFO|normalization changed ofp_match, details:
+ofp_match|INFO| pre: nw_src=1.2.3.4
+ofp_match|INFO|post: @&t@
])
OVS_VSWITCHD_STOP
AT_CLEANUP
diff --git a/tests/test-classifier.c b/tests/test-classifier.c
index ef6693e61..909260d11 100644
--- a/tests/test-classifier.c
+++ b/tests/test-classifier.c
@@ -36,7 +36,6 @@
#include "command-line.h"
#include "fatal-signal.h"
#include "flow.h"
-#include "openvswitch/ofp-util.h"
#include "ovstest.h"
#include "ovs-atomic.h"
#include "ovs-thread.h"
diff --git a/tests/test-flows.c b/tests/test-flows.c
index d7fa798df..871b729eb 100644
--- a/tests/test-flows.c
+++ b/tests/test-flows.c
@@ -23,8 +23,8 @@
#include <string.h>
#include "classifier.h"
#include "openflow/openflow.h"
+#include "openvswitch/ofp-match.h"
#include "openvswitch/ofp-print.h"
-#include "openvswitch/ofp-util.h"
#include "openvswitch/ofpbuf.h"
#include "openvswitch/vlog.h"
#include "ovstest.h"
diff --git a/tests/test-odp.c b/tests/test-odp.c
index 1f1ff9ad6..f61846422 100644
--- a/tests/test-odp.c
+++ b/tests/test-odp.c
@@ -24,7 +24,7 @@
#include "openvswitch/ofpbuf.h"
#include "ovstest.h"
#include "util.h"
-#include "openvswitch/ofp-parse.h"
+#include "openvswitch/ofp-flow.h"
#include "openvswitch/vlog.h"
static int
diff --git a/tests/test-vconn.c b/tests/test-vconn.c
index 07997a1bc..0c17a8395 100644
--- a/tests/test-vconn.c
+++ b/tests/test-vconn.c
@@ -26,7 +26,6 @@
#include "fatal-signal.h"
#include "openflow/openflow.h"
#include "openvswitch/ofp-msgs.h"
-#include "openvswitch/ofp-util.h"
#include "openvswitch/ofpbuf.h"
#include "openvswitch/vconn.h"
#include "openvswitch/vlog.h"