diff --git a/test/acceptance/ssh_test.rb b/test/acceptance/ssh_test.rb index 3d84356a7..8ede322d3 100644 --- a/test/acceptance/ssh_test.rb +++ b/test/acceptance/ssh_test.rb @@ -31,4 +31,7 @@ describe "vagrant ssh" do result = assert_execute("vagrant", "ssh", "-c", "echo foo") result.stdout.should == "foo\n" end + + # TODO: + # SSH should fail if the VM is not running end diff --git a/test/acceptance/support/shared/command_examples.rb b/test/acceptance/support/shared/command_examples.rb index 8cd911115..06618ebb3 100644 --- a/test/acceptance/support/shared/command_examples.rb +++ b/test/acceptance/support/shared/command_examples.rb @@ -30,6 +30,4 @@ shared_examples "a command that requires a virtual machine" do |*args| result.should_not be_success result.stdout.should match_output(:error_vm_must_be_created) end - - # TODO: Check for specific VM states: running, stopped, etc. end diff --git a/test/acceptance/up_basic_test.rb b/test/acceptance/up_basic_test.rb index 7bb9c4bcf..a2f62d638 100644 --- a/test/acceptance/up_basic_test.rb +++ b/test/acceptance/up_basic_test.rb @@ -5,20 +5,40 @@ describe "vagrant up", "basics" do include_context "acceptance" it_behaves_like "a command that requires a Vagrantfile", ["vagrant", "up"] - it "brings up a running virtual machine" do + # This creates an initial environment that is ready for a "vagrant up" + def initialize_valid_environment assert_execute("vagrant", "box", "add", "base", config.boxes["default"]) assert_execute("vagrant", "init") + end + + it "brings up a running virtual machine" do + initialize_valid_environment + assert_execute("vagrant", "up") result = assert_execute("vagrant", "status") result.stdout.should match_output(:status, "default", "running") end + it "should have a '/vagrant' shared folder" do + initialize_valid_environment + + # This is the file that will be created from the VM, + # but should then exist on the host machine + foofile = environment.workdir.join("foo") + + assert_execute("vagrant", "up") + foofile.exist?.should_not be, + "'foo' should not exist yet." + + assert_execute("vagrant", "ssh", "-c", "touch /vagrant/foo") + foofile.exist?.should be, "'foo' should exist since it was touched in the shared folder" + end + =begin TODO: should "be able to run if `Vagrantfile` is in parent directory" - should "bring up a running virtual machine and have a `/vagrant' shared folder by default" should "destroy a running virtual machine" should "save then restore a virtual machine using `vagrant up`" should "halt then start a virtual machine using `vagrant up`"