Add more SSH tests
This commit is contained in:
parent
3412a11c51
commit
2796c441ea
|
@ -44,5 +44,11 @@ module Acceptance
|
|||
def status(vm_name, status)
|
||||
@text =~ /^#{vm_name}\s+#{status}$/
|
||||
end
|
||||
|
||||
# This checks that an error message that the VM must be created
|
||||
# is shown.
|
||||
def error_vm_must_be_created
|
||||
@text =~ /^VM must be created/
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,7 +1,23 @@
|
|||
require File.expand_path("../base", __FILE__)
|
||||
|
||||
class SSHTest < AcceptanceTest
|
||||
should "bring up a running virtual machine and be able to SSH into it" do
|
||||
should "fail if no Vagrantfile is found" do
|
||||
result = execute("vagrant", "ssh")
|
||||
assert(!result.success?, "vagrant ssh should fail")
|
||||
assert(output(result.stdout).no_vagrantfile,
|
||||
"Vagrant should error since there is no Vagrantfile")
|
||||
end
|
||||
|
||||
should "fail if the virtual machine is not created" do
|
||||
assert_execute("vagrant", "init")
|
||||
|
||||
result = execute("vagrant", "ssh")
|
||||
assert(!result.success?, "vagrant ssh should fail")
|
||||
assert(output(result.stdout).error_vm_must_be_created,
|
||||
"Vagrant should error that the VM must be created.")
|
||||
end
|
||||
|
||||
should "be able to SSH into a running virtual machine" do
|
||||
assert_execute("vagrant", "box", "add", "base", config.boxes["default"])
|
||||
assert_execute("vagrant", "init")
|
||||
assert_execute("vagrant", "up")
|
||||
|
|
Loading…
Reference in New Issue