From 7c025fedc32c48f4fe7c4d3edc6c2d3674f69d86 Mon Sep 17 00:00:00 2001 From: armando-migliaccio Date: Wed, 8 May 2013 11:33:07 -0700 Subject: [PATCH] Check quantum status dependent on the plugin There are Quantum plugins that do not require the use of an agent. This patch relaxes the constraint in quantum-adv-test.sh by adding the ability to customize the logic that verifies whether the test can run or not, depending on the Quantum plugin of your choice. Fixes bug #1177904 Change-Id: I6e2c17f43d9e1475b2eb175cceb5107a83f9aa74 --- exercises/quantum-adv-test.sh | 9 ++++----- lib/quantum_plugins/README.md | 2 ++ lib/quantum_plugins/bigswitch_floodlight | 4 ++++ lib/quantum_plugins/brocade | 4 ++++ lib/quantum_plugins/linuxbridge | 4 ++++ lib/quantum_plugins/nec | 4 ++++ lib/quantum_plugins/nicira | 4 ++++ lib/quantum_plugins/openvswitch | 4 ++++ lib/quantum_plugins/plumgrid | 3 +++ lib/quantum_plugins/ryu | 4 ++++ 10 files changed, 37 insertions(+), 5 deletions(-) diff --git a/exercises/quantum-adv-test.sh b/exercises/quantum-adv-test.sh index fbb1b779f2..34f4f62312 100755 --- a/exercises/quantum-adv-test.sh +++ b/exercises/quantum-adv-test.sh @@ -43,13 +43,12 @@ source $TOP_DIR/functions # Import configuration source $TOP_DIR/openrc -# If quantum is not enabled we exit with exitcode 55 which mean -# exercise is skipped. -is_service_enabled quantum && is_service_enabled q-agt && is_service_enabled q-dhcp || exit 55 - -# Import quantum fucntions +# Import quantum functions source $TOP_DIR/lib/quantum +# If quantum is not enabled we exit with exitcode 55, which means exercise is skipped. +quantum_plugin_check_adv_test_requirements || exit 55 + # Import exercise configuration source $TOP_DIR/exerciserc diff --git a/lib/quantum_plugins/README.md b/lib/quantum_plugins/README.md index 05bfb85125..e8299409cb 100644 --- a/lib/quantum_plugins/README.md +++ b/lib/quantum_plugins/README.md @@ -34,3 +34,5 @@ functions * ``quantum_plugin_setup_interface_driver`` * ``has_quantum_plugin_security_group``: return 0 if the plugin support quantum security group otherwise return 1 +* ``quantum_plugin_check_adv_test_requirements``: + return 0 if requirements are satisfied otherwise return 1 diff --git a/lib/quantum_plugins/bigswitch_floodlight b/lib/quantum_plugins/bigswitch_floodlight index 4857f49569..edee0eb748 100644 --- a/lib/quantum_plugins/bigswitch_floodlight +++ b/lib/quantum_plugins/bigswitch_floodlight @@ -56,5 +56,9 @@ function has_quantum_plugin_security_group() { return 1 } +function quantum_plugin_check_adv_test_requirements() { + is_service_enabled q-agt && is_service_enabled q-dhcp && return 0 +} + # Restore xtrace $MY_XTRACE diff --git a/lib/quantum_plugins/brocade b/lib/quantum_plugins/brocade index 6e26ad7842..fc86debb90 100644 --- a/lib/quantum_plugins/brocade +++ b/lib/quantum_plugins/brocade @@ -50,5 +50,9 @@ function has_quantum_plugin_security_group() { return 0 } +function quantum_plugin_check_adv_test_requirements() { + is_service_enabled q-agt && is_service_enabled q-dhcp && return 0 +} + # Restore xtrace $BRCD_XTRACE diff --git a/lib/quantum_plugins/linuxbridge b/lib/quantum_plugins/linuxbridge index 324e255231..b4b52e9c57 100644 --- a/lib/quantum_plugins/linuxbridge +++ b/lib/quantum_plugins/linuxbridge @@ -86,5 +86,9 @@ function has_quantum_plugin_security_group() { return 0 } +function quantum_plugin_check_adv_test_requirements() { + is_service_enabled q-agt && is_service_enabled q-dhcp && return 0 +} + # Restore xtrace $MY_XTRACE diff --git a/lib/quantum_plugins/nec b/lib/quantum_plugins/nec index f61f50bba5..4a2a49767a 100644 --- a/lib/quantum_plugins/nec +++ b/lib/quantum_plugins/nec @@ -118,5 +118,9 @@ function has_quantum_plugin_security_group() { return 0 } +function quantum_plugin_check_adv_test_requirements() { + is_service_enabled q-agt && is_service_enabled q-dhcp && return 0 +} + # Restore xtrace $MY_XTRACE diff --git a/lib/quantum_plugins/nicira b/lib/quantum_plugins/nicira index 6eefb022ec..305c3bfa7d 100644 --- a/lib/quantum_plugins/nicira +++ b/lib/quantum_plugins/nicira @@ -146,5 +146,9 @@ function has_quantum_plugin_security_group() { return 0 } +function quantum_plugin_check_adv_test_requirements() { + is_service_enabled q-dhcp && return 0 +} + # Restore xtrace $MY_XTRACE diff --git a/lib/quantum_plugins/openvswitch b/lib/quantum_plugins/openvswitch index ab16483452..6293257c96 100644 --- a/lib/quantum_plugins/openvswitch +++ b/lib/quantum_plugins/openvswitch @@ -144,5 +144,9 @@ function has_quantum_plugin_security_group() { return 0 } +function quantum_plugin_check_adv_test_requirements() { + is_service_enabled q-agt && is_service_enabled q-dhcp && return 0 +} + # Restore xtrace $MY_XTRACE diff --git a/lib/quantum_plugins/plumgrid b/lib/quantum_plugins/plumgrid index 912aa7ed80..14567104ed 100644 --- a/lib/quantum_plugins/plumgrid +++ b/lib/quantum_plugins/plumgrid @@ -35,5 +35,8 @@ function quantum_plugin_configure_debug_command() { : } +function quantum_plugin_check_adv_test_requirements() { + is_service_enabled q-agt && is_service_enabled q-dhcp && return 0 +} # Restore xtrace $MY_XTRACE diff --git a/lib/quantum_plugins/ryu b/lib/quantum_plugins/ryu index 113923235c..1b039dc950 100644 --- a/lib/quantum_plugins/ryu +++ b/lib/quantum_plugins/ryu @@ -71,5 +71,9 @@ function has_quantum_plugin_security_group() { return 0 } +function quantum_plugin_check_adv_test_requirements() { + is_service_enabled q-agt && is_service_enabled q-dhcp && return 0 +} + # Restore xtrace $MY_XTRACE