Improve quantum l3 and tempest config.
* Previously, configuration for the q-l3 agent was creating a
tenant-owned router. This change maintains that behaviour if
namespaces are enabled, but creates a public (not tenant-owned)
router if namespaces are disabled. Since the L3 agent can only
manage a single router if namespaces are disabled, the change
ensures that the single router can be shared by multiple tenants.
* Add tempest configuration for the public router.
Change-Id: I2878a7eb9797bfd71082a55d4773519dc5198abc
diff --git a/lib/quantum b/lib/quantum
index 343e5a9..9c06f45 100644
--- a/lib/quantum
+++ b/lib/quantum
@@ -92,6 +92,8 @@
Q_ALLOW_OVERLAPPING_IP=${Q_ALLOW_OVERLAPPING_IP:-False}
# Use quantum-debug command
Q_USE_DEBUG_COMMAND=${Q_USE_DEBUG_COMMAND:-False}
+# The name of the default q-l3 router
+Q_ROUTER_NAME=${Q_ROUTER_NAME:-router1}
if is_service_enabled quantum; then
Q_RR_CONF_FILE=$QUANTUM_CONF_DIR/rootwrap.conf
@@ -277,7 +279,14 @@
if is_service_enabled q-l3; then
# Create a router, and add the private subnet as one of its interfaces
- ROUTER_ID=$(quantum router-create --tenant_id $TENANT_ID router1 | grep ' id ' | get_field 2)
+ if [[ "$Q_USE_NAMESPACE" == "True" ]]; then
+ # If namespaces are enabled, create a tenant-owned router.
+ ROUTER_ID=$(quantum router-create --tenant_id $TENANT_ID $Q_ROUTER_NAME | grep ' id ' | get_field 2)
+ else
+ # If namespaces are disabled, the L3 agent can only target
+ # a single router, which should not be tenant-owned.
+ ROUTER_ID=$(quantum router-create $Q_ROUTER_NAME | grep ' id ' | get_field 2)
+ fi
quantum router-interface-add $ROUTER_ID $SUBNET_ID
# Create an external network, and a subnet. Configure the external network as router gw
EXT_NET_ID=$(quantum net-create "$PUBLIC_NETWORK_NAME" -- --router:external=True | grep ' id ' | get_field 2)