test-kitchen 1.0.0.beta.3 → 1.0.0.beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +2 -0
- data/CHANGELOG.md +41 -0
- data/Gemfile +3 -2
- data/Rakefile +1 -0
- data/lib/kitchen.rb +2 -16
- data/lib/kitchen/busser.rb +38 -14
- data/lib/kitchen/cli.rb +11 -16
- data/lib/kitchen/config.rb +2 -47
- data/lib/kitchen/driver/base.rb +1 -2
- data/lib/kitchen/driver/proxy.rb +58 -0
- data/lib/kitchen/driver/ssh_base.rb +6 -0
- data/lib/kitchen/instance.rb +0 -1
- data/lib/kitchen/provisioner/chef_base.rb +78 -44
- data/lib/kitchen/provisioner/chef_solo.rb +18 -1
- data/lib/kitchen/provisioner/chef_zero.rb +39 -6
- data/lib/kitchen/rake_tasks.rb +0 -1
- data/lib/kitchen/ssh.rb +1 -0
- data/lib/kitchen/suite.rb +17 -0
- data/lib/kitchen/thor_tasks.rb +0 -1
- data/lib/kitchen/util.rb +120 -0
- data/lib/kitchen/version.rb +1 -1
- data/spec/kitchen/instance_spec.rb +0 -4
- data/test-kitchen.gemspec +22 -25
- metadata +73 -116
- data/lib/kitchen/instance_actor.rb +0 -42
- data/lib/kitchen/manager.rb +0 -45
@@ -1,42 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
#
|
3
|
-
# Author:: Fletcher Nichol (<fnichol@nichol.ca>)
|
4
|
-
#
|
5
|
-
# Copyright (C) 2013, Fletcher Nichol
|
6
|
-
#
|
7
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
-
# you may not use this file except in compliance with the License.
|
9
|
-
# You may obtain a copy of the License at
|
10
|
-
#
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
#
|
13
|
-
# Unless required by applicable law or agreed to in writing, software
|
14
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
-
# See the License for the specific language governing permissions and
|
17
|
-
# limitations under the License.
|
18
|
-
|
19
|
-
require 'delegate'
|
20
|
-
|
21
|
-
module Kitchen
|
22
|
-
|
23
|
-
# A delegator for Instance which adds Celluloid actor support, boom.
|
24
|
-
#
|
25
|
-
# @author Fletcher Nichol <fnichol@nichol.ca>
|
26
|
-
class InstanceActor < SimpleDelegator
|
27
|
-
|
28
|
-
include Celluloid
|
29
|
-
|
30
|
-
# @!method actor_name()
|
31
|
-
# Returns the name of the Celluloid actor.
|
32
|
-
# @return [String] the actor name
|
33
|
-
alias_method :actor_name, :name
|
34
|
-
|
35
|
-
# Returns the name of the underlying instance.
|
36
|
-
#
|
37
|
-
# @return [String] the instance name
|
38
|
-
def name
|
39
|
-
__getobj__.name
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
data/lib/kitchen/manager.rb
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
#
|
3
|
-
# Author:: Fletcher Nichol (<fnichol@nichol.ca>)
|
4
|
-
#
|
5
|
-
# Copyright (C) 2013, Fletcher Nichol
|
6
|
-
#
|
7
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
-
# you may not use this file except in compliance with the License.
|
9
|
-
# You may obtain a copy of the License at
|
10
|
-
#
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
#
|
13
|
-
# Unless required by applicable law or agreed to in writing, software
|
14
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
-
# See the License for the specific language governing permissions and
|
17
|
-
# limitations under the License.
|
18
|
-
|
19
|
-
module Kitchen
|
20
|
-
|
21
|
-
# A class to manage actors.
|
22
|
-
#
|
23
|
-
# @author Fletcher Nichol <fnichol@nichol.ca>
|
24
|
-
class Manager
|
25
|
-
|
26
|
-
include Celluloid
|
27
|
-
|
28
|
-
trap_exit :actor_died
|
29
|
-
|
30
|
-
# Terminate all actors that are linked.
|
31
|
-
def stop
|
32
|
-
Array(links.to_a).map { |actor| actor.terminate if actor.alive? }
|
33
|
-
end
|
34
|
-
|
35
|
-
private
|
36
|
-
|
37
|
-
def actor_died(actor, reason)
|
38
|
-
if reason.nil?
|
39
|
-
Kitchen.logger.debug("Actor terminated cleanly")
|
40
|
-
else
|
41
|
-
Kitchen.logger.debug("An actor crashed due to #{reason.inspect}")
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|