From dfae39662294d7336f00f0d70e26f4971eff72b4 Mon Sep 17 00:00:00 2001 From: Giovanni Torres Date: Mon, 20 Nov 2017 12:00:56 -0500 Subject: [PATCH] Added tests to check for missing hostnames --- tests/check_script.bats | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/check_script.bats b/tests/check_script.bats index 16a87d0..f72e46a 100644 --- a/tests/check_script.bats +++ b/tests/check_script.bats @@ -8,6 +8,24 @@ VMNAME=batstestvm [[ "${lines[0]}" =~ "NAME" ]] } +@test "Test create with no hostname" { + run kvm-install-vm create + [ "$status" -eq 1 ] + [[ "${lines[0]}" =~ "NAME" ]] +} + +@test "Test create with options and no hostname" { + run kvm-install-vm create -t debian9 -d 20 + [ "$status" -eq 1 ] + [[ "${lines[0]}" =~ "Please specify a single host to create." ]] +} + +@test "Test remove with no hostname" { + run kvm-install-vm remove + [ "$status" -eq 1 ] + [[ "${lines[0]}" =~ "NAME" ]] +} + @test "Install VM - $VMNAME" { run kvm-install-vm create $VMNAME [ "$status" -eq 0 ]