Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacome committed Nov 4, 2022
1 parent f37bb23 commit 2dd6440
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions tests/suite/test_auth_basic_policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def setup_single_policy(self, kube_apis, test_namespace, credentials, secret, po
return secret_name, pol_name, {"host": vs_host}

with open(credentials) as file:
data = file.readline()
data = file.readline().strip()
headers = {"host": vs_host, "authorization": f"Basic {to_base64(data)}"}

return secret_name, pol_name, headers
Expand All @@ -104,7 +104,7 @@ def setup_multiple_policies(self, kube_apis, test_namespace, credentials, secret
wait_before_test()

with open(credentials) as file:
data = file.readline()
data = file.readline().strip()
headers = {"host": vs_host, "authorization": f"Basic {to_base64(data)}"}

return secret_name_list, pol_name_1, pol_name_2, headers
Expand Down
4 changes: 2 additions & 2 deletions tests/suite/test_auth_basic_policies_vsr.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def setup_single_policy(self, kube_apis, namespace, credentials, secret, policy,
return secret_name, pol_name, {"host": vs_host}

with open(credentials) as file:
data = file.readline()
data = file.readline().strip()
headers = {"host": vs_host, "authorization": f"Basic {to_base64(data)}"}

return secret_name, pol_name, headers
Expand All @@ -92,7 +92,7 @@ def setup_multiple_policies(self, kube_apis, namespace, credentials, secret_list

wait_before_test()
with open(credentials) as file:
data = file.readline()
data = file.readline().strip()
headers = {"host": vs_host, "authorization": f"Basic {to_base64(data)}"}

return secret_name_list, pol_name_1, pol_name_2, headers
Expand Down
2 changes: 1 addition & 1 deletion tests/suite/test_build_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def send_build_info(self, kube_apis, ingress_controller_prerequisites) -> str:
raise ex

br = io.StringIO(api_response)
_log = br.readline()
_log = br.readline().strip()
try:
_info = _log[_log.find("Version") :].strip()
logging.info(f"Version and GitCommit info: {_info}")
Expand Down
4 changes: 2 additions & 2 deletions tests/suite/test_jwt_policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def setup_single_policy(self, kube_apis, test_namespace, token, secret, policy,
wait_before_test()

with open(token) as file:
data = file.readline()
data = file.readline().strip()
headers = {"host": vs_host, "token": data}

return secret_name, pol_name, headers
Expand All @@ -72,7 +72,7 @@ def setup_multiple_policies(self, kube_apis, test_namespace, token, secret, poli

wait_before_test()
with open(token) as file:
data = file.readline()
data = file.readline().strip()
headers = {"host": vs_host, "token": data}

return secret_name, pol_name_1, pol_name_2, headers
Expand Down
4 changes: 2 additions & 2 deletions tests/suite/test_jwt_policies_vsr.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def setup_single_policy(self, kube_apis, namespace, token, secret, policy, vs_ho

wait_before_test()
with open(token) as file:
data = file.readline()
data = file.readline().strip()
headers = {"host": vs_host, "token": data}

return secret_name, pol_name, headers
Expand All @@ -69,7 +69,7 @@ def setup_multiple_policies(self, kube_apis, namespace, token, secret, policy_1,

wait_before_test()
with open(token) as file:
data = file.readline()
data = file.readline().strip()
headers = {"host": vs_host, "token": data}

return secret_name, pol_name_1, pol_name_2, headers
Expand Down
2 changes: 1 addition & 1 deletion tests/suite/test_v_s_route_canned_responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def test_default_canned_response(self, kube_apis, crd_ingress_controller, v_s_ro
wait_and_assert_status_code(200, req_url, v_s_route_setup.vs_host)
resp = requests.get(req_url, headers={"host": v_s_route_setup.vs_host})
resp_content = resp.content.decode("utf-8")
assert resp.headers["content-type"] == "text/plain" and resp_content == "line1\nline2\nline3"
assert resp.headers["content-type"] == "text/plain" and resp_content == "line1\nline2\nline3\n"

def test_update(self, kube_apis, crd_ingress_controller, v_s_route_setup):
req_host = f"{v_s_route_setup.public_endpoint.public_ip}:{v_s_route_setup.public_endpoint.port}"
Expand Down
2 changes: 1 addition & 1 deletion tests/suite/test_virtual_server_canned_responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def test_default_canned_response(self, kube_apis, crd_ingress_controller, virtua
wait_and_assert_status_code(200, virtual_server_setup.backend_2_url, virtual_server_setup.vs_host)
resp = requests.get(virtual_server_setup.backend_2_url, headers={"host": virtual_server_setup.vs_host})
resp_content = resp.content.decode("utf-8")
assert resp.headers["content-type"] == "text/plain" and resp_content == "line1\nline2\nline3"
assert resp.headers["content-type"] == "text/plain" and resp_content == "line1\nline2\nline3\n"

def test_update(self, kube_apis, crd_ingress_controller, virtual_server_setup):
wait_before_test(1)
Expand Down

0 comments on commit 2dd6440

Please sign in to comment.