nixosTests.amazon-ssm-agent: init

This commit is contained in:
Anthony Roussel 2023-10-25 11:29:11 +02:00
parent 3dd50eaa8f
commit 4f7eab6de1
No known key found for this signature in database
GPG key ID: 9DC4987B1A55E75E
3 changed files with 26 additions and 4 deletions

View file

@ -117,6 +117,7 @@ in {
allTerminfo = handleTest ./all-terminfo.nix {};
alps = handleTest ./alps.nix {};
amazon-init-shell = handleTest ./amazon-init-shell.nix {};
amazon-ssm-agent = handleTest ./amazon-ssm-agent.nix {};
amd-sev = runTest ./amd-sev.nix;
anbox = runTest ./anbox.nix;
anuko-time-tracker = handleTest ./anuko-time-tracker.nix {};

View file

@ -0,0 +1,17 @@
import ./make-test-python.nix ({ lib, pkgs, ... }: {
name = "amazon-ssm-agent";
meta.maintainers = [ lib.maintainers.anthonyroussel ];
nodes.machine = { config, pkgs, ... }: {
services.amazon-ssm-agent.enable = true;
};
testScript = ''
start_all()
machine.wait_for_file("/etc/amazon/ssm/seelog.xml")
machine.wait_for_file("/etc/amazon/ssm/amazon-ssm-agent.json")
machine.wait_for_unit("amazon-ssm-agent.service")
'';
})

View file

@ -10,6 +10,7 @@
, dmidecode
, bashInteractive
, nix-update-script
, nixosTests
, testers
, amazon-ssm-agent
, overrideEtc ? true
@ -136,11 +137,14 @@ buildGoModule rec {
'';
passthru = {
updateScript = nix-update-script { };
tests.version = testers.testVersion {
package = amazon-ssm-agent;
command = "amazon-ssm-agent --version";
tests = {
inherit (nixosTests) amazon-ssm-agent;
version = testers.testVersion {
package = amazon-ssm-agent;
command = "amazon-ssm-agent --version";
};
};
updateScript = nix-update-script { };
};
meta = with lib; {