Skip to content

Commit

Permalink
Merge pull request #169 from xcp-ng/gtn-hsts-8.3-only
Browse files Browse the repository at this point in the history
Only test HSTS on 8.3 and above
  • Loading branch information
stormi authored Sep 27, 2023
2 parents 509a00d + 56beb78 commit b7fba88
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/misc/test_file_server.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import pytest
import subprocess

# These tests are meant to test an host fileserver behavior.
#
# Requirements:
# - an XCP-ng host >= 8.2 with latest updates.
# - an XCP-ng host >= 8.2 with latest updates (and >= 8.3 for the HSTS test).
# The host must be configured with `website-https-only` set to true (which is the default config).

def test_fileserver_redirect_https(host):
Expand All @@ -18,6 +19,7 @@ def test_fileserver_redirect_https(host):
assert lines[0].strip() == "HTTP/1.1 301 Moved Permanently"
assert lines[2].strip() == "location:https://" + host.hostname_or_ip + path

@pytest.mark.usefixtures("host_at_least_8_3")
class TestHSTS:
HSTS_HEADER = "strict-transport-security:max-age=63072000"

Expand Down

0 comments on commit b7fba88

Please sign in to comment.