test/support/integration_test.rb in knife-solo-0.4.3 vs test/support/integration_test.rb in knife-solo-0.5.0
- old
+ new
@@ -64,12 +64,15 @@
end
# Prepares the server unless it has already been marked as such
def prepare_server
return if server.tags["knife_solo_prepared"]
+ if self.class.firewall_disabled
+ system "ssh #{connection_string} service iptables stop >> #{log_file}"
+ end
assert_subcommand prepare_command
- runner.tag_as_prepared(server)
+ runner.tag_as(:prepared, server)
end
# The prepare command to use on this server
def prepare_command
"prepare"
@@ -85,15 +88,27 @@
"-i #{key_file} #{user}@#{server.dns_name}"
end
# Asserts that a knife command is successful
def assert_knife_command(subcommand)
- system "knife #{subcommand} #{connection_string} -VV >> #{log_file}"
+ pid = Process.spawn("knife #{subcommand} #{connection_string} -VV",
+ :out => log_file.to_s,
+ :err => log_file.to_s)
+ Process.wait(pid)
+
assert $?.success?
end
# Asserts that a knife solo subcommand is successful
def assert_subcommand(subcommand)
assert_knife_command "solo #{subcommand}"
+ end
+
+ class << self
+ attr_reader :firewall_disabled
+
+ def disable_firewall
+ @firewall_disabled = true
+ end
end
end