Browse Source

Fix devstack hooks for manila CI jobs

Replace not available anymore "JOB_NAME" env var with
"GLUSTERFS_MANILA_DRIVER_TYPE" one in devstack hooks to unblock
CI jobs.

Change-Id: Ice8395325d20060df511b9de82c944200ceea2aa
vponomaryov 2 years ago
parent
commit
d35a217dfb
2 changed files with 13 additions and 17 deletions
  1. 7
    9
      manila/post_test_hook.sh
  2. 6
    8
      manila/pre_test_hook.sh

+ 7
- 9
manila/post_test_hook.sh View File

@@ -23,9 +23,12 @@ sudo chmod -R o+rx $BASE/new/devstack/files
23 23
 # Import devstack functions 'iniset'
24 24
 source $BASE/new/devstack/functions
25 25
 
26
+# Import env vars defined in CI job.
27
+for env_var in ${DEVSTACK_LOCAL_CONFIG// / }; do
28
+    export $env_var;
29
+done
26 30
 
27
-
28
-if [[ "$JOB_NAME" =~ "glusterfs-native" ]]; then
31
+if [[ "$GLUSTERFS_MANILA_DRIVER_TYPE" == "glusterfs-native" ]]; then
29 32
     local BACKEND_NAME="GLUSTERNATIVE"
30 33
     iniset $TEMPEST_CONFIG share enable_protocols glusterfs
31 34
     iniset $TEMPEST_CONFIG share storage_protocol glusterfs
@@ -37,7 +40,7 @@ if [[ "$JOB_NAME" =~ "glusterfs-native" ]]; then
37 40
     # ro access_level is not supported by the driver.
38 41
     iniset $TEMPEST_CONFIG share enable_ro_access_level_for_protocols
39 42
 else
40
-    if [[ "$JOB_NAME" =~ "glusterfs-heketi" ]]; then
43
+    if [[ "$GLUSTERFS_MANILA_DRIVER_TYPE" == "glusterfs-heketi" ]]; then
41 44
         local BACKEND_NAME="GLUSTERFSHEKETI"
42 45
     else
43 46
         local BACKEND_NAME="GLUSTERFS"
@@ -94,15 +97,10 @@ cd $BASE/new/tempest
94 97
 export MANILA_TEMPEST_CONCURRENCY=${MANILA_TEMPEST_CONCURRENCY:-12}
95 98
 export MANILA_TESTS=${MANILA_TESTS:-'manila_tempest_tests.tests.api'}
96 99
 
97
-if [[ "$JOB_NAME" =~ "scenario" ]]; then
98
-    echo "Set test set to scenario only"
99
-    MANILA_TESTS='manila_tempest_tests.tests.scenario'
100
-fi
101
-
102 100
 # check if tempest plugin was installed correctly
103 101
 echo 'import pkg_resources; print list(pkg_resources.iter_entry_points("tempest.test_plugins"))' | python
104 102
 
105
-# Workaround for Tempest architectural changes
103
+# Workaround for Tempest architectural changes (only for Liberty and lower releases)
106 104
 # See bugs:
107 105
 # 1) https://bugs.launchpad.net/manila/+bug/1531049
108 106
 # 2) https://bugs.launchpad.net/tempest/+bug/1524717

+ 6
- 8
manila/pre_test_hook.sh View File

@@ -20,21 +20,19 @@ echo "API_RATE_LIMIT=False" >> $localrc_path
20 20
 echo "TEMPEST_SERVICES+=,manila" >> $localrc_path
21 21
 
22 22
 echo "MANILA_USE_DOWNGRADE_MIGRATIONS=True" >> $localrc_path
23
+echo "MANILA_MULTI_BACKEND=False" >> $localrc_path
23 24
 
24
-# JOB_NAME is defined in openstack-infra/config project
25
-# used by CI/CD, where this script is intended to be used.
26
-if [[ "$JOB_NAME" =~ "multibackend" ]]; then
27
-    echo "MANILA_MULTI_BACKEND=True" >> $localrc_path
28
-else
29
-    echo "MANILA_MULTI_BACKEND=False" >> $localrc_path
30
-fi
25
+# Import env vars defined in CI job.
26
+for env_var in ${DEVSTACK_LOCAL_CONFIG// / }; do
27
+    export $env_var;
28
+done
31 29
 
32 30
 # If the job tests glusterfs (NFS) driver, then create default share_type with
33 31
 # extra_spec snapshot_support as False. Becasuse the job that tests the
34 32
 # glusterfs (NFS) driver tests the directory based layout that doesn't support
35 33
 # snapshots. The job that tests glusterfs (NFS) driver has a name that
36 34
 # ends with "glusterfs".
37
-if [[ $JOB_NAME =~ manila-tempest-dsvm-glusterfs$ ]]; then
35
+if [[ "$GLUSTERFS_MANILA_DRIVER_TYPE" == "glusterfs" ]]; then
38 36
     echo "MANILA_DEFAULT_SHARE_TYPE_EXTRA_SPECS='snapshot_support=False'" >> $localrc_path
39 37
 fi
40 38
 

Loading…
Cancel
Save