nixos/tests/ec2-nixops: fix build (#338147)

This commit is contained in:
Aleksana 2024-09-04 22:17:39 +08:00 committed by GitHub
commit 9b4a8db85e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,6 +22,8 @@ let
ln -s vda1 /dev/xvda1
'';
amazonImage.format = "qcow2";
# In a NixOS test the serial console is occupied by the "backdoor"
# (see testing/test-instrumentation.nix) and is incompatible with
# the configuration in virtualisation/amazon-image.nix.
@ -53,7 +55,7 @@ let
}
];
}).config;
image = "${imageCfg.system.build.amazonImage}/${imageCfg.amazonImage.name}.vhd";
image = "${imageCfg.system.build.amazonImage}/${imageCfg.amazonImage.name}.qcow2";
sshKeys = import ./ssh-keys.nix pkgs;
snakeOilPrivateKey = sshKeys.snakeOilPrivateKey.text;
@ -63,6 +65,7 @@ let
in {
boot-ec2-nixops = makeEc2Test {
name = "nixops-userdata";
meta.timeout = 600;
inherit image;
sshPublicKey = snakeOilPublicKey; # That's right folks! My user's key is also the host key!
@ -95,7 +98,7 @@ in {
machine.succeed(
"echo localhost,127.0.0.1 ${snakeOilPublicKey} > ~/.ssh/known_hosts"
)
machine.succeed("ssh -o BatchMode=yes localhost exit")
machine.succeed("ssh -o BatchMode=yes localhost exit", timeout=120)
# Test whether the root disk was resized.
blocks, block_size = map(int, machine.succeed("stat -c %b:%S -f /").split(":"))