test-kitchen 1.0.0.alpha.5 → 1.0.0.alpha.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,19 @@
1
+ ## 1.0.0.alpha.6 / 2013-05-08
2
+
3
+ ### New features
4
+
5
+ * Pull request [#77][]: Support encrypted data bag secrets ([@arunthampi][])
6
+ * Issue [#92][]: Support single cookbook with no dependencies and no Berksfile. ([@fnichol][])
7
+
8
+ ### Bug fixes
9
+
10
+ * Fix Omnibus installation on nodes using plain sh (vs. bash). ([@fnichol][])
11
+
12
+ ### Improvements
13
+
14
+ * Issue [#84][]: Fix `kitchen list` heading alignment. ([@fnichol][])
15
+
16
+
1
17
  ## 1.0.0.alpha.5 / 2013-04-23
2
18
 
3
19
  ### Improvements
@@ -81,18 +97,22 @@
81
97
  The initial release.
82
98
 
83
99
  <!--- The following link definition list is generated by PimpMyChangelog --->
84
- [#61]: https://github.com/opscode/test/issues/61
85
- [#64]: https://github.com/opscode/test/issues/64
86
- [#65]: https://github.com/opscode/test/issues/65
87
- [#71]: https://github.com/opscode/test/issues/71
88
- [#73]: https://github.com/opscode/test/issues/73
89
- [#74]: https://github.com/opscode/test/issues/74
90
- [#76]: https://github.com/opscode/test/issues/76
91
- [#80]: https://github.com/opscode/test/issues/80
92
- [#81]: https://github.com/opscode/test/issues/81
93
- [#82]: https://github.com/opscode/test/issues/82
100
+ [#61]: https://github.com/opscode/test-kitchen/issues/61
101
+ [#64]: https://github.com/opscode/test-kitchen/issues/64
102
+ [#65]: https://github.com/opscode/test-kitchen/issues/65
103
+ [#71]: https://github.com/opscode/test-kitchen/issues/71
104
+ [#73]: https://github.com/opscode/test-kitchen/issues/73
105
+ [#74]: https://github.com/opscode/test-kitchen/issues/74
106
+ [#76]: https://github.com/opscode/test-kitchen/issues/76
107
+ [#77]: https://github.com/opscode/test-kitchen/issues/77
108
+ [#80]: https://github.com/opscode/test-kitchen/issues/80
109
+ [#81]: https://github.com/opscode/test-kitchen/issues/81
110
+ [#82]: https://github.com/opscode/test-kitchen/issues/82
111
+ [#84]: https://github.com/opscode/test-kitchen/issues/84
112
+ [#92]: https://github.com/opscode/test-kitchen/issues/92
94
113
  [@ChrisLundquist]: https://github.com/ChrisLundquist
114
+ [@arunthampi]: https://github.com/arunthampi
95
115
  [@bryanwb]: https://github.com/bryanwb
96
116
  [@fnichol]: https://github.com/fnichol
97
117
  [@mattray]: https://github.com/mattray
98
- [@reset]: https://github.com/reset
118
+ [@reset]: https://github.com/reset
@@ -46,6 +46,7 @@ module Kitchen
46
46
  upload_cookbooks scp
47
47
  upload_data_bags scp if instance.suite.data_bags_path
48
48
  upload_roles scp if instance.suite.roles_path
49
+ upload_secret scp if instance.suite.encrypted_data_bag_secret_key_path
49
50
  end
50
51
  end
51
52
 
@@ -82,6 +83,11 @@ module Kitchen
82
83
  upload_path(scp, instance.suite.roles_path)
83
84
  end
84
85
 
86
+ def upload_secret(scp)
87
+ scp.upload!(instance.suite.encrypted_data_bag_secret_key_path,
88
+ "#{chef_home}/encrypted_data_bag_secret")
89
+ end
90
+
85
91
  def upload_path(scp, path, dir = File.basename(path))
86
92
  dest = "#{chef_home}/#{dir}"
87
93
 
@@ -101,6 +107,10 @@ module Kitchen
101
107
  if instance.suite.data_bags_path
102
108
  solo << %{data_bag_path "#{chef_home}/data_bags"}
103
109
  end
110
+ if instance.suite.encrypted_data_bag_secret_key_path
111
+ secret = "#{chef_home}/encrypted_data_bag_secret"
112
+ solo << %{encrypted_data_bag_secret "#{secret}"}
113
+ end
104
114
  solo.join("\n")
105
115
  end
106
116
 
@@ -117,9 +127,12 @@ module Kitchen
117
127
  run_resolver("Librarian", "librarian-chef", tmpdir)
118
128
  elsif File.directory?(File.join(kitchen_root, "cookbooks"))
119
129
  cp_cookbooks(tmpdir)
130
+ elsif File.exists?(File.join(kitchen_root, "metadata.rb"))
131
+ cp_this_cookbook(tmpdir)
120
132
  else
121
133
  FileUtils.rmtree(tmpdir)
122
- fatal("Berksfile, Cheffile or cookbooks/ must exist in #{kitchen_root}")
134
+ fatal("Berksfile, Cheffile, cookbooks/, or metadata.rb" +
135
+ " must exist in #{kitchen_root}")
123
136
  raise UserError, "Cookbooks could not be found"
124
137
  end
125
138
  end
@@ -304,7 +304,7 @@ module Kitchen
304
304
  when nil then set_color("<Not Created>", :red)
305
305
  else set_color("<Unknown>", :white)
306
306
  end
307
- [instance.name, action]
307
+ [set_color(instance.name, :on_black), action]
308
308
  end
309
309
 
310
310
  def update_config!
@@ -116,9 +116,9 @@ module Kitchen
116
116
 
117
117
  if [ ! -d "/opt/chef" ] || should_update_chef ; then
118
118
  echo "-----> Installing Chef Omnibus (#{flag})"
119
- if command -v wget &>/dev/null ; then
119
+ if command -v wget >/dev/null ; then
120
120
  wget #{url} -O - | sudo bash #{version}
121
- elif command -v curl &>/dev/null ; then
121
+ elif command -v curl >/dev/null ; then
122
122
  curl -sSL #{url} | sudo bash #{version}
123
123
  else
124
124
  echo ">>>>>> Neither wget nor curl found on this instance."
@@ -40,6 +40,10 @@ module Kitchen
40
40
  # not exist
41
41
  attr_reader :data_bags_path
42
42
 
43
+ # @return [String] local path to the suite's encrypted data bag secret
44
+ # key path, or nil if one does not exist
45
+ attr_reader :encrypted_data_bag_secret_key_path
46
+
43
47
  # @return [String] local path to the suite's roles, or nil if one does
44
48
  # not exist
45
49
  attr_reader :roles_path
@@ -54,6 +58,8 @@ module Kitchen
54
58
  # @option options [String] :excludes Array of names of excluded platforms
55
59
  # @option options [String] :data_bags_path path to data bags
56
60
  # @option options [String] :roles_path path to roles
61
+ # @option options [String] :encrypted_data_bag_secret_key_path path to
62
+ # secret key file
57
63
  def initialize(options = {})
58
64
  validate_options(options)
59
65
 
@@ -63,6 +69,7 @@ module Kitchen
63
69
  @excludes = options[:excludes] || Array.new
64
70
  @data_bags_path = options[:data_bags_path]
65
71
  @roles_path = options[:roles_path]
72
+ @encrypted_data_bag_secret_key_path = options[:encrypted_data_bag_secret_key_path]
66
73
  end
67
74
 
68
75
  private
@@ -18,5 +18,5 @@
18
18
 
19
19
  module Kitchen
20
20
 
21
- VERSION = "1.0.0.alpha.5"
21
+ VERSION = "1.0.0.alpha.6"
22
22
  end
@@ -52,13 +52,18 @@ describe Kitchen::Suite do
52
52
  suite.roles_path.must_be_nil
53
53
  end
54
54
 
55
+ it "returns nil given no encrypted_data_bag_secret_key_path" do
56
+ suite.encrypted_data_bag_secret_key_path.must_be_nil
57
+ end
58
+
55
59
  it "returns attributes from constructor" do
56
60
  opts.merge!({ :attributes => { :a => 'b' }, :data_bags_path => 'crazy',
57
- :roles_path => 'town' })
61
+ :roles_path => 'town', :encrypted_data_bag_secret_key_path => 'secret' })
58
62
  suite.name.must_equal 'suitezy'
59
63
  suite.run_list.must_equal ['doowah']
60
64
  suite.attributes.must_equal({ :a => 'b' })
61
65
  suite.data_bags_path.must_equal 'crazy'
62
66
  suite.roles_path.must_equal 'town'
67
+ suite.encrypted_data_bag_secret_key_path.must_equal 'secret'
63
68
  end
64
69
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test-kitchen
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.alpha.5
4
+ version: 1.0.0.alpha.6
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-23 00:00:00.000000000 Z
12
+ date: 2013-05-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: celluloid