Apply Accept-custom-registered-endpoints 56/69856/1
authorCédric Ollivier <cedric.ollivier@orange.com>
Sun, 29 Mar 2020 11:59:04 +0000 (13:59 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Sun, 29 Mar 2020 13:25:21 +0000 (15:25 +0200)
This patch is needed to verify Ceph RadosGW and then has to be
backported to Hunter (CNTT).

Tempest maybe simply updated in a few branches (Jerma, Iruya?)
depending on the side effects.

Updating Tempest in Hunter would ask for an deep update of CNTT RC.

https://github.com/openstack/tempest/commit/1d500e79156ada6bc6fdb628ed1da0efd4121f6a

Change-Id: I5cbe6374cc5cb9d4cae92ae390f5ab63f301e4cb
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
(cherry picked from commit 719985c55d51fd7093753ae61de2328ea0543367)

docker/smoke/Dockerfile
docker/tempest/Accept-custom-registered-endpoints.patch [new file with mode: 0644]
docker/tempest/Dockerfile

index 580da5d..c02e57a 100644 (file)
@@ -15,7 +15,7 @@ RUN apk --no-cache add --update libxml2 libxslt libpcre16 libpcre32 && \
         python-dev build-base linux-headers libffi-dev \
         openssl-dev libjpeg-turbo-dev libxml2-dev libxslt-dev pcre-dev && \
     wget -q -O- https://opendev.org/openstack/requirements/raw/branch/$OPENSTACK_TAG/upper-constraints.txt > upper-constraints.txt && \
-    sed -i -E s/^tempest==+.*$/-e\ git+https:\\/\\/opendev.org\\/openstack\\/tempest@$TEMPEST_TAG#egg=tempest/ upper-constraints.txt && \
+    sed -i -E /^tempest==+.*$/d upper-constraints.txt && \
     case $(uname -m) in aarch*|arm*) sed -i -E /^PyNaCl=/d upper-constraints.txt ;; esac && \
     wget -q -O- https://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH > upper-constraints.opnfv.txt && \
     sed -i -E /#egg=functest/d upper-constraints.opnfv.txt && \
diff --git a/docker/tempest/Accept-custom-registered-endpoints.patch b/docker/tempest/Accept-custom-registered-endpoints.patch
new file mode 100644 (file)
index 0000000..eba6ff4
--- /dev/null
@@ -0,0 +1,99 @@
+From 1d500e79156ada6bc6fdb628ed1da0efd4121f6a Mon Sep 17 00:00:00 2001
+From: Martin Kopec <mkopec@redhat.com>
+Date: Thu, 31 Oct 2019 13:56:42 +0000
+Subject: [PATCH 13/46] Accept custom registered endpoints
+
+The review drops usage of skip_path() filter in the related tests
+and uses raw_request() instead.
+
+Normally a swift url is organised as host:port/info and
+host:port/v1/AUTH_<tenant-id>, see
+https://docs.openstack.org/api-ref/object-store/
+But RadosGW API is organised as host:port/swift/info and
+host:port/swift/v1/AUTH_<tenant-id>, see
+https://docs.ceph.com/docs/master/radosgw/config-ref/#swift-settings
+
+Close-bug: 1799981
+Change-Id: I6a932639a05defe0f04c600afcc35a19662937af
+---
+ tempest/api/object_storage/test_crossdomain.py             | 7 +++----
+ tempest/api/object_storage/test_healthcheck.py             | 7 +++----
+ tempest/lib/services/object_storage/capabilities_client.py | 5 +++--
+ .../services/object_storage/test_capabilities_client.py    | 2 +-
+ 4 files changed, 10 insertions(+), 11 deletions(-)
+
+diff --git a/tempest/api/object_storage/test_crossdomain.py b/tempest/api/object_storage/test_crossdomain.py
+index f61d9f891..1567e0640 100644
+--- a/tempest/api/object_storage/test_crossdomain.py
++++ b/tempest/api/object_storage/test_crossdomain.py
+@@ -34,13 +34,12 @@ class CrossdomainTest(base.BaseObjectTest):
+     def setUp(self):
+         super(CrossdomainTest, self).setUp()
+-        # Turning http://.../v1/foobar into http://.../
+-        self.account_client.skip_path()
+-
+     @decorators.idempotent_id('d1b8b031-b622-4010-82f9-ff78a9e915c7')
+     @utils.requires_ext(extension='crossdomain', service='object')
+     def test_get_crossdomain_policy(self):
+-        resp, body = self.account_client.get("crossdomain.xml", {})
++        url = self.account_client._get_base_version_url() + "crossdomain.xml"
++        resp, body = self.account_client.raw_request(url, "GET")
++        self.account_client._error_checker(resp, body)
+         body = body.decode()
+         self.assertTrue(body.startswith(self.xml_start) and
+diff --git a/tempest/api/object_storage/test_healthcheck.py b/tempest/api/object_storage/test_healthcheck.py
+index a186f9ee6..8e9e4061d 100644
+--- a/tempest/api/object_storage/test_healthcheck.py
++++ b/tempest/api/object_storage/test_healthcheck.py
+@@ -22,13 +22,12 @@ class HealthcheckTest(base.BaseObjectTest):
+     def setUp(self):
+         super(HealthcheckTest, self).setUp()
+-        # Turning http://.../v1/foobar into http://.../
+-        self.account_client.skip_path()
+     @decorators.idempotent_id('db5723b1-f25c-49a9-bfeb-7b5640caf337')
+     def test_get_healthcheck(self):
+-
+-        resp, _ = self.account_client.get("healthcheck", {})
++        url = self.account_client._get_base_version_url() + "healthcheck"
++        resp, body = self.account_client.raw_request(url, "GET")
++        self.account_client._error_checker(resp, body)
+         # The target of the request is not any Swift resource. Therefore, the
+         # existence of response header is checked without a custom matcher.
+diff --git a/tempest/lib/services/object_storage/capabilities_client.py b/tempest/lib/services/object_storage/capabilities_client.py
+index d31bbc299..f08bd9aea 100644
+--- a/tempest/lib/services/object_storage/capabilities_client.py
++++ b/tempest/lib/services/object_storage/capabilities_client.py
+@@ -21,9 +21,10 @@ from tempest.lib.common import rest_client
+ class CapabilitiesClient(rest_client.RestClient):
+     def list_capabilities(self):
+-        self.skip_path()
+         try:
+-            resp, body = self.get('info')
++            url = self._get_base_version_url() + 'info'
++            resp, body = self.raw_request(url, 'GET')
++            self._error_checker(resp, body)
+         finally:
+             self.reset_path()
+         body = json.loads(body)
+diff --git a/tempest/tests/lib/services/object_storage/test_capabilities_client.py b/tempest/tests/lib/services/object_storage/test_capabilities_client.py
+index b7f972a85..9df7c7c18 100644
+--- a/tempest/tests/lib/services/object_storage/test_capabilities_client.py
++++ b/tempest/tests/lib/services/object_storage/test_capabilities_client.py
+@@ -43,7 +43,7 @@ class TestCapabilitiesClient(base.BaseServiceTest):
+         }
+         self.check_service_client_function(
+             self.client.list_capabilities,
+-            'tempest.lib.common.rest_client.RestClient.get',
++            'tempest.lib.common.rest_client.RestClient.raw_request',
+             resp,
+             bytes_body)
+-- 
+2.26.0.rc2
+
index ad1a2f3..0f78227 100644 (file)
@@ -7,6 +7,7 @@ ARG RALLY_TAG=1.5.1
 ARG RALLY_OPENSTACK_TAG=1.5.0
 ARG UJSON_TAG=d25e024f481c5571d15f3c0c406a498ca0467cfd
 
+COPY Accept-custom-registered-endpoints.patch /tmp/Accept-custom-registered-endpoints.patch
 RUN apk --no-cache add --virtual .build-deps --update \
         python-dev build-base linux-headers libffi-dev \
         openssl-dev libjpeg-turbo-dev && \
@@ -34,4 +35,11 @@ RUN apk --no-cache add --virtual .build-deps --update \
     mkdir -p /etc/rally && \
     printf "[database]\nconnection = 'sqlite:////var/lib/rally/database/rally.sqlite'" > /etc/rally/rally.conf && \
     mkdir -p /var/lib/rally/database && rally db create && \
+    (cd /src/tempest && \
+        git config --global user.email "opnfv-tech-discuss@lists.opnfv.org" && \
+        git config --global user.name "Functest" && \
+        patch -p1 < /tmp/Accept-custom-registered-endpoints.patch && \
+        git commit -a -m "Apply Accept-custom-registered-endpoints" && \
+        rm ~/.gitconfig) && \
+    rm /tmp/Accept-custom-registered-endpoints.patch && \
     apk del .build-deps