Browse Source

Fix image_name retrieval in custom-image jobs

And use a 'file://' url for the custom manila image.

See also https://review.openstack.org/#/c/623330.  These
are interdependent patches but no harm is done by merging
this one first and having 623330 depend on it since retrieval
of the image name is not working correctly anyways.

Partial-Bug: #1807969

Change-Id: Ib3a74d170f159dfbc38b5302f00800f3530f4921
Tom Barron 4 months ago
parent
commit
6299ed5ed0

+ 4
- 0
contrib/ci/pre_test_hook.sh View File

@@ -168,6 +168,10 @@ elif [[ "$DRIVER" == "container"* ]]; then
168 168
 fi
169 169
 
170 170
 echo "MANILA_SERVICE_IMAGE_ENABLED=$MANILA_SERVICE_IMAGE_ENABLED" >> $localconf
171
+if [[ "$MANILA_SERVICE_IMAGE_ENABLED" == True ]]; then
172
+    echo "MANILA_SERVICE_IMAGE_URL=$MANILA_SERVICE_IMAGE_URL" >> $localconf
173
+    echo "MANILA_SERVICE_IMAGE_NAME=$MANILA_SERVICE_IMAGE_NAME" >> $localconf
174
+fi
171 175
 echo "MANILA_DEFAULT_SHARE_TYPE_EXTRA_SPECS=$DEFAULT_EXTRA_SPECS" >> $localconf
172 176
 echo "MANILA_CONFIGURE_DEFAULT_TYPES=${MANILA_CONFIGURE_DEFAULT_TYPES:-True}" >> $localconf
173 177
 

+ 11
- 15
playbooks/legacy/manila-tempest-dsvm-container-scenario-custom-image/run.yaml View File

@@ -47,9 +47,8 @@
47 47
           export DEVSTACK_PROJECT_FROM_GIT="python-manilaclient"
48 48
 
49 49
           # Install manila-image-elements project for building custom image
50
-          if [[ container_with_custom_image == *"_with_custom_image" ]]; then
51
-              export PROJECTS="openstack/manila-image-elements $PROJECTS"
52
-          fi
50
+          export PROJECTS="openstack/manila-image-elements $PROJECTS"
51
+
53 52
           export ENABLED_SERVICES=tempest
54 53
 
55 54
           # Keep localrc to be able to set some vars in pre_test_hook
@@ -57,20 +56,17 @@
57 56
           export PROJECTS="openstack/manila-tempest-plugin $PROJECTS"
58 57
 
59 58
           function pre_test_hook {
60
-              # Build custom image if needed
61
-              if [[ container_with_custom_image == *"_with_custom_image" ]]; then
62
-                  current_dir=$(pwd)
59
+              current_dir=$(pwd)
63 60
 
64
-                  # Go to 'manila-image-elements' dir, build image and get its name
65
-                  cd /opt/stack/new/manila-image-elements
66
-                  ./tools/gate/build-images container_with_custom_image True
67
-                  image_name=$(git ls-files --others --exclude-standard)
68
-                  export MANILA_SERVICE_IMAGE_URL="http://localhost:80/public_html/$image_name"
69
-                  export MANILA_SERVICE_IMAGE_NAME=$(basename -s .tar.gz $(basename -s .qcow2 $image_name))
61
+              # Go to 'manila-image-elements' dir, build image and get its name
62
+              cd /opt/stack/new/manila-image-elements
63
+              ./tools/gate/build-images container_with_custom_image
64
+              image_name=$(cat ./IMAGE_NAME)
65
+              export MANILA_SERVICE_IMAGE_URL="file://$(pwd)/$image_name"
66
+              export MANILA_SERVICE_IMAGE_NAME=$(basename -s .tar.gz $(basename -s .qcow2 $image_name))
70 67
 
71
-                  # Return back to execution dir
72
-                  cd $current_dir
73
-              fi
68
+              # Return back to execution dir
69
+              cd $current_dir
74 70
 
75 71
               # 'dhss' - acronym for 'Driver Handles Share Servers',
76 72
               # defines mode of a share driver. Boolean-like.

+ 0
- 19
playbooks/legacy/manila-tempest-dsvm-generic-no-share-servers/run.yaml View File

@@ -46,10 +46,6 @@
46 46
           export DEVSTACK_GATE_POSTGRES=0
47 47
           export DEVSTACK_PROJECT_FROM_GIT="python-manilaclient"
48 48
 
49
-          # Install manila-image-elements project for building custom image
50
-          if [[ generic == *"_with_custom_image" ]]; then
51
-              export PROJECTS="openstack/manila-image-elements $PROJECTS"
52
-          fi
53 49
           export ENABLED_SERVICES=tempest
54 50
 
55 51
           # Keep localrc to be able to set some vars in pre_test_hook
@@ -57,21 +53,6 @@
57 53
           export PROJECTS="openstack/manila-tempest-plugin $PROJECTS"
58 54
 
59 55
           function pre_test_hook {
60
-              # Build custom image if needed
61
-              if [[ generic == *"_with_custom_image" ]]; then
62
-                  current_dir=$(pwd)
63
-
64
-                  # Go to 'manila-image-elements' dir, build image and get its name
65
-                  cd /opt/stack/new/manila-image-elements
66
-                  ./tools/gate/build-images generic True
67
-                  image_name=$(git ls-files --others --exclude-standard)
68
-                  export MANILA_SERVICE_IMAGE_URL="http://localhost:80/public_html/$image_name"
69
-                  export MANILA_SERVICE_IMAGE_NAME=$(basename -s .tar.gz $(basename -s .qcow2 $image_name))
70
-
71
-                  # Return back to execution dir
72
-                  cd $current_dir
73
-              fi
74
-
75 56
               # 'dhss' - acronym for 'Driver Handles Share Servers',
76 57
               # defines mode of a share driver. Boolean-like.
77 58
               # 'driver' - codename of a share driver to configure.

+ 11
- 15
playbooks/legacy/manila-tempest-dsvm-generic-scenario-custom-image/run.yaml View File

@@ -47,9 +47,8 @@
47 47
           export DEVSTACK_PROJECT_FROM_GIT="python-manilaclient"
48 48
 
49 49
           # Install manila-image-elements project for building custom image
50
-          if [[ generic_with_custom_image == *"_with_custom_image" ]]; then
51
-              export PROJECTS="openstack/manila-image-elements $PROJECTS"
52
-          fi
50
+          export PROJECTS="openstack/manila-image-elements $PROJECTS"
51
+
53 52
           export ENABLED_SERVICES=tempest
54 53
 
55 54
           # Keep localrc to be able to set some vars in pre_test_hook
@@ -57,20 +56,17 @@
57 56
           export PROJECTS="openstack/manila-tempest-plugin $PROJECTS"
58 57
 
59 58
           function pre_test_hook {
60
-              # Build custom image if needed
61
-              if [[ generic_with_custom_image == *"_with_custom_image" ]]; then
62
-                  current_dir=$(pwd)
59
+              current_dir=$(pwd)
63 60
 
64
-                  # Go to 'manila-image-elements' dir, build image and get its name
65
-                  cd /opt/stack/new/manila-image-elements
66
-                  ./tools/gate/build-images generic_with_custom_image True
67
-                  image_name=$(git ls-files --others --exclude-standard)
68
-                  export MANILA_SERVICE_IMAGE_URL="http://localhost:80/public_html/$image_name"
69
-                  export MANILA_SERVICE_IMAGE_NAME=$(basename -s .tar.gz $(basename -s .qcow2 $image_name))
61
+              # Go to 'manila-image-elements' dir, build image and get its name
62
+              cd /opt/stack/new/manila-image-elements
63
+              ./tools/gate/build-images generic_with_custom_image
64
+              image_name=$(cat ./IMAGE_NAME)
65
+              export MANILA_SERVICE_IMAGE_URL="file://$(pwd)/$image_name"
66
+              export MANILA_SERVICE_IMAGE_NAME=$(basename -s .tar.gz $(basename -s .qcow2 $image_name))
70 67
 
71
-                  # Return back to execution dir
72
-                  cd $current_dir
73
-              fi
68
+              # Return back to execution dir
69
+              cd $current_dir
74 70
 
75 71
               # 'dhss' - acronym for 'Driver Handles Share Servers',
76 72
               # defines mode of a share driver. Boolean-like.

+ 0
- 19
playbooks/legacy/manila-tempest-dsvm-mysql-generic/run.yaml View File

@@ -45,10 +45,6 @@
45 45
           export DEVSTACK_GATE_POSTGRES=0
46 46
           export DEVSTACK_PROJECT_FROM_GIT="python-manilaclient"
47 47
 
48
-          # Install manila-image-elements project for building custom image
49
-          if [[ generic == *"_with_custom_image" ]]; then
50
-              export PROJECTS="openstack/manila-image-elements $PROJECTS"
51
-          fi
52 48
           export ENABLED_SERVICES=tempest
53 49
 
54 50
           # Keep localrc to be able to set some vars in pre_test_hook
@@ -56,21 +52,6 @@
56 52
           export PROJECTS="openstack/manila-tempest-plugin $PROJECTS"
57 53
 
58 54
           function pre_test_hook {
59
-              # Build custom image if needed
60
-              if [[ generic == *"_with_custom_image" ]]; then
61
-                  current_dir=$(pwd)
62
-
63
-                  # Go to 'manila-image-elements' dir, build image and get its name
64
-                  cd /opt/stack/new/manila-image-elements
65
-                  ./tools/gate/build-images generic True
66
-                  image_name=$(git ls-files --others --exclude-standard)
67
-                  export MANILA_SERVICE_IMAGE_URL="http://localhost:80/public_html/$image_name"
68
-                  export MANILA_SERVICE_IMAGE_NAME=$(basename -s .tar.gz $(basename -s .qcow2 $image_name))
69
-
70
-                  # Return back to execution dir
71
-                  cd $current_dir
72
-              fi
73
-
74 55
               # 'dhss' - acronym for 'Driver Handles Share Servers',
75 56
               # defines mode of a share driver. Boolean-like.
76 57
               # 'driver' - codename of a share driver to configure.

+ 0
- 19
playbooks/legacy/manila-tempest-dsvm-postgres-container/run.yaml View File

@@ -46,10 +46,6 @@
46 46
           export DEVSTACK_GATE_POSTGRES=1
47 47
           export DEVSTACK_PROJECT_FROM_GIT="python-manilaclient"
48 48
 
49
-          # Install manila-image-elements project for building custom image
50
-          if [[ container == *"_with_custom_image" ]]; then
51
-              export PROJECTS="openstack/manila-image-elements $PROJECTS"
52
-          fi
53 49
           export ENABLED_SERVICES=tempest
54 50
 
55 51
           # Keep localrc to be able to set some vars in pre_test_hook
@@ -57,21 +53,6 @@
57 53
           export PROJECTS="openstack/manila-tempest-plugin $PROJECTS"
58 54
 
59 55
           function pre_test_hook {
60
-              # Build custom image if needed
61
-              if [[ container == *"_with_custom_image" ]]; then
62
-                  current_dir=$(pwd)
63
-
64
-                  # Go to 'manila-image-elements' dir, build image and get its name
65
-                  cd /opt/stack/new/manila-image-elements
66
-                  ./tools/gate/build-images container True
67
-                  image_name=$(git ls-files --others --exclude-standard)
68
-                  export MANILA_SERVICE_IMAGE_URL="http://localhost:80/public_html/$image_name"
69
-                  export MANILA_SERVICE_IMAGE_NAME=$(basename -s .tar.gz $(basename -s .qcow2 $image_name))
70
-
71
-                  # Return back to execution dir
72
-                  cd $current_dir
73
-              fi
74
-
75 56
               # 'dhss' - acronym for 'Driver Handles Share Servers',
76 57
               # defines mode of a share driver. Boolean-like.
77 58
               # 'driver' - codename of a share driver to configure.

+ 0
- 19
playbooks/legacy/manila-tempest-dsvm-postgres-generic-singlebackend/run.yaml View File

@@ -46,10 +46,6 @@
46 46
           export DEVSTACK_GATE_POSTGRES=1
47 47
           export DEVSTACK_PROJECT_FROM_GIT="python-manilaclient"
48 48
 
49
-          # Install manila-image-elements project for building custom image
50
-          if [[ generic == *"_with_custom_image" ]]; then
51
-              export PROJECTS="openstack/manila-image-elements $PROJECTS"
52
-          fi
53 49
           export ENABLED_SERVICES=tempest
54 50
 
55 51
           # Keep localrc to be able to set some vars in pre_test_hook
@@ -57,21 +53,6 @@
57 53
           export PROJECTS="openstack/manila-tempest-plugin $PROJECTS"
58 54
 
59 55
           function pre_test_hook {
60
-              # Build custom image if needed
61
-              if [[ generic == *"_with_custom_image" ]]; then
62
-                  current_dir=$(pwd)
63
-
64
-                  # Go to 'manila-image-elements' dir, build image and get its name
65
-                  cd /opt/stack/new/manila-image-elements
66
-                  ./tools/gate/build-images generic True
67
-                  image_name=$(git ls-files --others --exclude-standard)
68
-                  export MANILA_SERVICE_IMAGE_URL="http://localhost:80/public_html/$image_name"
69
-                  export MANILA_SERVICE_IMAGE_NAME=$(basename -s .tar.gz $(basename -s .qcow2 $image_name))
70
-
71
-                  # Return back to execution dir
72
-                  cd $current_dir
73
-              fi
74
-
75 56
               # 'dhss' - acronym for 'Driver Handles Share Servers',
76 57
               # defines mode of a share driver. Boolean-like.
77 58
               # 'driver' - codename of a share driver to configure.

+ 0
- 19
playbooks/legacy/manila-tempest-dsvm-postgres-zfsonlinux/run.yaml View File

@@ -46,10 +46,6 @@
46 46
           export DEVSTACK_GATE_POSTGRES=1
47 47
           export DEVSTACK_PROJECT_FROM_GIT="python-manilaclient"
48 48
 
49
-          # Install manila-image-elements project for building custom image
50
-          if [[ zfsonlinux == *"_with_custom_image" ]]; then
51
-              export PROJECTS="openstack/manila-image-elements $PROJECTS"
52
-          fi
53 49
           export ENABLED_SERVICES=tempest
54 50
 
55 51
           # Keep localrc to be able to set some vars in pre_test_hook
@@ -57,21 +53,6 @@
57 53
           export PROJECTS="openstack/manila-tempest-plugin $PROJECTS"
58 54
 
59 55
           function pre_test_hook {
60
-              # Build custom image if needed
61
-              if [[ zfsonlinux == *"_with_custom_image" ]]; then
62
-                  current_dir=$(pwd)
63
-
64
-                  # Go to 'manila-image-elements' dir, build image and get its name
65
-                  cd /opt/stack/new/manila-image-elements
66
-                  ./tools/gate/build-images zfsonlinux True
67
-                  image_name=$(git ls-files --others --exclude-standard)
68
-                  export MANILA_SERVICE_IMAGE_URL="http://localhost:80/public_html/$image_name"
69
-                  export MANILA_SERVICE_IMAGE_NAME=$(basename -s .tar.gz $(basename -s .qcow2 $image_name))
70
-
71
-                  # Return back to execution dir
72
-                  cd $current_dir
73
-              fi
74
-
75 56
               # 'dhss' - acronym for 'Driver Handles Share Servers',
76 57
               # defines mode of a share driver. Boolean-like.
77 58
               # 'driver' - codename of a share driver to configure.

+ 0
- 19
playbooks/legacy/manila-tempest-dsvm-scenario/run.yaml View File

@@ -45,10 +45,6 @@
45 45
           export DEVSTACK_GATE_POSTGRES=0
46 46
           export DEVSTACK_PROJECT_FROM_GIT="python-manilaclient"
47 47
 
48
-          # Install manila-image-elements project for building custom image
49
-          if [[ generic == *"_with_custom_image" ]]; then
50
-              export PROJECTS="openstack/manila-image-elements $PROJECTS"
51
-          fi
52 48
           export ENABLED_SERVICES=tempest
53 49
 
54 50
           # Keep localrc to be able to set some vars in pre_test_hook
@@ -56,21 +52,6 @@
56 52
           export PROJECTS="openstack/manila-tempest-plugin $PROJECTS"
57 53
 
58 54
           function pre_test_hook {
59
-              # Build custom image if needed
60
-              if [[ generic == *"_with_custom_image" ]]; then
61
-                  current_dir=$(pwd)
62
-
63
-                  # Go to 'manila-image-elements' dir, build image and get its name
64
-                  cd /opt/stack/new/manila-image-elements
65
-                  ./tools/gate/build-images generic True
66
-                  image_name=$(git ls-files --others --exclude-standard)
67
-                  export MANILA_SERVICE_IMAGE_URL="http://localhost:80/public_html/$image_name"
68
-                  export MANILA_SERVICE_IMAGE_NAME=$(basename -s .tar.gz $(basename -s .qcow2 $image_name))
69
-
70
-                  # Return back to execution dir
71
-                  cd $current_dir
72
-              fi
73
-
74 55
               # 'dhss' - acronym for 'Driver Handles Share Servers',
75 56
               # defines mode of a share driver. Boolean-like.
76 57
               # 'driver' - codename of a share driver to configure.

Loading…
Cancel
Save