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: I149d8e4e8fac6aa5c496b8f186aa0afb28bf81c2
Closes-Bug: #1269090
(cherry picked from commit 52a7b6ecbad11c08dcd77a6fcd8bfef6a20324a9)

Jakub Libosvar authored on 2014/01/15 02:52:51
Showing 1 changed files
... ...
@@ -179,6 +179,14 @@ function confirm_server_active {
179 179
     fi
180 180
 }
181 181
 
182
+function neutron_debug_admin {
183
+    local os_username=$OS_USERNAME
184
+    local os_tenant_id=$OS_TENANT_ID
185
+    source $TOP_DIR/openrc admin admin
186
+    neutron-debug $@
187
+    source $TOP_DIR/openrc $os_username $os_tenant_id
188
+}
189
+
182 190
 function add_tenant {
183 191
     local TENANT=$1
184 192
     local USER=$2
... ...
@@ -234,7 +242,7 @@ function create_network {
234 234
     source $TOP_DIR/openrc $TENANT $TENANT
235 235
     local NET_ID=$(neutron net-create --tenant_id $TENANT_ID $NET_NAME $EXTRA| grep ' id ' | awk '{print $4}' )
236 236
     neutron subnet-create --ip_version 4 --tenant_id $TENANT_ID --gateway $GATEWAY $NET_ID $CIDR
237
-    neutron-debug probe-create --device-owner compute $NET_ID
237
+    neutron_debug_admin probe-create --device-owner compute $NET_ID
238 238
     source $TOP_DIR/openrc demo demo
239 239
 }
240 240