summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEmma Finn <emma.finn@intel.com>2022-07-15 10:16:17 +0000
committerIan Stokes <ian.stokes@intel.com>2022-07-15 11:39:20 +0100
commit1713fc011656de9963744c9477ca2868eda5defd (patch)
treed598d39a2fa23d1d704e9d7ba3d3e1c28109c368 /tests
parenteec822761429f52b8f0db5360f3437a8827aa753 (diff)
downloadopenvswitch-1713fc011656de9963744c9477ca2868eda5defd.tar.gz
odp-execute: Add command to switch action implementation.
This commit adds a new command to allow the user to switch the active action implementation at runtime. Usage: $ ovs-appctl odp-execute/action-impl-set scalar This commit also adds a new command to retrieve the list of available action implementations. This can be used by to check what implementations of actions are available and what implementation is active during runtime. Usage: $ ovs-appctl odp-execute/action-impl-show Added separate test-case for ovs-actions show/set commands: odp-execute - actions implementation Signed-off-by: Emma Finn <emma.finn@intel.com> Signed-off-by: Kumar Amber <kumar.amber@intel.com> Signed-off-by: Sunil Pai G <sunil.pai.g@intel.com> Co-authored-by: Kumar Amber <kumar.amber@intel.com> Co-authored-by: Sunil Pai G <sunil.pai.g@intel.com> Acked-by: Harry van Haaren <harry.van.haaren@intel.com> Acked-by: Eelco Chaudron <echaudro@redhat.com> Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/odp.at39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/odp.at b/tests/odp.at
index 4d08c59ca..7a1cf3b2c 100644
--- a/tests/odp.at
+++ b/tests/odp.at
@@ -472,3 +472,42 @@ AT_CHECK_UNQUOTED([ovstest test-odp parse-keys < odp-in.txt], [0], [dnl
odp_flow_from_string: error (syntax error at encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap())))))))))))))))))))))))))))))))))
])
AT_CLEANUP
+
+AT_BANNER([datapath actions in userspace])
+AT_SETUP([odp-execute - actions implementation])
+OVS_VSWITCHD_START()
+
+AT_CHECK([ovs-vsctl show], [], [stdout])
+
+dnl Set the scalar first, so we always have the scalar impl as Active.
+AT_CHECK([ovs-appctl odp-execute/action-impl-set scalar], [0], [dnl
+Action implementation set to scalar.
+])
+AT_CHECK([ovs-appctl odp-execute/action-impl-show | grep "scalar"], [], [dnl
+ scalar (available: Yes, active: Yes)
+])
+
+AT_CHECK([ovs-appctl odp-execute/action-impl-show | grep "autovalidator"], [], [dnl
+ autovalidator (available: Yes, active: No)
+])
+
+dnl Set the autovalidator impl to active.
+AT_CHECK([ovs-appctl odp-execute/action-impl-set autovalidator], [0], [dnl
+Action implementation set to autovalidator.
+])
+
+AT_CHECK([ovs-appctl odp-execute/action-impl-show | grep "scalar"], [], [dnl
+ scalar (available: Yes, active: No)
+])
+
+AT_CHECK([ovs-appctl odp-execute/action-impl-show | grep "autovalidator"], [], [dnl
+ autovalidator (available: Yes, active: Yes)
+])
+
+AT_CHECK([ovs-appctl odp-execute/action-impl-set invalid_implementation], [2], [], [dnl
+Error: unknown action implementation, invalid_implementation, specified!
+ovs-appctl: ovs-vswitchd: server returned an error
+])
+
+OVS_VSWITCHD_STOP(["/Failed setting action implementation to invalid_implementation/d"])
+AT_CLEANUP