From 5241d1d6ea618fa482fbeb33b90e522795103d7d Mon Sep 17 00:00:00 2001 From: Roman Gorshunov Date: Sat, 29 Feb 2020 16:45:02 +0100 Subject: [PATCH] Fix deckhand-integration-uwsgi-py35 tests During Gabbi tests server returns one of application/json application/json; charset=UTF-8 in a Content-Type HTTP header, depending on which test is being run. This might be related to different pip/pip3 versions and dependencies installed being used during standalone vs. containerized tests. This patch allows for both returned header's values to be accepted as valid as a remediate solution until versions of packages and pip/pip3 usage is unified. Change-Id: Ifb8f2d68e3474946b3df154cb016cc18cfc95d23 --- .../tests/integration/gabbits/document-crud-secret.yaml | 4 ++-- .../gabbits/document-render-secret-edge-cases.yaml | 4 ++-- .../gabbits/document-substitution-secret-generic.yaml | 2 +- .../integration/gabbits/document-substitution-secret.yaml | 2 +- .../integration/gabbits/revision-delete-all-secrets.yaml | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/deckhand/tests/integration/gabbits/document-crud-secret.yaml b/deckhand/tests/integration/gabbits/document-crud-secret.yaml index c94a4de2..cb4d5fe8 100644 --- a/deckhand/tests/integration/gabbits/document-crud-secret.yaml +++ b/deckhand/tests/integration/gabbits/document-crud-secret.yaml @@ -51,7 +51,7 @@ tests: request_headers: content-type: application/json response_headers: - content-type: application/json; charset=UTF-8 + content-type: /^application\/json$|^application\/json;\ charset=UTF-8$/ response_json_paths: $.status: ACTIVE $.name: my-passphrase @@ -63,7 +63,7 @@ tests: request_headers: content-type: application/json response_headers: - content-type: application/octet-stream; charset=UTF-8 + content-type: /^application\/octet-stream|^application\/octet-stream;\ charset=UTF-8/ response_strings: # base64.b64encode(repr("not-a-real-password")) - J25vdC1hLXJlYWwtcGFzc3dvcmQn diff --git a/deckhand/tests/integration/gabbits/document-render-secret-edge-cases.yaml b/deckhand/tests/integration/gabbits/document-render-secret-edge-cases.yaml index 43742959..c07fd95e 100644 --- a/deckhand/tests/integration/gabbits/document-render-secret-edge-cases.yaml +++ b/deckhand/tests/integration/gabbits/document-render-secret-edge-cases.yaml @@ -66,7 +66,7 @@ tests: request_headers: content-type: application/json response_headers: - content-type: application/json; charset=UTF-8 + content-type: /^application\/json$|^application\/json;\ charset=UTF-8$/ response_json_paths: $.secrets.`len`: 0 $.secrets: [] @@ -151,7 +151,7 @@ tests: request_headers: content-type: application/json response_headers: - content-type: application/json; charset=UTF-8 + content-type: /^application\/json$|^application\/json;\ charset=UTF-8$/ response_json_paths: $.status: ACTIVE $.name: armada-doc diff --git a/deckhand/tests/integration/gabbits/document-substitution-secret-generic.yaml b/deckhand/tests/integration/gabbits/document-substitution-secret-generic.yaml index b317a9df..7562ec5c 100644 --- a/deckhand/tests/integration/gabbits/document-substitution-secret-generic.yaml +++ b/deckhand/tests/integration/gabbits/document-substitution-secret-generic.yaml @@ -88,7 +88,7 @@ tests: request_headers: content-type: application/json response_headers: - content-type: application/json; charset=UTF-8 + content-type: /^application\/json$|^application\/json;\ charset=UTF-8$/ response_json_paths: $.status: ACTIVE $.name: example-armada-cert diff --git a/deckhand/tests/integration/gabbits/document-substitution-secret.yaml b/deckhand/tests/integration/gabbits/document-substitution-secret.yaml index fcc62a38..8e129039 100644 --- a/deckhand/tests/integration/gabbits/document-substitution-secret.yaml +++ b/deckhand/tests/integration/gabbits/document-substitution-secret.yaml @@ -202,7 +202,7 @@ tests: request_headers: content-type: application/json response_headers: - content-type: application/json; charset=UTF-8 + content-type: /^application\/json$|^application\/json;\ charset=UTF-8$/ response_json_paths: $.secrets.`len`: 7 $.secrets[*].status: diff --git a/deckhand/tests/integration/gabbits/revision-delete-all-secrets.yaml b/deckhand/tests/integration/gabbits/revision-delete-all-secrets.yaml index 81dbdb8f..15e2553a 100644 --- a/deckhand/tests/integration/gabbits/revision-delete-all-secrets.yaml +++ b/deckhand/tests/integration/gabbits/revision-delete-all-secrets.yaml @@ -49,7 +49,7 @@ tests: request_headers: X-Auth-Token: $ENVIRON['TEST_AUTH_TOKEN'] response_headers: - content-type: application/json; charset=UTF-8 + content-type: /^application\/json$|^application\/json;\ charset=UTF-8$/ response_json_paths: $.status: ACTIVE @@ -60,7 +60,7 @@ tests: request_headers: X-Auth-Token: $ENVIRON['TEST_AUTH_TOKEN'] response_headers: - content-type: application/octet-stream; charset=UTF-8 + content-type: /^application\/octet-stream$|^application\/octet-stream;\ charset=UTF-8$/ response_strings: # base64.b64encode(repr("not-a-real-password")) - J25vdC1hLXJlYWwtcGFzc3dvcmQn @@ -82,7 +82,7 @@ tests: request_headers: X-Auth-Token: $ENVIRON['TEST_AUTH_TOKEN'] response_headers: - content-type: application/json; charset=UTF-8 + content-type: /^application\/json$|^application\/json;\ charset=UTF-8$/ response_json_paths: $.secrets.`len`: 0 $.secrets: []