Skip to content

Commit 7c025fe

Browse files
author
armando-migliaccio
committed
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
1 parent b240ad4 commit 7c025fe

10 files changed

Lines changed: 37 additions & 5 deletions

File tree

exercises/quantum-adv-test.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,12 @@ source $TOP_DIR/functions
4343
# Import configuration
4444
source $TOP_DIR/openrc
4545

46-
# If quantum is not enabled we exit with exitcode 55 which mean
47-
# exercise is skipped.
48-
is_service_enabled quantum && is_service_enabled q-agt && is_service_enabled q-dhcp || exit 55
49-
50-
# Import quantum fucntions
46+
# Import quantum functions
5147
source $TOP_DIR/lib/quantum
5248

49+
# If quantum is not enabled we exit with exitcode 55, which means exercise is skipped.
50+
quantum_plugin_check_adv_test_requirements || exit 55
51+
5352
# Import exercise configuration
5453
source $TOP_DIR/exerciserc
5554

lib/quantum_plugins/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,5 @@ functions
3434
* ``quantum_plugin_setup_interface_driver``
3535
* ``has_quantum_plugin_security_group``:
3636
return 0 if the plugin support quantum security group otherwise return 1
37+
* ``quantum_plugin_check_adv_test_requirements``:
38+
return 0 if requirements are satisfied otherwise return 1

lib/quantum_plugins/bigswitch_floodlight

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,9 @@ function has_quantum_plugin_security_group() {
5656
return 1
5757
}
5858

59+
function quantum_plugin_check_adv_test_requirements() {
60+
is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
61+
}
62+
5963
# Restore xtrace
6064
$MY_XTRACE

lib/quantum_plugins/brocade

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,9 @@ function has_quantum_plugin_security_group() {
5050
return 0
5151
}
5252

53+
function quantum_plugin_check_adv_test_requirements() {
54+
is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
55+
}
56+
5357
# Restore xtrace
5458
$BRCD_XTRACE

lib/quantum_plugins/linuxbridge

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,9 @@ function has_quantum_plugin_security_group() {
8686
return 0
8787
}
8888

89+
function quantum_plugin_check_adv_test_requirements() {
90+
is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
91+
}
92+
8993
# Restore xtrace
9094
$MY_XTRACE

lib/quantum_plugins/nec

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,5 +118,9 @@ function has_quantum_plugin_security_group() {
118118
return 0
119119
}
120120

121+
function quantum_plugin_check_adv_test_requirements() {
122+
is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
123+
}
124+
121125
# Restore xtrace
122126
$MY_XTRACE

lib/quantum_plugins/nicira

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,5 +146,9 @@ function has_quantum_plugin_security_group() {
146146
return 0
147147
}
148148

149+
function quantum_plugin_check_adv_test_requirements() {
150+
is_service_enabled q-dhcp && return 0
151+
}
152+
149153
# Restore xtrace
150154
$MY_XTRACE

lib/quantum_plugins/openvswitch

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,5 +144,9 @@ function has_quantum_plugin_security_group() {
144144
return 0
145145
}
146146

147+
function quantum_plugin_check_adv_test_requirements() {
148+
is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
149+
}
150+
147151
# Restore xtrace
148152
$MY_XTRACE

lib/quantum_plugins/plumgrid

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,8 @@ function quantum_plugin_configure_debug_command() {
3535
:
3636
}
3737

38+
function quantum_plugin_check_adv_test_requirements() {
39+
is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
40+
}
3841
# Restore xtrace
3942
$MY_XTRACE

lib/quantum_plugins/ryu

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,9 @@ function has_quantum_plugin_security_group() {
7171
return 0
7272
}
7373

74+
function quantum_plugin_check_adv_test_requirements() {
75+
is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
76+
}
77+
7478
# Restore xtrace
7579
$MY_XTRACE

0 commit comments

Comments
 (0)