diff --git a/nixproc/backends/s6-rc/test-module/default.nix b/nixproc/backends/s6-rc/test-module/default.nix index 466652d..399a0be 100644 --- a/nixproc/backends/s6-rc/test-module/default.nix +++ b/nixproc/backends/s6-rc/test-module/default.nix @@ -25,12 +25,11 @@ in pathsInNixDB = [ processesEnvProcessManager processesEnvSystem ]; - # TODO: how to determine service readiness of s6? deployProcessManager = '' machine.succeed( "${executeDeploy { inherit profileSettings; processManager = "sysvinit"; processesEnv = processesEnvProcessManager; }}" ) - machine.succeed("sleep 3") + machine.wait_for_file("${profileSettings.params.runtimeDir}/service/.s6-svscan") ''; deploySystem = '' diff --git a/nixproc/test-driver/agnostic.nix b/nixproc/test-driver/agnostic.nix index 733b4de..be435a2 100644 --- a/nixproc/test-driver/agnostic.nix +++ b/nixproc/test-driver/agnostic.nix @@ -11,7 +11,7 @@ let inherit pkgs system; }; - testSystemVariantForProcessManager = {processManager, profileSettings, exprFile, nixosConfig ? null, systemPackages ? [], readiness, tests}: + testSystemVariantForProcessManager = {processManager, profileSettings, exprFile, nixosConfig ? null, systemPackages ? [], initialTests ? null, readiness, tests}: let processManagerModule = builtins.getAttr processManager processManagerModules; @@ -55,6 +55,7 @@ let '' + processManagerSettings.deployProcessManager + processManagerSettings.deploySystem + + pkgs.lib.optionalString (initialTests != null) (initialTests profileSettings.params) # Execute readiness check for all process instances + pkgs.lib.concatMapStrings (instanceName: @@ -78,6 +79,7 @@ in , exprFile , nixosConfig ? null , systemPackages ? [] +, initialTests ? null , readiness , tests }: @@ -89,7 +91,7 @@ pkgs.lib.genAttrs profiles (profile: in pkgs.lib.genAttrs processManagers (processManager: testSystemVariantForProcessManager { - inherit processManager profileSettings exprFile nixosConfig systemPackages readiness tests; + inherit processManager profileSettings exprFile nixosConfig systemPackages initialTests readiness tests; } ) )