nixosTests.cloud-init: handleTest -> runTest

This commit is contained in:
Sizhe Zhao 2025-06-07 19:48:48 +08:00
parent 950a25abb6
commit 3faac88ef3
No known key found for this signature in database
GPG Key ID: ED1807251A7DA08F
2 changed files with 16 additions and 25 deletions

View File

@ -318,7 +318,7 @@ in
cjdns = runTest ./cjdns.nix; cjdns = runTest ./cjdns.nix;
clatd = runTest ./clatd.nix; clatd = runTest ./clatd.nix;
clickhouse = import ./clickhouse { inherit runTest; }; clickhouse = import ./clickhouse { inherit runTest; };
cloud-init = handleTest ./cloud-init.nix { }; cloud-init = runTest ./cloud-init.nix;
cloud-init-hostname = handleTest ./cloud-init-hostname.nix { }; cloud-init-hostname = handleTest ./cloud-init-hostname.nix { };
cloudlog = runTest ./cloudlog.nix; cloudlog = runTest ./cloudlog.nix;
cntr = handleTestOn [ "aarch64-linux" "x86_64-linux" ] ./cntr.nix { }; cntr = handleTestOn [ "aarch64-linux" "x86_64-linux" ] ./cntr.nix { };

View File

@ -1,11 +1,4 @@
{ { lib, pkgs, ... }:
system ? builtins.currentSystem,
config ? { },
pkgs ? import ../.. { inherit system config; },
}:
with import ../lib/testing-python.nix { inherit system pkgs; };
with pkgs.lib;
let let
inherit (import ./ssh-keys.nix pkgs) inherit (import ./ssh-keys.nix pkgs)
@ -61,27 +54,25 @@ let
}; };
in in
makeTest { {
name = "cloud-init"; name = "cloud-init";
meta.maintainers = with pkgs.lib.maintainers; [ meta.maintainers = with lib.maintainers; [
lewo lewo
illustris illustris
]; ];
nodes.machine = nodes.machine = {
{ ... }: virtualisation.qemu.options = [
{ "-cdrom"
virtualisation.qemu.options = [ "${metadataDrive}/metadata.iso"
"-cdrom" ];
"${metadataDrive}/metadata.iso" services.cloud-init = {
]; enable = true;
services.cloud-init = { network.enable = true;
enable = true;
network.enable = true;
};
services.openssh.enable = true;
networking.hostName = "";
networking.useDHCP = false;
}; };
services.openssh.enable = true;
networking.hostName = "";
networking.useDHCP = false;
};
testScript = '' testScript = ''
# To wait until cloud-init terminates its run # To wait until cloud-init terminates its run
unnamed.wait_for_unit("cloud-init-local.service") unnamed.wait_for_unit("cloud-init-local.service")