From 1fd70189973f247c4fab3e426151cda4e912e8ed Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 21 Jan 2022 08:58:47 +0200 Subject: refactor: use lib/runcmd's steps instead of custom ones Subplot's lib/runcmd provides a "when I run ..." step that we can use, instead of having a custom "when I invoke ..." step. Less code, fewer bugs. Sponsored-by: author --- vmadm.md | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'vmadm.md') diff --git a/vmadm.md b/vmadm.md index 1db6307..8bfd476 100644 --- a/vmadm.md +++ b/vmadm.md @@ -162,7 +162,7 @@ given file config.yaml given file .ssh/id_rsa.pub from init_ssh_key_pub given file expected/init-test/meta-data from init-metadata given file expected/init-test/user-data from init-userdata -when I invoke vmadm cloud-init --config config.yaml init.yaml actual +when I run vmadm cloud-init --config config.yaml init.yaml actual then directories actual/init-test and expected/init-test are identical ~~~ @@ -228,17 +228,18 @@ given file .ssh/id_rsa from ssh_key given file .ssh/id_rsa.pub from ssh_key_pub given file .ssh/config from ssh_config given file .ssh/known_hosts from known_hosts +when I run chmod -R u=rwX,go= .ssh ~~~ Then we create the VM, and verify that we can log in. ~~~scenario -when I invoke vmadm new --config config.yaml smoke.yaml -when I invoke ssh -F .ssh/config debian@smoke hostname +when I run vmadm new --config config.yaml smoke.yaml +when I run ssh -F .ssh/config debian@smoke hostname then stdout contains "smoke" -when I invoke ssh -F .ssh/config debian@smoke df -h / +when I run ssh -F .ssh/config debian@smoke df -h / then stdout matches regex 4\.\dG -when I invoke ssh -F .ssh/config debian@smoke free -m +when I run ssh -F .ssh/config debian@smoke free -m then stdout matches regex Mem:\s+19\d\d\s ~~~ @@ -246,24 +247,24 @@ Then we shut it down, twice. The second time is to verify shutting down works even if the VM is already shut down. ~~~scenario -when I invoke vmadm shutdown --config config.yaml smoke.yaml -when I invoke vmadm shutdown --config config.yaml smoke.yaml +when I run vmadm shutdown --config config.yaml smoke.yaml +when I run vmadm shutdown --config config.yaml smoke.yaml ~~~ Then we start it back up again and verify we can log in. Then we start it again, while it's already running, to verify that that works. ~~~scenario -when I invoke vmadm start --config config.yaml smoke.yaml -when I invoke ssh -F .ssh/config debian@smoke hostname -when I invoke vmadm start --config config.yaml smoke.yaml +when I run vmadm start --config config.yaml smoke.yaml +when I run ssh -F .ssh/config debian@smoke hostname +when I run vmadm start --config config.yaml smoke.yaml ~~~ Finally, we delete it twice. ~~~scenario -when I invoke vmadm delete --config config.yaml smoke.yaml -when I invoke vmadm delete --config config.yaml smoke.yaml +when I run vmadm delete --config config.yaml smoke.yaml +when I run vmadm delete --config config.yaml smoke.yaml ~~~ -- cgit v1.2.1