diff --git a/nixos/lib/test-driver/setup.py b/nixos/lib/test-driver/setup.py index 476c7b2dab2a..1719b988db68 100644 --- a/nixos/lib/test-driver/setup.py +++ b/nixos/lib/test-driver/setup.py @@ -4,6 +4,7 @@ setup( name="nixos-test-driver", version='1.1', packages=find_packages(), + package_data={"test_driver": ["py.typed"]}, entry_points={ "console_scripts": [ "nixos-test-driver=test_driver:main", diff --git a/nixos/lib/testing-python.nix b/nixos/lib/testing-python.nix index a6868a708aaf..4bb1689ffd78 100644 --- a/nixos/lib/testing-python.nix +++ b/nixos/lib/testing-python.nix @@ -119,6 +119,7 @@ rec { { inherit testName; nativeBuildInputs = [ makeWrapper mypy ]; + buildInputs = [ testDriver ]; testScript = testScript'; preferLocalBuild = true; passthru = passthru // { @@ -138,13 +139,10 @@ rec { echo "${builtins.toString vlanNames}" >> testScriptWithTypes echo -n "$testScript" >> testScriptWithTypes - # set pythonpath so mypy knows where to find the imports. this requires the py.typed file. - export PYTHONPATH='${./test-driver}' mypy --no-implicit-optional \ --pretty \ --no-color-output \ testScriptWithTypes - unset PYTHONPATH ''} echo -n "$testScript" >> $out/test-script diff --git a/nixos/tests/acme.nix b/nixos/tests/acme.nix index 2dd06a50f40b..c07f99c5db3a 100644 --- a/nixos/tests/acme.nix +++ b/nixos/tests/acme.nix @@ -578,7 +578,7 @@ in { webserver.wait_for_unit(f"acme-finished-{test_domain}.target") wait_for_server() check_connection(client, test_domain) - rc, _ = client.execute( + rc, _s = client.execute( f"openssl s_client -CAfile /tmp/ca.crt -connect {test_alias}:443" " /dev/null | openssl x509 -noout -text" f" | grep DNS: | grep {test_alias}" diff --git a/nixos/tests/convos.nix b/nixos/tests/convos.nix index 72275ab390d9..cc0c2e75893c 100644 --- a/nixos/tests/convos.nix +++ b/nixos/tests/convos.nix @@ -23,7 +23,7 @@ in testScript = '' machine.wait_for_unit("convos") - machine.wait_for_open_port(port) + machine.wait_for_open_port(${toString port}) machine.succeed("journalctl -u convos | grep -q 'Listening at.*${toString port}'") machine.succeed("curl -f http://localhost:${toString port}/") '';