diff --git a/cfsetup.yaml b/cfsetup.yaml index dd92bf52..6af0f2de 100644 --- a/cfsetup.yaml +++ b/cfsetup.yaml @@ -195,6 +195,26 @@ stretch: &stretch - ./fmt-check.sh - make test | gotest-to-teamcity component-test: + build_dir: *build_dir + builddeps: + - *pinned_go + - python3.7 + - python3-pip + - python3-setuptools + # procps installs the ps command which is needed in test_sysv_service because the init script + # uses ps pid to determine if the agent is running + - procps + pre-cache-copy-paths: + - component-tests/requirements.txt + pre-cache: &component_test_pre_cache + - sudo pip3 install --upgrade -r component-tests/requirements.txt + post-cache: &component_test_post_cache + # Creates and routes a Named Tunnel for this build. Also constructs config file from env vars. + - python3 component-tests/setup.py --type create + - pytest component-tests -o log_cli=true --log-cli-level=INFO + # The Named Tunnel is deleted and its route unprovisioned here. + - python3 component-tests/setup.py --type cleanup + component-test-fips: build_dir: *build_dir builddeps: - *pinned_go_fips @@ -206,14 +226,8 @@ stretch: &stretch - procps pre-cache-copy-paths: - component-tests/requirements.txt - pre-cache: - - sudo pip3 install --upgrade -r component-tests/requirements.txt - post-cache: - # Creates and routes a Named Tunnel for this build. Also constructs config file from env vars. - - python3 component-tests/setup.py --type create - - pytest component-tests -o log_cli=true --log-cli-level=INFO - # The Named Tunnel is deleted and its route unprovisioned here. - - python3 component-tests/setup.py --type cleanup + pre-cache: *component_test_pre_cache + post-cache: *component_test_post_cache update-homebrew: builddeps: - openssh-client diff --git a/component-tests/test_pq.py b/component-tests/test_pq.py new file mode 100644 index 00000000..e897f293 --- /dev/null +++ b/component-tests/test_pq.py @@ -0,0 +1,17 @@ +from util import LOGGER, nofips, start_cloudflared, wait_tunnel_ready + + +@nofips +class TestPostQuantum: + def _extra_config(self): + config = { + "protocol": "quic", + } + return config + + def test_post_quantum(self, tmp_path, component_tests_config): + config = component_tests_config(self._extra_config()) + LOGGER.debug(config) + with start_cloudflared(tmp_path, config, cfd_args=["run", "--post-quantum"], new_process=True): + wait_tunnel_ready(tunnel_url=config.get_url(), + require_min_connections=4) diff --git a/component-tests/util.py b/component-tests/util.py index 34f5faf7..02a9f1fd 100644 --- a/component-tests/util.py +++ b/component-tests/util.py @@ -20,6 +20,12 @@ def select_platform(plat): return pytest.mark.skipif( platform.system() != plat, reason=f"Only runs on {plat}") +def fips_enabled(): + env_fips = os.getenv("COMPONENT_TESTS_FIPS") + return env_fips is not None and env_fips != "0" + +nofips = pytest.mark.skipif( + fips_enabled(), reason=f"Only runs without FIPS (COMPONENT_TESTS_FIPS=0)") def write_config(directory, config): config_path = directory / "config.yml"