Merge pull request #139907 from rnhmjoj/test-fixes
nixos/tests: fix for memorySize being an integer
This commit is contained in:
commit
28e1ca8ebf
|
@ -82,7 +82,7 @@ in
|
||||||
# chromium-based browsers refuse to run as root
|
# chromium-based browsers refuse to run as root
|
||||||
test-support.displayManager.auto.user = "alice";
|
test-support.displayManager.auto.user = "alice";
|
||||||
# browsers may hang with the default memory
|
# browsers may hang with the default memory
|
||||||
virtualisation.memorySize = "500";
|
virtualisation.memorySize = 500;
|
||||||
|
|
||||||
networking.hosts."127.0.0.1" = [ "good.example.com" "bad.example.com" ];
|
networking.hosts."127.0.0.1" = [ "good.example.com" "bad.example.com" ];
|
||||||
security.pki.certificateFiles = [ "${example-good-cert}/ca.crt" ];
|
security.pki.certificateFiles = [ "${example-good-cert}/ca.crt" ];
|
||||||
|
@ -113,7 +113,7 @@ in
|
||||||
# which is why it will not use the system certificate store for the time being.
|
# which is why it will not use the system certificate store for the time being.
|
||||||
# firefox
|
# firefox
|
||||||
chromium
|
chromium
|
||||||
falkon
|
qutebrowser
|
||||||
midori
|
midori
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
@ -152,21 +152,21 @@ in
|
||||||
with subtest("Unknown CA is untrusted in curl"):
|
with subtest("Unknown CA is untrusted in curl"):
|
||||||
machine.fail("curl -fv https://bad.example.com")
|
machine.fail("curl -fv https://bad.example.com")
|
||||||
|
|
||||||
browsers = [
|
browsers = {
|
||||||
# Firefox was disabled here, because we needed to disable p11-kit support in nss,
|
# Firefox was disabled here, because we needed to disable p11-kit support in nss,
|
||||||
# which is why it will not use the system certificate store for the time being.
|
# which is why it will not use the system certificate store for the time being.
|
||||||
# "firefox",
|
#"firefox": "Security Risk",
|
||||||
"chromium",
|
"chromium": "not private",
|
||||||
"falkon",
|
"qutebrowser -T": "Certificate error",
|
||||||
"midori"
|
"midori": "Security"
|
||||||
]
|
}
|
||||||
errors = ["Security Risk", "not private", "Certificate Error", "Security"]
|
|
||||||
|
|
||||||
machine.wait_for_x()
|
machine.wait_for_x()
|
||||||
for browser, error in zip(browsers, errors):
|
for command, error in browsers.items():
|
||||||
|
browser = command.split()[0]
|
||||||
with subtest("Good certificate is trusted in " + browser):
|
with subtest("Good certificate is trusted in " + browser):
|
||||||
execute_as(
|
execute_as(
|
||||||
"alice", f"env P11_KIT_DEBUG=trust {browser} https://good.example.com & >&2"
|
"alice", f"env P11_KIT_DEBUG=trust {command} https://good.example.com & >&2"
|
||||||
)
|
)
|
||||||
wait_for_window_as("alice", browser)
|
wait_for_window_as("alice", browser)
|
||||||
machine.wait_for_text("It works!")
|
machine.wait_for_text("It works!")
|
||||||
|
@ -174,7 +174,7 @@ in
|
||||||
execute_as("alice", "xdotool key ctrl+w") # close tab
|
execute_as("alice", "xdotool key ctrl+w") # close tab
|
||||||
|
|
||||||
with subtest("Unknown CA is untrusted in " + browser):
|
with subtest("Unknown CA is untrusted in " + browser):
|
||||||
execute_as("alice", f"{browser} https://bad.example.com & >&2")
|
execute_as("alice", f"{command} https://bad.example.com & >&2")
|
||||||
machine.wait_for_text(error)
|
machine.wait_for_text(error)
|
||||||
machine.screenshot("bad" + browser)
|
machine.screenshot("bad" + browser)
|
||||||
machine.succeed("pkill " + browser)
|
machine.succeed("pkill " + browser)
|
||||||
|
|
|
@ -14,7 +14,7 @@ import ./make-test-python.nix ({ pkgs, firefoxPackage, ... }: {
|
||||||
];
|
];
|
||||||
|
|
||||||
# Need some more memory to record audio.
|
# Need some more memory to record audio.
|
||||||
virtualisation.memorySize = "500";
|
virtualisation.memorySize = 500;
|
||||||
|
|
||||||
# Create a virtual sound device, with mixing
|
# Create a virtual sound device, with mixing
|
||||||
# and all, for recording audio.
|
# and all, for recording audio.
|
||||||
|
|
Loading…
Reference in a new issue