mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-10-02 18:47:58 +03:00
Merge pull request #178005 from hercules-ci/fix-nixos-tests
Fix some NixOS tests
This commit is contained in:
commit
42ea4e9727
@ -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",
|
||||
|
@ -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
|
||||
|
@ -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 2>/dev/null | openssl x509 -noout -text"
|
||||
f" | grep DNS: | grep {test_alias}"
|
||||
|
@ -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}/")
|
||||
'';
|
||||
|
Loading…
Reference in New Issue
Block a user