mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-10 16:45:51 +03:00
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" ];
|
||||
services.cloud-init.enable = true;
|
||||
services.openssh.enable = true;
|
||||
|
||||
networking.hostName = "";
|
||||
};
|
||||
testScript = ''
|
||||
machine.wait_for_unit("cloud-init.service")
|
||||
@ -70,5 +70,13 @@ in makeTest {
|
||||
machine.succeed(
|
||||
"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
Block a user