From 3412a11c51207ea92ba5f885814792b66aa04796 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 6 Nov 2011 22:17:27 -0800 Subject: [PATCH] Move `vagrant ssh` test into ssh_test.rb --- test/acceptance/ssh_test.rb | 21 +++++++++++++++++++++ test/acceptance/up_basic_test.rb | 18 ------------------ 2 files changed, 21 insertions(+), 18 deletions(-) create mode 100644 test/acceptance/ssh_test.rb diff --git a/test/acceptance/ssh_test.rb b/test/acceptance/ssh_test.rb new file mode 100644 index 000000000..3bbaf8b8c --- /dev/null +++ b/test/acceptance/ssh_test.rb @@ -0,0 +1,21 @@ +require File.expand_path("../base", __FILE__) + +class SSHTest < AcceptanceTest + should "bring up a running virtual machine and be able to SSH into it" do + assert_execute("vagrant", "box", "add", "base", config.boxes["default"]) + assert_execute("vagrant", "init") + assert_execute("vagrant", "up") + + outputted = false + result = assert_execute("vagrant", "ssh") do |io_type, data| + if io_type == :stdin and !outputted + data.puts("echo hello") + data.puts("exit") + outputted = true + end + end + + assert_equal("hello", result.stdout.chomp, + "Vagrant should bring up a virtual machine and be able to SSH in.") + end +end diff --git a/test/acceptance/up_basic_test.rb b/test/acceptance/up_basic_test.rb index 0e287f0f8..abb3a58ec 100644 --- a/test/acceptance/up_basic_test.rb +++ b/test/acceptance/up_basic_test.rb @@ -18,24 +18,6 @@ class UpBasicTest < AcceptanceTest "Virtual machine should be running") end - should "bring up a running virtual machine and be able to SSH into it" do - assert_execute("vagrant", "box", "add", "base", config.boxes["default"]) - assert_execute("vagrant", "init") - assert_execute("vagrant", "up") - - outputted = false - result = assert_execute("vagrant", "ssh") do |io_type, data| - if io_type == :stdin and !outputted - data.puts("echo hello") - data.puts("exit") - outputted = true - end - end - - assert_equal("hello", result.stdout.chomp, - "Vagrant should bring up a virtual machine and be able to SSH in.") - end - =begin TODO: