cucumber-chef 2.0.5 → 2.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,15 +1,16 @@
1
1
  #!/usr/bin/env ruby
2
-
3
- if RUBY_VERSION < "1.9"
4
- exit if fork
5
- Process.setsid
6
- exit if fork
7
- Dir.chdir "/"
8
- STDIN.reopen "/dev/null"
9
- STDOUT.reopen "/dev/null", "a"
10
- STDERR.reopen "/dev/null", "a"
11
- else
12
- Process.daemon
2
+ if !ENV['BACKGROUND'].nil?
3
+ if RUBY_VERSION < "1.9"
4
+ exit if fork
5
+ Process.setsid
6
+ exit if fork
7
+ Dir.chdir "/"
8
+ STDIN.reopen "/dev/null"
9
+ STDOUT.reopen "/dev/null", "a"
10
+ STDERR.reopen "/dev/null", "a"
11
+ else
12
+ Process.daemon
13
+ end
13
14
  end
14
15
 
15
16
  Dir.chdir(File.join("/home", "ubuntu"))
@@ -28,6 +29,11 @@ class FrontObject
28
29
  def initialize
29
30
  knife_rb = Cucumber::Chef.locate(:file, ".chef", "knife.rb")
30
31
  Chef::Config.from_file(knife_rb)
32
+
33
+ $logger = ZTK::Logger.new(Cucumber::Chef.log_file)
34
+ Cucumber::Chef.is_rc? and ($logger.level = ZTK::Logger::DEBUG)
35
+
36
+ puts("cc-server v#{Cucumber::Chef::VERSION}")
31
37
  end
32
38
 
33
39
  def shutdown
@@ -42,7 +42,7 @@ module Cucumber::Chef::Helpers::Container
42
42
  when "fedora" then
43
43
  %x( yum --nogpgcheck --installroot=#{cache_rootfs} -y install wget openssh-server )
44
44
  end
45
- %x( chroot #{cache_rootfs} /bin/bash -c 'wget http://opscode.com/chef/install.sh -O - | bash' 2>&1 )
45
+ %x( chroot #{cache_rootfs} /bin/bash -c 'wget http://www.opscode.com/chef/install.sh -O - | bash' 2>&1 )
46
46
  if distro.downcase == "fedora"
47
47
  %x( chroot #{cache_rootfs} /bin/bash -c 'rpm -Uvh --nodeps /tmp/*rpm' 2>&1 )
48
48
  end
@@ -30,9 +30,9 @@ end
30
30
 
31
31
  Then /^I should( not)? see the "([^\"]*)" of "([^\"]*)" in the output$/ do |boolean, key, name|
32
32
  if (!boolean)
33
- @output.should =~ /#{$servers[name][key.downcase.to_sym]}/i
33
+ @output.should =~ /#{$drb_test_lab.servers[name][key.downcase.to_sym]}/i
34
34
  else
35
- @output.should_not =~ /#{$servers[name][key.downcase.to_sym]}/i
35
+ @output.should_not =~ /#{$drb_test_lab.servers[name][key.downcase.to_sym]}/i
36
36
  end
37
37
  end
38
38
 
@@ -29,7 +29,8 @@ if ($test_lab = Cucumber::Chef::TestLab.new) && ($test_lab.labs_running.count >
29
29
  ssh.config.host_name = $test_lab.labs_running.first.public_ip_address
30
30
  ssh.config.user = "ubuntu"
31
31
  ssh.config.keys = Cucumber::Chef.locate(:file, ".cucumber-chef", "id_rsa-#{ssh.config.user}")
32
- ssh.exec("nohup sudo cc-server #{Cucumber::Chef.external_ip}")
32
+ ssh.exec("nohup sudo pkill -9 -f cc-server")
33
+ ssh.exec("nohup sudo BACKGROUND=yes cc-server #{Cucumber::Chef.external_ip}")
33
34
  Cucumber::Chef.spinner do
34
35
  ZTK::TCPSocketCheck.new(:host => $test_lab.labs_running.first.public_ip_address, :port => 8787, :data => "\n\n").wait
35
36
  end
@@ -6,7 +6,7 @@ Feature: Perform test driven infrastructure with Cucumber-Chef
6
6
 
7
7
  Background:
8
8
  * I have a server called "<%= @project %>"
9
- * "<%= @project %>" is running "ubuntu" "lucid"
9
+ * "<%= @project %>" is running "ubuntu" "precise"
10
10
  * "<%= @project %>" has been provisioned
11
11
  * the "chef-client::service" recipe has been added to the "<%= @project %>" run list
12
12
  * the chef-client has been run on "<%= @project %>"
@@ -24,7 +24,7 @@ module Cucumber
24
24
 
25
25
  ################################################################################
26
26
 
27
- VERSION = "2.0.5" unless const_defined?(:VERSION)
27
+ VERSION = "2.0.6" unless const_defined?(:VERSION)
28
28
 
29
29
  ################################################################################
30
30
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber-chef
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 2.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: