toft 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- data/features/chef.feature +50 -50
- data/lib/toft/node.rb +1 -1
- data/lib/toft/version.rb +1 -1
- metadata +4 -4
data/features/chef.feature
CHANGED
@@ -1,69 +1,69 @@
|
|
1
1
|
Feature: Chef support
|
2
2
|
|
3
3
|
Scenario: Run chef recipe on nodes
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
Given I have a clean running node n1
|
5
|
+
When I run "recipe[test]" on node "n1"
|
6
|
+
Then Node "n1" should have file or directory "/tmp/stub/dir"
|
7
7
|
|
8
8
|
Scenario: Run chef recipe with attributes
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
9
|
+
Given I have a clean running node n1
|
10
|
+
When I run "recipe[test::attribute]" on node "n1" and overwrite attributes with:
|
11
|
+
| key | value |
|
12
|
+
| one | one |
|
13
|
+
| two.one | two_one |
|
14
|
+
| two.two | two_two |
|
15
|
+
| three | three |
|
16
|
+
Then Node "n1" should have file or directory "/tmp/stub/one"
|
17
|
+
Then Node "n1" should have file or directory "/tmp/stub/two_one"
|
18
|
+
Then Node "n1" should have file or directory "/tmp/stub/two_two"
|
19
|
+
Then Node "n1" should have file or directory "/tmp/stub/three"
|
20
20
|
|
21
21
|
Scenario: Run multiple chef recipes
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
22
|
+
Given I have a clean running node n1
|
23
|
+
When I run recipes on node "n1":
|
24
|
+
| recipe |
|
25
|
+
| recipe[test::role] |
|
26
|
+
| recipe[test] |
|
27
|
+
Then Node "n1" should have file or directory "/tmp/stub/dir"
|
28
|
+
Then Node "n1" should have file or directory "/tmp/stub/role"
|
29
29
|
|
30
30
|
Scenario: Run chef role
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
31
|
+
Given I have a clean running node n1
|
32
|
+
When I run "role[test]" on node "n1"
|
33
|
+
Then Node "n1" should have file or directory "/tmp/stub/role"
|
34
|
+
|
35
35
|
Scenario: Toft should not deal with empty cookbook and role path
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
36
|
+
Given I have a clean running node n1
|
37
|
+
When I set the role path to empty
|
38
|
+
Then Running chef "recipe[test]" on node "n1" should succeed
|
39
|
+
When I set the cookbook path to empty
|
40
|
+
Then Running chef "recipe[test]" on node "n1" should fail
|
41
41
|
|
42
42
|
Scenario: Run chef recipe with json attributes file
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
43
|
+
Given I have a clean running node n1
|
44
|
+
When I run "recipe[test::attribute]" on node "n1" and overwrite attributes with json file "attributes.json"
|
45
|
+
Then Node "n1" should have file or directory "/tmp/stub/one"
|
46
|
+
Then Node "n1" should have file or directory "/tmp/stub/two_one"
|
47
|
+
Then Node "n1" should have file or directory "/tmp/stub/two_two"
|
48
|
+
Then Node "n1" should have file or directory "/tmp/stub/three"
|
49
49
|
|
50
50
|
Scenario: Attributes table should override attributes in json file
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
51
|
+
Given I have a clean running node n1
|
52
|
+
When I run "recipe[test::attribute]" on node "n1" and overwrite attributes with json file "attributes.json" and chef attributes:
|
53
|
+
| key | value |
|
54
|
+
| one | override |
|
55
|
+
Then Node "n1" should have file or directory "/tmp/stub/override"
|
56
|
+
Then Node "n1" should have file or directory "/tmp/stub/two_one"
|
57
|
+
Then Node "n1" should have file or directory "/tmp/stub/two_two"
|
58
|
+
Then Node "n1" should have file or directory "/tmp/stub/three"
|
59
59
|
|
60
60
|
Scenario: Run chef recipe with data bags
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
61
|
+
Given I have a clean running node n1
|
62
|
+
When I run "recipe[test::data_bag]" on node "n1"
|
63
|
+
Then Node "n1" should have file or directory "/tmp/stub/bag1item1"
|
64
|
+
Then Node "n1" should have file or directory "/tmp/stub/bag1item2"
|
65
|
+
Then Node "n1" should have file or directory "/tmp/stub/bag2item1"
|
66
|
+
Then Node "n1" should have file or directory "/tmp/stub/bag2item2"
|
67
67
|
|
68
68
|
Scenario: Run non-exist recipe
|
69
69
|
|
data/lib/toft/node.rb
CHANGED
@@ -160,7 +160,7 @@ CQWv13UgQjiHgQILXSb7xdzpWK1wpDoqIEWQugRyPQDeZhPWVbB4Lg==
|
|
160
160
|
|
161
161
|
def wait_sshd_running
|
162
162
|
wait_for do
|
163
|
-
netstat = cmd("lxc-netstat
|
163
|
+
netstat = cmd("lxc-netstat -n #{@hostname} -ta")
|
164
164
|
return if netstat =~ /ssh/
|
165
165
|
end
|
166
166
|
end
|
data/lib/toft/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: toft
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 12
|
10
|
+
version: 0.0.12
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Huang Liang
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-06-04 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rspec
|