bin/cucumber-chef in cucumber-chef-2.1.0.rc.11 vs bin/cucumber-chef in cucumber-chef-2.1.0.rc.12
- old
+ new
@@ -1,10 +1,11 @@
#!/usr/bin/env ruby
require 'thor'
require 'cucumber-chef'
+
# $logger = Cucumber::Chef.logger
class CucumberChef < Thor
include Thor::Actions
@@ -53,11 +54,11 @@
end
end
def boot
tag = Cucumber::Chef.tag("cucumber-chef")
- puts(set_color(tag, :green, true))
+ puts(tag)
Cucumber::Chef.boot(tag)
$logger = Cucumber::Chef.logger
@is_rc = Cucumber::Chef.is_rc?
@@ -202,27 +203,18 @@
sleep(1)
end
puts("BOOM!")
puts
- ZTK::Benchmark.bench(:message => "Start cc-server", :mark => "completed in %0.4f seconds.") do
- test_lab.cc_client.up(:silence => true)
- end
-
args.each do |container|
ZTK::Benchmark.bench(:message => "Destroy container '#{container}'", :mark => "completed in %0.4f seconds.") do
- test_lab.drb.load_containers
- test_lab.drb.server_destroy(container)
- test_lab.drb.server_delete(container)
- test_lab.drb.save_containers
+ test_lab.containers.load
+ test_lab.containers.destroy(container)
+ test_lab.containers.save
end
end
- ZTK::Benchmark.bench(:message => "Stop cc-server", :mark => "completed in %0.4f seconds.") do
- test_lab.cc_client.down
- end
-
else
puts
puts(set_color("Whew! That was close!", :green, true))
end
@@ -316,23 +308,20 @@
boot
if (test_lab = Cucumber::Chef::TestLab.new)
if @options.containers?
if test_lab.alive?
- ZTK::Benchmark.bench(:message => "Start cc-server", :mark => "completed in %0.4f seconds.") do
- test_lab.cc_client.up(:silence => true)
- end
- test_lab.drb.load_containers
+ test_lab.containers.load
- if test_lab.drb.containers.count > 0
+ if test_lab.containers.count > 0
headers = [:name, :alive, :arch, :distro, :ip, :mac, :"chef version", :persist]
- results = ZTK::Report.new.spreadsheet(test_lab.drb.containers, headers) do |name, detail|
+ results = ZTK::Report.new.spreadsheet(test_lab.containers.to_a, headers) do |name, detail|
chef_version = "N/A"
- alive = (test_lab.drb.command_run_local(%Q{ping -n -c 1 -W 1 #{detail[:ip]}}, :ignore_exit_status => true).exit_code == 0)
+ alive = (test_lab.bootstrap_ssh(:ignore_exit_status => true).exec(%Q{ping -n -c 1 -W 1 #{detail[:ip]}}, :silence => true).exit_code == 0)
if alive
- chef_version = test_lab.drb.command_run_chroot(name, %Q{/usr/bin/env chef-client -v}, :ignore_exit_status => true).output.chomp
+ chef_version = test_lab.proxy_ssh(name, :ignore_exit_status => true).exec(%Q{/usr/bin/env chef-client -v}, :silence => true).output.chomp
end
OpenStruct.new(
:name => name,
:ip => detail[:ip],
@@ -357,12 +346,9 @@
end
else
raise Cucumber::Chef::Error, "We could not find any containers!"
end
- ZTK::Benchmark.bench(:message => "Stop cc-server", :mark => "completed in %0.4f seconds.") do
- test_lab.cc_client.down
- end
else
raise Cucumber::Chef::Error, "We could not find a running test lab."
end
else