aboutsummaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-extended
diff options
context:
space:
mode:
authorVu Tran <vu.tran@windriver.com>2014-05-23 11:43:40 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2014-05-26 11:30:08 -0400
commit9d9f9d4a538a1d4d5d8c951db4be708d005f54b7 (patch)
treec1883ed7644c49caa242531091366a3dff2fb458 /meta-openstack/recipes-extended
parentd76df162be16d17a5318483602b2c59d7fef66ed (diff)
downloadmeta-cloud-services-9d9f9d4a538a1d4d5d8c951db4be708d005f54b7.tar.gz
meta-cloud-services-9d9f9d4a538a1d4d5d8c951db4be708d005f54b7.tar.bz2
meta-cloud-services-9d9f9d4a538a1d4d5d8c951db4be708d005f54b7.zip
tempest image client not specify version
Currently glance keystone endpoints URLs include "v2/" at the end (e.g. http://<glance server ip>:9292:v2/). This means glance should only be talked to using v2. For tempest image testcases, image_client.py gets URLs from keystones and appends additional version into these URL strings (e.g. htt://<glance server ip>:9292:v2/v2/images) which causes glance not to understand the command and return error: NotFound: Object not found Details: 404 Not Found The resource could not be found. In our case, we use the "v2" from URLs. We also disable v1 image testcases as it's not possible to test v1 with current glance endpoind URLs. Signed-off-by: Vu Tran <vu.tran@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-extended')
-rw-r--r--meta-openstack/recipes-extended/tempest/tempest/image-client-not-specify-version.patch107
-rw-r--r--meta-openstack/recipes-extended/tempest/tempest/tempest.conf2
-rw-r--r--meta-openstack/recipes-extended/tempest/tempest_git.bb1
3 files changed, 109 insertions, 1 deletions
diff --git a/meta-openstack/recipes-extended/tempest/tempest/image-client-not-specify-version.patch b/meta-openstack/recipes-extended/tempest/tempest/image-client-not-specify-version.patch
new file mode 100644
index 0000000..039a694
--- /dev/null
+++ b/meta-openstack/recipes-extended/tempest/tempest/image-client-not-specify-version.patch
@@ -0,0 +1,107 @@
+image client not specify version
+
+Currenlty glance keystone endpoints URLs include
+"v2/" at the end (e.g. http://<glance server ip>:9292:v2/).
+This means glance should only be talked to using v2.
+
+For tempest image testcases, image_client.py gets URLs
+from keystones and appends additional version into
+these URL strings (e.g. htt://<glance server ip>:9292:v2/v2/images)
+which causes glance not to understand the command and return error:
+
+NotFound: Object not found
+Details: 404 Not Found
+The resource could not be found.
+
+In our case, we use the "v2" from URLs.
+
+Signed-off-by: Vu Tran <vu.tran@windriver.com>
+
+diff --git a/tempest/api/image/base.py b/tempest/api/image/base.py
+index ab0cb00..b5568b9 100644
+--- a/tempest/api/image/base.py
++++ b/tempest/api/image/base.py
+@@ -92,6 +92,10 @@ class BaseV2ImageTest(BaseImageTest):
+ def setUpClass(cls):
+ super(BaseV2ImageTest, cls).setUpClass()
+ cls.client = cls.os.image_client_v2
++ # Currently Glance endpoint url from keystone
++ # does contain "v2" so in test we do not pass
++ # in version.
++ cls.client.desired_version = ''
+ if not cls.config.image_feature_enabled.api_v2:
+ msg = "Glance API v2 not supported"
+ raise cls.skipException(msg)
+diff --git a/tempest/services/image/v2/json/image_client.py b/tempest/services/image/v2/json/image_client.py
+index f0531ec..febe0c2 100644
+--- a/tempest/services/image/v2/json/image_client.py
++++ b/tempest/services/image/v2/json/image_client.py
+@@ -32,6 +32,7 @@ class ImageClientV2JSON(rest_client.RestClient):
+ auth_url, tenant_name)
+ self.service = self.config.images.catalog_type
+ self.http = self._get_http()
++ self.desired_version = 'v2/'
+
+ def _get_http(self):
+ token, endpoint = self.keystone_auth(self.user, self.password,
+@@ -42,13 +43,13 @@ class ImageClientV2JSON(rest_client.RestClient):
+ insecure=dscv)
+
+ def get_images_schema(self):
+- url = 'v2/schemas/images'
++ url = self.desired_version + 'schemas/images'
+ resp, body = self.get(url)
+ body = json.loads(body)
+ return resp, body
+
+ def get_image_schema(self):
+- url = 'v2/schemas/image'
++ url = self.desired_version + 'schemas/image'
+ resp, body = self.get(url)
+ body = json.loads(body)
+ return resp, body
+@@ -81,16 +82,16 @@ class ImageClientV2JSON(rest_client.RestClient):
+ data = json.dumps(params)
+ self._validate_schema(data)
+
+- resp, body = self.post('v2/images', data, self.headers)
++ resp, body = self.post(self.desired_version + 'images', data, self.headers)
+ body = json.loads(body)
+ return resp, body
+
+ def delete_image(self, image_id):
+- url = 'v2/images/%s' % image_id
++ url = self.desired_version + 'images/%s' % image_id
+ self.delete(url)
+
+ def image_list(self, params=None):
+- url = 'v2/images'
++ url = self.desired_version + 'images'
+
+ if params:
+ url += '?%s' % urllib.urlencode(params)
+@@ -101,7 +102,7 @@ class ImageClientV2JSON(rest_client.RestClient):
+ return resp, body['images']
+
+ def get_image_metadata(self, image_id):
+- url = 'v2/images/%s' % image_id
++ url = self.desired_version + 'images/%s' % image_id
+ resp, body = self.get(url)
+ body = json.loads(body)
+ return resp, body
+@@ -114,13 +115,13 @@ class ImageClientV2JSON(rest_client.RestClient):
+ return False
+
+ def store_image(self, image_id, data):
+- url = 'v2/images/%s/file' % image_id
++ url = self.desired_version + 'images/%s/file' % image_id
+ headers = {'Content-Type': 'application/octet-stream'}
+ resp, body = self.http.raw_request('PUT', url, headers=headers,
+ body=data)
+ return resp, body
+
+ def get_image_file(self, image_id):
+- url = 'v2/images/%s/file' % image_id
++ url = self.desired_version + 'images/%s/file' % image_id
+ resp, body = self.get(url)
+ return resp, body
diff --git a/meta-openstack/recipes-extended/tempest/tempest/tempest.conf b/meta-openstack/recipes-extended/tempest/tempest/tempest.conf
index e730983..7a5bf3b 100644
--- a/meta-openstack/recipes-extended/tempest/tempest/tempest.conf
+++ b/meta-openstack/recipes-extended/tempest/tempest/tempest.conf
@@ -202,7 +202,7 @@ http_image = http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-uec.tar.
[image-feature-enabled]
# Is the image api_v1 enabled
-api_v1 = True
+api_v1 = False
# Is the image api_v2 enabled
api_v2 = True
diff --git a/meta-openstack/recipes-extended/tempest/tempest_git.bb b/meta-openstack/recipes-extended/tempest/tempest_git.bb
index 10b772b..899d7e5 100644
--- a/meta-openstack/recipes-extended/tempest/tempest_git.bb
+++ b/meta-openstack/recipes-extended/tempest/tempest_git.bb
@@ -13,6 +13,7 @@ SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=master \
file://tempest.conf \
file://logging.conf \
file://0001-Stop-auto-detecting-glance-API-versions.patch \
+ file://image-client-not-specify-version.patch \
"
SRCREV="50af5d5ecc7d21d5e0d1a36fa564ef4850cf94ff"