nixosTests.cloud-init: test changing hostname actually works
This commit is contained in:
parent
00347e9537
commit
a299fc2351
|
@ -48,7 +48,7 @@ in makeTest {
|
||||||
virtualisation.qemu.options = [ "-cdrom" "${metadataDrive}/metadata.iso" ];
|
virtualisation.qemu.options = [ "-cdrom" "${metadataDrive}/metadata.iso" ];
|
||||||
services.cloud-init.enable = true;
|
services.cloud-init.enable = true;
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
|
networking.hostName = "";
|
||||||
};
|
};
|
||||||
testScript = ''
|
testScript = ''
|
||||||
machine.wait_for_unit("cloud-init.service")
|
machine.wait_for_unit("cloud-init.service")
|
||||||
|
@ -70,5 +70,13 @@ in makeTest {
|
||||||
machine.succeed(
|
machine.succeed(
|
||||||
"ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentityFile=~/.ssh/id_snakeoil nixos@localhost 'true'"
|
"ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentityFile=~/.ssh/id_snakeoil nixos@localhost 'true'"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# test changing hostname via cloud-init worked
|
||||||
|
assert (
|
||||||
|
machine.succeed(
|
||||||
|
"ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentityFile=~/.ssh/id_snakeoil nixos@localhost 'hostname'"
|
||||||
|
).strip()
|
||||||
|
== "test"
|
||||||
|
)
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue