mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00
parent
430ea8553b
commit
abb345f6ca
2 changed files with 22 additions and 28 deletions
|
@ -163,7 +163,7 @@ in {
|
|||
allTerminfo = runTest ./all-terminfo.nix;
|
||||
alps = runTest ./alps.nix;
|
||||
amazon-cloudwatch-agent = runTest ./amazon-cloudwatch-agent.nix;
|
||||
amazon-init-shell = handleTest ./amazon-init-shell.nix {};
|
||||
amazon-init-shell = runTest ./amazon-init-shell.nix;
|
||||
amazon-ssm-agent = handleTest ./amazon-ssm-agent.nix {};
|
||||
amd-sev = runTest ./amd-sev.nix;
|
||||
angie-api = handleTest ./angie-api.nix {};
|
||||
|
|
|
@ -6,41 +6,35 @@
|
|||
# configuration expression.
|
||||
|
||||
{
|
||||
system ? builtins.currentSystem,
|
||||
config ? { },
|
||||
pkgs ? import ../.. { inherit system config; },
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
with import ../lib/testing-python.nix { inherit system pkgs; };
|
||||
with pkgs.lib;
|
||||
|
||||
makeTest {
|
||||
{
|
||||
name = "amazon-init";
|
||||
meta = with maintainers; {
|
||||
meta = with lib.maintainers; {
|
||||
maintainers = [ urbas ];
|
||||
};
|
||||
nodes.machine =
|
||||
{ lib, pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
../modules/profiles/headless.nix
|
||||
../modules/virtualisation/amazon-init.nix
|
||||
];
|
||||
services.openssh.enable = true;
|
||||
system.switch.enable = true;
|
||||
networking.hostName = "";
|
||||
environment.etc."ec2-metadata/user-data" = {
|
||||
text = ''
|
||||
#!/usr/bin/bash
|
||||
nodes.machine = {
|
||||
imports = [
|
||||
../modules/profiles/headless.nix
|
||||
../modules/virtualisation/amazon-init.nix
|
||||
];
|
||||
services.openssh.enable = true;
|
||||
system.switch.enable = true;
|
||||
networking.hostName = "";
|
||||
environment.etc."ec2-metadata/user-data" = {
|
||||
text = ''
|
||||
#!/usr/bin/bash
|
||||
|
||||
echo successful > /tmp/evidence
|
||||
echo successful > /tmp/evidence
|
||||
|
||||
# Emulate running nixos-rebuild switch, just without any building.
|
||||
# https://github.com/nixos/nixpkgs/blob/4c62505847d88f16df11eff3c81bf9a453a4979e/nixos/modules/virtualisation/amazon-init.nix#L55
|
||||
/run/current-system/bin/switch-to-configuration test
|
||||
'';
|
||||
};
|
||||
# Emulate running nixos-rebuild switch, just without any building.
|
||||
# https://github.com/nixos/nixpkgs/blob/4c62505847d88f16df11eff3c81bf9a453a4979e/nixos/modules/virtualisation/amazon-init.nix#L55
|
||||
/run/current-system/bin/switch-to-configuration test
|
||||
'';
|
||||
};
|
||||
};
|
||||
testScript = ''
|
||||
# To wait until amazon-init terminates its run
|
||||
unnamed.wait_for_unit("amazon-init.service")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue