nixos/tests/cloud-init: fix the erroring out
The test was broken for a 1.5 months apparently? Well, now it passes. Also apparently it's not flaky anymore.
This commit is contained in:
parent
8eb2551e51
commit
bcc196cae8
@ -51,29 +51,31 @@ in makeTest {
|
|||||||
networking.hostName = "";
|
networking.hostName = "";
|
||||||
};
|
};
|
||||||
testScript = ''
|
testScript = ''
|
||||||
machine.wait_for_unit("cloud-init.service")
|
# To wait until cloud-init terminates its run
|
||||||
machine.succeed("cat /tmp/cloudinit-write-file | grep -q 'cloudinit'")
|
unnamed.wait_for_unit("cloud-final.service")
|
||||||
|
|
||||||
|
unnamed.succeed("cat /tmp/cloudinit-write-file | grep -q 'cloudinit'")
|
||||||
|
|
||||||
# install snakeoil ssh key and provision .ssh/config file
|
# install snakeoil ssh key and provision .ssh/config file
|
||||||
machine.succeed("mkdir -p ~/.ssh")
|
unnamed.succeed("mkdir -p ~/.ssh")
|
||||||
machine.succeed(
|
unnamed.succeed(
|
||||||
"cat ${snakeOilPrivateKey} > ~/.ssh/id_snakeoil"
|
"cat ${snakeOilPrivateKey} > ~/.ssh/id_snakeoil"
|
||||||
)
|
)
|
||||||
machine.succeed("chmod 600 ~/.ssh/id_snakeoil")
|
unnamed.succeed("chmod 600 ~/.ssh/id_snakeoil")
|
||||||
|
|
||||||
machine.wait_for_unit("sshd.service")
|
unnamed.wait_for_unit("sshd.service")
|
||||||
|
|
||||||
# we should be able to log in as the root user, as well as the created nixos user
|
# we should be able to log in as the root user, as well as the created nixos user
|
||||||
machine.succeed(
|
unnamed.succeed(
|
||||||
"ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentityFile=~/.ssh/id_snakeoil root@localhost 'true'"
|
"ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentityFile=~/.ssh/id_snakeoil root@localhost 'true'"
|
||||||
)
|
)
|
||||||
machine.succeed(
|
unnamed.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
|
# test changing hostname via cloud-init worked
|
||||||
assert (
|
assert (
|
||||||
machine.succeed(
|
unnamed.succeed(
|
||||||
"ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentityFile=~/.ssh/id_snakeoil nixos@localhost 'hostname'"
|
"ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentityFile=~/.ssh/id_snakeoil nixos@localhost 'hostname'"
|
||||||
).strip()
|
).strip()
|
||||||
== "test"
|
== "test"
|
||||||
|
Loading…
Reference in New Issue
Block a user