Browse code

Fix up tempest conf settings

The tempest api.volume.test_volume_types test won't
work with non-default drivers configured for cinder's backend
any more. The reason is that we create a type using capability
scheduler keywords in the extra-specs for the test;
(vendor_name and storage_protocol). The result is the extra-spec
uses the filters: "vendor_name=Open Source" and
"storage_protocol=iSCSI", but for example if you have another backend
say SolidFire, EMC, NetApp, IBM etc the capabilities filter will fail
the create with a "No valid host available".

This is intended to work by simply setting these values in your
tempest.conf file. That's fine, however upon setting this up
in my localrc I found that the tempest config variables being
set via devtsack were never picked up

Currently devstack doesn't use the same variable names for
configuration variables as tempest expects. Devstack is using
the variable "TEMPEST_CONF" however the Tempest project is
expecting the variable "TEMPEST_CONFIG", so currently the
devstack lib/tempest rc variables are never picked up by
tempest properly.

This change modifes devstack's naming of TEMPEST_CONF, my though
being that since this doesn't work in devstack currently
that changing it here would be better than changing it in Tempest
where it's possible people had their own custoizations already
outside of devstack.

In addition this change creates rc variables in devstack to actually
set these via devstack. The idea here is that Cinder 3'rd party testing
needs to be a simple devstack config and run stack.sh. By fixing up
the configuration file variable naming and adding the variables for
the vendor and protocol settings that's now possible.

An example localrc for a custom config is shown below. The example
sets the tempest config file to /etc/tempest/tempest.conf, and
configures tempest to use the SolidFire driver as the cinder backend.

TEMPEST_VOLUME_VENDOR ==> tempest.conf.volume_vendor
TEMPEST_STORAGE_PROTOCOL ==> tempest.conf.storage_protocol

relevant example localrc entries:
TEMPEST_CONFIG=/etc/tempest/tempest.conf
TEMPEST_CONFIG_DIR=/etc/tempest
TEMPEST_VOLUME_DRIVER=solidfire
TEMPEST_VOLUME_VENDOR="SolidFire Inc"

***NOTE***
storage_protocol and vendor_name MUST match what the backend device reports from
get capabilities.

Change-Id: I28dfa90c877b27f5d4919f2748fae092bb2f87fa
Closes-Bug: 1271781

john-griffith authored on 2014/01/23 10:09:32
Showing 1 changed files
... ...
@@ -46,8 +46,8 @@ set +o xtrace
46 46
 
47 47
 # Set up default directories
48 48
 TEMPEST_DIR=$DEST/tempest
49
-TEMPEST_CONF_DIR=$TEMPEST_DIR/etc
50
-TEMPEST_CONF=$TEMPEST_CONF_DIR/tempest.conf
49
+TEMPEST_CONFIG_DIR=${TEMPEST_CONFIG_DIR:-$TEMPEST_DIR/etc}
50
+TEMPEST_CONFIG=$TEMPEST_CONFIG_DIR/tempest.conf
51 51
 TEMPEST_STATE_PATH=${TEMPEST_STATE_PATH:=$DATA_DIR/tempest}
52 52
 
53 53
 NOVA_SOURCE_DIR=$DEST/nova
... ...
@@ -58,6 +58,10 @@ BUILD_TIMEOUT=196
58 58
 
59 59
 BOTO_MATERIALS_PATH="$FILES/images/s3-materials/cirros-0.3.1"
60 60
 
61
+# Cinder/Volume variables
62
+TEMPEST_VOLUME_DRIVER=${TEMPEST_VOLUME_DRIVER:-default}
63
+TEMPEST_VOLUME_VENDOR=${TEMPEST_VOLUME_VENDOR:-"Open Source"}
64
+TEMPEST_STORAGE_PROTOCOL=${TEMPEST_STORAGE_PROTOCOL:-iSCSI}
61 65
 
62 66
 # Functions
63 67
 # ---------
... ...
@@ -83,6 +87,11 @@ function configure_tempest() {
83 83
     local boto_instance_type="m1.tiny"
84 84
     local ssh_connect_method="fixed"
85 85
 
86
+    if [[ ! -d $TEMPEST_CONFIG_DIR ]]; then
87
+        sudo mkdir -p $TEMPEST_CONFIG_DIR
88
+    fi
89
+    sudo chown $STACK_USER $TEMPEST_CONFIG_DIR
90
+
86 91
     # TODO(afazekas):
87 92
     # sudo python setup.py deploy
88 93
 
... ...
@@ -133,7 +142,8 @@ function configure_tempest() {
133 133
 
134 134
     # Create tempest.conf from tempest.conf.sample
135 135
     # copy every time, because the image UUIDS are going to change
136
-    cp $TEMPEST_CONF.sample $TEMPEST_CONF
136
+    sudo cp $TEMPEST_DIR/etc/tempest.conf.sample $TEMPEST_CONFIG
137
+    sudo chmod 644 $TEMPEST_CONFIG
137 138
 
138 139
     password=${ADMIN_PASSWORD:-secrete}
139 140
 
... ...
@@ -224,121 +234,126 @@ function configure_tempest() {
224 224
     fi
225 225
 
226 226
     # Oslo
227
-    iniset $TEMPEST_CONF DEFAULT lock_path $TEMPEST_STATE_PATH
227
+    iniset $TEMPEST_CONFIG DEFAULT lock_path $TEMPEST_STATE_PATH
228 228
     mkdir -p $TEMPEST_STATE_PATH
229
-    iniset $TEMPEST_CONF DEFAULT use_stderr False
230
-    iniset $TEMPEST_CONF DEFAULT log_file tempest.log
231
-    iniset $TEMPEST_CONF DEFAULT debug True
229
+    iniset $TEMPEST_CONFIG DEFAULT use_stderr False
230
+    iniset $TEMPEST_CONFIG DEFAULT log_file tempest.log
231
+    iniset $TEMPEST_CONFIG DEFAULT debug True
232 232
 
233 233
     # Timeouts
234
-    iniset $TEMPEST_CONF compute build_timeout $BUILD_TIMEOUT
235
-    iniset $TEMPEST_CONF volume build_timeout $BUILD_TIMEOUT
236
-    iniset $TEMPEST_CONF boto build_timeout $BUILD_TIMEOUT
237
-    iniset $TEMPEST_CONF compute build_interval $BUILD_INTERVAL
238
-    iniset $TEMPEST_CONF volume build_interval $BUILD_INTERVAL
239
-    iniset $TEMPEST_CONF boto build_interval $BUILD_INTERVAL
240
-    iniset $TEMPEST_CONF boto http_socket_timeout 5
234
+    iniset $TEMPEST_CONFIG compute build_timeout $BUILD_TIMEOUT
235
+    iniset $TEMPEST_CONFIG volume build_timeout $BUILD_TIMEOUT
236
+    iniset $TEMPEST_CONFIG boto build_timeout $BUILD_TIMEOUT
237
+    iniset $TEMPEST_CONFIG compute build_interval $BUILD_INTERVAL
238
+    iniset $TEMPEST_CONFIG volume build_interval $BUILD_INTERVAL
239
+    iniset $TEMPEST_CONFIG boto build_interval $BUILD_INTERVAL
240
+    iniset $TEMPEST_CONFIG boto http_socket_timeout 5
241 241
 
242 242
     # Identity
243
-    iniset $TEMPEST_CONF identity uri "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:5000/v2.0/"
244
-    iniset $TEMPEST_CONF identity password "$password"
245
-    iniset $TEMPEST_CONF identity alt_username $ALT_USERNAME
246
-    iniset $TEMPEST_CONF identity alt_password "$password"
247
-    iniset $TEMPEST_CONF identity alt_tenant_name $ALT_TENANT_NAME
248
-    iniset $TEMPEST_CONF identity admin_password "$password"
243
+    iniset $TEMPEST_CONFIG identity uri "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:5000/v2.0/"
244
+    iniset $TEMPEST_CONFIG identity password "$password"
245
+    iniset $TEMPEST_CONFIG identity alt_username $ALT_USERNAME
246
+    iniset $TEMPEST_CONFIG identity alt_password "$password"
247
+    iniset $TEMPEST_CONFIG identity alt_tenant_name $ALT_TENANT_NAME
248
+    iniset $TEMPEST_CONFIG identity admin_password "$password"
249 249
 
250 250
     # Image
251 251
     # for the gate we want to be able to override this variable so we aren't
252 252
     # doing an HTTP fetch over the wide internet for this test
253 253
     if [[ ! -z "$TEMPEST_HTTP_IMAGE" ]]; then
254
-        iniset $TEMPEST_CONF image http_image $TEMPEST_HTTP_IMAGE
254
+        iniset $TEMPEST_CONFIG image http_image $TEMPEST_HTTP_IMAGE
255 255
     fi
256 256
 
257 257
     # Compute
258
-    iniset $TEMPEST_CONF compute change_password_available False
258
+    iniset $TEMPEST_CONFIG compute change_password_available False
259 259
     # Note(nati) current tempest don't create network for each tenant
260 260
     # so reuse same tenant for now
261 261
     if is_service_enabled neutron; then
262 262
         TEMPEST_ALLOW_TENANT_ISOLATION=${TEMPEST_ALLOW_TENANT_ISOLATION:-False}
263 263
     fi
264
-    iniset $TEMPEST_CONF compute allow_tenant_isolation ${TEMPEST_ALLOW_TENANT_ISOLATION:-True}
265
-    iniset $TEMPEST_CONF compute ssh_user ${DEFAULT_INSTANCE_USER:-cirros} # DEPRECATED
266
-    iniset $TEMPEST_CONF compute network_for_ssh $PRIVATE_NETWORK_NAME
267
-    iniset $TEMPEST_CONF compute ip_version_for_ssh 4
268
-    iniset $TEMPEST_CONF compute ssh_timeout $BUILD_TIMEOUT
269
-    iniset $TEMPEST_CONF compute image_ref $image_uuid
270
-    iniset $TEMPEST_CONF compute image_ssh_user ${DEFAULT_INSTANCE_USER:-cirros}
271
-    iniset $TEMPEST_CONF compute image_ref_alt $image_uuid_alt
272
-    iniset $TEMPEST_CONF compute image_alt_ssh_user ${DEFAULT_INSTANCE_USER:-cirros}
273
-    iniset $TEMPEST_CONF compute flavor_ref $flavor_ref
274
-    iniset $TEMPEST_CONF compute flavor_ref_alt $flavor_ref_alt
275
-    iniset $TEMPEST_CONF compute live_migration_available ${LIVE_MIGRATION_AVAILABLE:-False}
276
-    iniset $TEMPEST_CONF compute use_block_migration_for_live_migration ${USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION:-False}
277
-    iniset $TEMPEST_CONF compute ssh_connect_method $ssh_connect_method
264
+    iniset $TEMPEST_CONFIG compute allow_tenant_isolation ${TEMPEST_ALLOW_TENANT_ISOLATION:-True}
265
+    iniset $TEMPEST_CONFIG compute ssh_user ${DEFAULT_INSTANCE_USER:-cirros} # DEPRECATED
266
+    iniset $TEMPEST_CONFIG compute network_for_ssh $PRIVATE_NETWORK_NAME
267
+    iniset $TEMPEST_CONFIG compute ip_version_for_ssh 4
268
+    iniset $TEMPEST_CONFIG compute ssh_timeout $BUILD_TIMEOUT
269
+    iniset $TEMPEST_CONFIG compute image_ref $image_uuid
270
+    iniset $TEMPEST_CONFIG compute image_ssh_user ${DEFAULT_INSTANCE_USER:-cirros}
271
+    iniset $TEMPEST_CONFIG compute image_ref_alt $image_uuid_alt
272
+    iniset $TEMPEST_CONFIG compute image_alt_ssh_user ${DEFAULT_INSTANCE_USER:-cirros}
273
+    iniset $TEMPEST_CONFIG compute flavor_ref $flavor_ref
274
+    iniset $TEMPEST_CONFIG compute flavor_ref_alt $flavor_ref_alt
275
+    iniset $TEMPEST_CONFIG compute live_migration_available ${LIVE_MIGRATION_AVAILABLE:-False}
276
+    iniset $TEMPEST_CONFIG compute use_block_migration_for_live_migration ${USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION:-False}
277
+    iniset $TEMPEST_CONFIG compute ssh_connect_method $ssh_connect_method
278 278
 
279 279
     # Compute admin
280
-    iniset $TEMPEST_CONF "compute-admin" password "$password" # DEPRECATED
280
+    iniset $TEMPEST_CONFIG "compute-admin" password "$password" # DEPRECATED
281 281
 
282
-    iniset $TEMPEST_CONF network api_version 2.0
283
-    iniset $TEMPEST_CONF network tenant_networks_reachable "$tenant_networks_reachable"
284
-    iniset $TEMPEST_CONF network public_network_id "$public_network_id"
285
-    iniset $TEMPEST_CONF network public_router_id "$public_router_id"
286
-    iniset $TEMPEST_CONF network default_network "$FIXED_RANGE"
282
+    iniset $TEMPEST_CONFIG network api_version 2.0
283
+    iniset $TEMPEST_CONFIG network tenant_networks_reachable "$tenant_networks_reachable"
284
+    iniset $TEMPEST_CONFIG network public_network_id "$public_network_id"
285
+    iniset $TEMPEST_CONFIG network public_router_id "$public_router_id"
286
+    iniset $TEMPEST_CONFIG network default_network "$FIXED_RANGE"
287 287
 
288 288
     # boto
289
-    iniset $TEMPEST_CONF boto ec2_url "http://$SERVICE_HOST:8773/services/Cloud"
290
-    iniset $TEMPEST_CONF boto s3_url "http://$SERVICE_HOST:${S3_SERVICE_PORT:-3333}"
291
-    iniset $TEMPEST_CONF boto s3_materials_path "$BOTO_MATERIALS_PATH"
292
-    iniset $TEMPEST_CONF boto instance_type "$boto_instance_type"
293
-    iniset $TEMPEST_CONF boto http_socket_timeout 30
294
-    iniset $TEMPEST_CONF boto ssh_user ${DEFAULT_INSTANCE_USER:-cirros}
289
+    iniset $TEMPEST_CONFIG boto ec2_url "http://$SERVICE_HOST:8773/services/Cloud"
290
+    iniset $TEMPEST_CONFIG boto s3_url "http://$SERVICE_HOST:${S3_SERVICE_PORT:-3333}"
291
+    iniset $TEMPEST_CONFIG boto s3_materials_path "$BOTO_MATERIALS_PATH"
292
+    iniset $TEMPEST_CONFIG boto instance_type "$boto_instance_type"
293
+    iniset $TEMPEST_CONFIG boto http_socket_timeout 30
294
+    iniset $TEMPEST_CONFIG boto ssh_user ${DEFAULT_INSTANCE_USER:-cirros}
295 295
 
296 296
     # Orchestration test image
297 297
     if [[ ! -z "$HEAT_FETCHED_TEST_IMAGE" ]]; then
298
-        iniset $TEMPEST_CONF orchestration image_ref "$HEAT_FETCHED_TEST_IMAGE"
298
+        iniset $TEMPEST_CONFIG orchestration image_ref "$HEAT_FETCHED_TEST_IMAGE"
299 299
     elif [[ "$HEAT_CREATE_TEST_IMAGE" = "True" ]]; then
300 300
         disk_image_create /usr/share/tripleo-image-elements "vm fedora heat-cfntools" "i386" "fedora-vm-heat-cfntools-tempest"
301
-        iniset $TEMPEST_CONF orchestration image_ref "fedora-vm-heat-cfntools-tempest"
301
+        iniset $TEMPEST_CONFIG orchestration image_ref "fedora-vm-heat-cfntools-tempest"
302 302
     fi
303 303
 
304 304
     # Scenario
305
-    iniset $TEMPEST_CONF scenario img_dir "$FILES/images/cirros-0.3.1-x86_64-uec"
305
+    iniset $TEMPEST_CONFIG scenario img_dir "$FILES/images/cirros-0.3.1-x86_64-uec"
306 306
 
307 307
     # Large Ops Number
308
-    iniset $TEMPEST_CONF scenario large_ops_number ${TEMPEST_LARGE_OPS_NUMBER:-0}
308
+    iniset $TEMPEST_CONFIG scenario large_ops_number ${TEMPEST_LARGE_OPS_NUMBER:-0}
309 309
 
310 310
     # Volume
311 311
     if is_service_enabled c-bak; then
312
-        iniset $TEMPEST_CONF volume volume_backup_enabled "True"
312
+        iniset $TEMPEST_CONFIG volume volume_backup_enabled "True"
313 313
     fi
314 314
     CINDER_MULTI_LVM_BACKEND=$(trueorfalse False $CINDER_MULTI_LVM_BACKEND)
315 315
     if [ $CINDER_MULTI_LVM_BACKEND == "True" ]; then
316
-        iniset $TEMPEST_CONF volume multi_backend_enabled "True"
317
-        iniset $TEMPEST_CONF volume backend1_name "LVM_iSCSI"
318
-        iniset $TEMPEST_CONF volume backend2_name "LVM_iSCSI_2"
316
+        iniset $TEMPEST_CONFIG volume multi_backend_enabled "True"
317
+        iniset $TEMPEST_CONFIG volume backend1_name "LVM_iSCSI"
318
+        iniset $TEMPEST_CONFIG volume backend2_name "LVM_iSCSI_2"
319
+    fi
320
+
321
+    if [ $TEMPEST_VOLUME_DRIVER != "default" ]; then
322
+        iniset $TEMPEST_CONFIG volume vendor_name $TEMPEST_VOLUME_VENDOR
323
+        iniset $TEMPEST_CONFIG volume storage_protocol $TEMPEST_STORAGE_PROTOCOL
319 324
     fi
320 325
 
321 326
     # Dashboard
322
-    iniset $TEMPEST_CONF dashboard dashboard_url "http://$SERVICE_HOST/"
323
-    iniset $TEMPEST_CONF dashboard login_url "http://$SERVICE_HOST/auth/login/"
327
+    iniset $TEMPEST_CONFIG dashboard dashboard_url "http://$SERVICE_HOST/"
328
+    iniset $TEMPEST_CONFIG dashboard login_url "http://$SERVICE_HOST/auth/login/"
324 329
 
325 330
     # cli
326
-    iniset $TEMPEST_CONF cli cli_dir $NOVA_BIN_DIR
331
+    iniset $TEMPEST_CONFIG cli cli_dir $NOVA_BIN_DIR
327 332
 
328 333
     # Networking
329
-    iniset $TEMPEST_CONF network-feature-enabled api_extensions "${NETWORK_API_EXTENSIONS:-all}"
334
+    iniset $TEMPEST_CONFIG network-feature-enabled api_extensions "${NETWORK_API_EXTENSIONS:-all}"
330 335
 
331 336
     # service_available
332 337
     for service in nova cinder glance neutron swift heat horizon ceilometer ironic savanna trove marconi; do
333 338
         if is_service_enabled $service ; then
334
-            iniset $TEMPEST_CONF service_available $service "True"
339
+            iniset $TEMPEST_CONFIG service_available $service "True"
335 340
         else
336
-            iniset $TEMPEST_CONF service_available $service "False"
341
+            iniset $TEMPEST_CONFIG service_available $service "False"
337 342
         fi
338 343
     done
339 344
 
340 345
     echo "Created tempest configuration file:"
341
-    cat $TEMPEST_CONF
346
+    cat $TEMPEST_CONFIG
342 347
 
343 348
     # Restore IFS
344 349
     IFS=$ifs