summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEthan Jackson <ethan@nicira.com>2011-04-11 16:17:39 -0700
committerEthan Jackson <ethan@nicira.com>2011-04-12 11:23:45 -0700
commitf8064ac96e4aa1600861f1d76ab424e0425ba429 (patch)
tree38670a281f543466757f4c587a9d6cf7cf48aaaa /tests
parentb1b5cd8e2162ad859d2453815c9c056aa97ad44b (diff)
downloadopenvswitch-f8064ac96e4aa1600861f1d76ab424e0425ba429.tar.gz
tests: Unit test autopath via ovs-ofctl.
This patch adds test designed to verify the correctness of the parsing function introduced with the autopath action.
Diffstat (limited to 'tests')
-rw-r--r--tests/automake.mk1
-rw-r--r--tests/autopath.at35
-rw-r--r--tests/testsuite.at1
3 files changed, 37 insertions, 0 deletions
diff --git a/tests/automake.mk b/tests/automake.mk
index 7872d21a2..5f6800bfd 100644
--- a/tests/automake.mk
+++ b/tests/automake.mk
@@ -15,6 +15,7 @@ TESTSUITE_AT = \
tests/ofp-print.at \
tests/ovs-ofctl.at \
tests/multipath.at \
+ tests/autopath.at \
tests/vconn.at \
tests/file_name.at \
tests/aes128.at \
diff --git a/tests/autopath.at b/tests/autopath.at
new file mode 100644
index 000000000..40e54d5e6
--- /dev/null
+++ b/tests/autopath.at
@@ -0,0 +1,35 @@
+AT_BANNER([autopath link selection])
+
+AT_SETUP([autopath basic])
+AT_CHECK([ovs-ofctl parse-flow 'actions=autopath(1, NXM_NX_REG0[[]])'], [0],
+ [OFPT_FLOW_MOD (xid=0x1): ADD actions=autopath(1,NXM_NX_REG0[[]])
+], [ignore])
+AT_CHECK([ovs-ofctl parse-flow 'actions=autopath(2, NXM_NX_REG0[[2..30]])'], [0],
+ [OFPT_FLOW_MOD (xid=0x1): ADD actions=autopath(2,NXM_NX_REG0[[2..30]])
+], [ignore])
+AT_CLEANUP
+
+AT_SETUP([autopath action missing argument])
+AT_CHECK([ovs-ofctl parse-flow actions=autopath], [1], [],
+ [ovs-ofctl: : not enough arguments to autopath action
+])
+AT_CLEANUP
+
+AT_SETUP([autopath action bad port])
+AT_CHECK([ovs-ofctl parse-flow 'actions=autopath(bad, NXM_NX_REG0[[]])'], [1], [],
+ [ovs-ofctl: bad, NXM_NX_REG0[[]]: autopath id 0 is not in valid range 1 to 4294967295
+])
+AT_CLEANUP
+
+AT_SETUP([autopath action bad destination])
+AT_CHECK([ovs-ofctl parse-flow 'actions=autopath(1, NXM_OF_VLAN_TCI[[]])'], [1], [],
+ [ovs-ofctl: 1, NXM_OF_VLAN_TCI[[]]: destination field must be a register
+])
+AT_CLEANUP
+
+AT_SETUP([autopath action destination too narrow])
+AT_CHECK([ovs-ofctl parse-flow 'actions=autopath(1,NXM_NX_REG0[[0..7]])'], [1], [],
+ [ovs-ofctl: 1,NXM_NX_REG0[[0..7]]: 8-bit destination field has 256 possible values, less than required 65536
+])
+AT_CLEANUP
+
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 5625f8b0d..286789327 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -46,6 +46,7 @@ m4_include([tests/daemon-py.at])
m4_include([tests/ofp-print.at])
m4_include([tests/ovs-ofctl.at])
m4_include([tests/multipath.at])
+m4_include([tests/autopath.at])
m4_include([tests/vconn.at])
m4_include([tests/file_name.at])
m4_include([tests/aes128.at])