nixosTests.custom-ca: handleTest -> runTest

This commit is contained in:
Sizhe Zhao
2025-06-07 21:06:41 +08:00
parent ea619766ea
commit af4f64154f
2 changed files with 5 additions and 11 deletions

View File

@@ -388,7 +388,7 @@ in
cryptpad = runTest ./cryptpad.nix; cryptpad = runTest ./cryptpad.nix;
cups-pdf = runTest ./cups-pdf.nix; cups-pdf = runTest ./cups-pdf.nix;
curl-impersonate = runTest ./curl-impersonate.nix; curl-impersonate = runTest ./curl-impersonate.nix;
custom-ca = handleTest ./custom-ca.nix { }; custom-ca = import ./custom-ca.nix { inherit pkgs runTest; };
croc = runTest ./croc.nix; croc = runTest ./croc.nix;
cross-seed = runTest ./cross-seed.nix; cross-seed = runTest ./cross-seed.nix;
cyrus-imap = runTest ./cyrus-imap.nix; cyrus-imap = runTest ./cyrus-imap.nix;

View File

@@ -3,13 +3,7 @@
# The test checks that certificates issued by a custom # The test checks that certificates issued by a custom
# trusted CA are accepted but those from an unknown CA are rejected. # trusted CA are accepted but those from an unknown CA are rejected.
{ { runTest, pkgs }:
system ? builtins.currentSystem,
config ? { },
pkgs ? import ../.. { inherit system config; },
}:
with import ../lib/testing-python.nix { inherit system pkgs; };
let let
inherit (pkgs) lib; inherit (pkgs) lib;
@@ -104,7 +98,7 @@ let
}; };
}; };
curlTest = makeTest { curlTest = runTest {
name = "custom-ca-curl"; name = "custom-ca-curl";
meta.maintainers = with lib.maintainers; [ rnhmjoj ]; meta.maintainers = with lib.maintainers; [ rnhmjoj ];
nodes.machine = { ... }: webserverConfig; nodes.machine = { ... }: webserverConfig;
@@ -121,7 +115,7 @@ let
mkBrowserTest = mkBrowserTest =
browser: testParams: browser: testParams:
makeTest { runTest {
name = "custom-ca-${browser}"; name = "custom-ca-${browser}";
meta.maintainers = with lib.maintainers; [ rnhmjoj ]; meta.maintainers = with lib.maintainers; [ rnhmjoj ];
@@ -199,7 +193,7 @@ in
{ {
curl = curlTest; curl = curlTest;
} }
// pkgs.lib.mapAttrs mkBrowserTest { // lib.mapAttrs mkBrowserTest {
firefox = { firefox = {
error = "Security Risk"; error = "Security Risk";
}; };