Browse code

Run neutron-debug with admin tenant in neutron-adv-test

Because neutron-debug create-probe needs admin role only, demo tenants
cannot create ports. neutron-debug is wrapped in order to run it only
with admin tenant.

Change-Id: Ib65e8639858c597345c6a5fdc0192b40f34a0300
Closes-Bug: #1269090

Jakub Libosvar authored on 2014/01/15 02:52:51
Showing 1 changed files
... ...
@@ -185,6 +185,14 @@ function confirm_server_active {
185 185
     fi
186 186
 }
187 187
 
188
+function neutron_debug_admin {
189
+    local os_username=$OS_USERNAME
190
+    local os_tenant_id=$OS_TENANT_ID
191
+    source $TOP_DIR/openrc admin admin
192
+    neutron-debug $@
193
+    source $TOP_DIR/openrc $os_username $os_tenant_id
194
+}
195
+
188 196
 function add_tenant {
189 197
     local TENANT=$1
190 198
     local USER=$2
... ...
@@ -241,7 +249,7 @@ function create_network {
241 241
     local NET_ID=$(neutron net-create --tenant-id $TENANT_ID $NET_NAME $EXTRA| grep ' id ' | awk '{print $4}' )
242 242
     die_if_not_set $LINENO NET_ID "Failure creating NET_ID for $TENANT_ID $NET_NAME $EXTRA"
243 243
     neutron subnet-create --ip-version 4 --tenant-id $TENANT_ID --gateway $GATEWAY $NET_ID $CIDR
244
-    neutron-debug probe-create --device-owner compute $NET_ID
244
+    neutron_debug_admin probe-create --device-owner compute $NET_ID
245 245
     source $TOP_DIR/openrc demo demo
246 246
 }
247 247