kitchen-machine 0.1.0
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 +7 -0
- data/.gitignore +17 -0
- data/.rubocop.yml +2 -0
- data/.travis.yml +12 -0
- data/CHANGELOG.md +0 -0
- data/Gemfile +2 -0
- data/LICENSE +15 -0
- data/README.md +51 -0
- data/Rakefile +10 -0
- data/kitchen-machine.gemspec +25 -0
- data/lib/kitchen/driver/machine.rb +73 -0
- data/lib/kitchen/driver/machine_version.rb +24 -0
- metadata +104 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: db802b0ace6d412acf450c1dc2fea3cd1ff6dcf7
|
|
4
|
+
data.tar.gz: 8281d2897e95f5cf7b6e3793cdfd672f43cb2104
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: b5c63a71a3167aaf93415ba39087642eaf708e4ef389f736955d15e4dd35c26bdc59c169bccb6731d2178ec9a4e3c205442006f62e8af6fc782a6d2613a84f18
|
|
7
|
+
data.tar.gz: 1beff58e61c66671200a49e072ae7a3c3b9b9811dd372c05eaa59611dff4d2872ec56533413a2684be73d0e6d8d6ff2b1838974c7e00d5b1a5e9a85da872cab8
|
data/.gitignore
ADDED
data/.rubocop.yml
ADDED
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
|
File without changes
|
data/Gemfile
ADDED
data/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Author:: Matt Wrock (<matt@mattwrock.com>)
|
|
2
|
+
|
|
3
|
+
Copyright (C) 2016, Matt Wrock
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
data/README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# <a name="title"></a> Kitchen::Machine
|
|
2
|
+
|
|
3
|
+
A Test Kitchen Driver with no hypervisor or cloud abstraction.
|
|
4
|
+
|
|
5
|
+
This driver is an extremely stripped down driver and assumes that an available machine is ready to accept SSH or WinRM connections.
|
|
6
|
+
|
|
7
|
+
## <a name="installation"></a> Installation and Setup
|
|
8
|
+
|
|
9
|
+
Please read the [Driver usage][driver_usage] page for more details.
|
|
10
|
+
|
|
11
|
+
## <a name="default-config"></a> Default Configuration
|
|
12
|
+
|
|
13
|
+
```yaml
|
|
14
|
+
---
|
|
15
|
+
driver:
|
|
16
|
+
name: machine
|
|
17
|
+
username: vagrant
|
|
18
|
+
password: vagrant
|
|
19
|
+
hostname: localhost
|
|
20
|
+
port: 22 or 5985 depending on transport
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## <a name="development"></a> Development
|
|
24
|
+
|
|
25
|
+
* Source hosted at [GitHub][repo]
|
|
26
|
+
* Report issues/questions/feature requests on [GitHub Issues][issues]
|
|
27
|
+
|
|
28
|
+
Pull requests are very welcome! Make sure your patches are well tested.
|
|
29
|
+
Ideally create a topic branch for every separate change you make. For
|
|
30
|
+
example:
|
|
31
|
+
|
|
32
|
+
1. Fork the repo
|
|
33
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
34
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
|
35
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
|
36
|
+
5. Create new Pull Request
|
|
37
|
+
|
|
38
|
+
## <a name="authors"></a> Authors
|
|
39
|
+
|
|
40
|
+
Created and maintained by [Matt Wrock][author] (<matt@mattwrock.com>)
|
|
41
|
+
|
|
42
|
+
## <a name="license"></a> License
|
|
43
|
+
|
|
44
|
+
Apache 2.0 (see [LICENSE][license])
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
[author]: https://github.com/mwrock
|
|
48
|
+
[issues]: https://github.com/mwrock/kitchen-machine/issues
|
|
49
|
+
[license]: https://github.com/mwrock/kitchen-machine/blob/master/LICENSE
|
|
50
|
+
[repo]: https://github.com/mwrock/kitchen-machine
|
|
51
|
+
[driver_usage]: http://kitchen.ci/docs/getting-started/adding-platform
|
data/Rakefile
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require 'kitchen/driver/machine_version.rb'
|
|
5
|
+
require 'English'
|
|
6
|
+
|
|
7
|
+
Gem::Specification.new do |gem|
|
|
8
|
+
gem.name = 'kitchen-machine'
|
|
9
|
+
gem.version = Kitchen::Driver::MACHINE_VERSION
|
|
10
|
+
gem.license = 'Apache 2.0'
|
|
11
|
+
gem.authors = ['Matt Wrock']
|
|
12
|
+
gem.email = ['matt@mattwrock.com']
|
|
13
|
+
gem.description = 'Kitchen::Driver::Machine - A Test Kitchen driver with no Hypervisor or cloud'
|
|
14
|
+
gem.summary = gem.description
|
|
15
|
+
gem.homepage = 'https://github.com/mwrock/kitchen-machine/'
|
|
16
|
+
|
|
17
|
+
gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
|
18
|
+
gem.executables = []
|
|
19
|
+
gem.require_paths = ['lib']
|
|
20
|
+
|
|
21
|
+
gem.add_dependency 'test-kitchen', '~> 1.4'
|
|
22
|
+
|
|
23
|
+
gem.add_development_dependency 'rake'
|
|
24
|
+
gem.add_development_dependency 'rubocop', '~> 0.37', '>= 0.37.1'
|
|
25
|
+
end
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
|
2
|
+
#
|
|
3
|
+
# Author:: Matt Wrock (<matt@mattwrock.com>)
|
|
4
|
+
|
|
5
|
+
# Copyright (C) 2016, Matt Wrock
|
|
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 'kitchen'
|
|
20
|
+
require 'kitchen/driver/machine_version'
|
|
21
|
+
|
|
22
|
+
module Kitchen
|
|
23
|
+
module Driver
|
|
24
|
+
# Machine driver for Kitchen.
|
|
25
|
+
class Machine < Kitchen::Driver::Base
|
|
26
|
+
kitchen_driver_api_version 2
|
|
27
|
+
|
|
28
|
+
plugin_version Kitchen::Driver::MACHINE_VERSION
|
|
29
|
+
|
|
30
|
+
default_config :hostname, 'localhost'
|
|
31
|
+
|
|
32
|
+
default_config(:port) do |driver|
|
|
33
|
+
driver.instance.transport.name.downcase =~ /win_?rm/ ? 5985 : 22
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
default_config :username, 'vagrant'
|
|
37
|
+
|
|
38
|
+
default_config :password, 'vagrant'
|
|
39
|
+
|
|
40
|
+
# Creates a instance.
|
|
41
|
+
#
|
|
42
|
+
# @param state [Hash] mutable instance state
|
|
43
|
+
# @raise [ActionFailed] if the action could not be completed
|
|
44
|
+
def create(state)
|
|
45
|
+
update_state(state)
|
|
46
|
+
instance.transport.connection(state).wait_until_ready
|
|
47
|
+
info("Machine instance #{instance.to_str} ready.")
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Destroys an instance.
|
|
51
|
+
#
|
|
52
|
+
# @param state [Hash] mutable instance state
|
|
53
|
+
# @raise [ActionFailed] if the action could not be completed
|
|
54
|
+
def destroy(state)
|
|
55
|
+
instance.transport.connection(state).close
|
|
56
|
+
state.delete(:hostname)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
protected
|
|
60
|
+
|
|
61
|
+
# Updates any state after creation.
|
|
62
|
+
#
|
|
63
|
+
# @param state [Hash] mutable instance state
|
|
64
|
+
# @api private
|
|
65
|
+
def update_state(state)
|
|
66
|
+
state[:hostname] = config[:hostname]
|
|
67
|
+
state[:port] = config[:port]
|
|
68
|
+
state[:username] = config[:username]
|
|
69
|
+
state[:password] = config[:password]
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
|
2
|
+
#
|
|
3
|
+
# Author:: Matt Wrock (<matt@mattwrock.com>)
|
|
4
|
+
|
|
5
|
+
# Copyright (C) 2016, Matt Wrock
|
|
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
|
+
module Driver
|
|
21
|
+
# Version string for Machine Kitchen driver
|
|
22
|
+
MACHINE_VERSION = '0.1.0'.freeze
|
|
23
|
+
end
|
|
24
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: kitchen-machine
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Matt Wrock
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2016-03-05 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: test-kitchen
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.4'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.4'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: rake
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '0'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - ">="
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '0'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: rubocop
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '0.37'
|
|
48
|
+
- - ">="
|
|
49
|
+
- !ruby/object:Gem::Version
|
|
50
|
+
version: 0.37.1
|
|
51
|
+
type: :development
|
|
52
|
+
prerelease: false
|
|
53
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
54
|
+
requirements:
|
|
55
|
+
- - "~>"
|
|
56
|
+
- !ruby/object:Gem::Version
|
|
57
|
+
version: '0.37'
|
|
58
|
+
- - ">="
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: 0.37.1
|
|
61
|
+
description: Kitchen::Driver::Machine - A Test Kitchen driver with no Hypervisor or
|
|
62
|
+
cloud
|
|
63
|
+
email:
|
|
64
|
+
- matt@mattwrock.com
|
|
65
|
+
executables: []
|
|
66
|
+
extensions: []
|
|
67
|
+
extra_rdoc_files: []
|
|
68
|
+
files:
|
|
69
|
+
- ".gitignore"
|
|
70
|
+
- ".rubocop.yml"
|
|
71
|
+
- ".travis.yml"
|
|
72
|
+
- CHANGELOG.md
|
|
73
|
+
- Gemfile
|
|
74
|
+
- LICENSE
|
|
75
|
+
- README.md
|
|
76
|
+
- Rakefile
|
|
77
|
+
- kitchen-machine.gemspec
|
|
78
|
+
- lib/kitchen/driver/machine.rb
|
|
79
|
+
- lib/kitchen/driver/machine_version.rb
|
|
80
|
+
homepage: https://github.com/mwrock/kitchen-machine/
|
|
81
|
+
licenses:
|
|
82
|
+
- Apache 2.0
|
|
83
|
+
metadata: {}
|
|
84
|
+
post_install_message:
|
|
85
|
+
rdoc_options: []
|
|
86
|
+
require_paths:
|
|
87
|
+
- lib
|
|
88
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
89
|
+
requirements:
|
|
90
|
+
- - ">="
|
|
91
|
+
- !ruby/object:Gem::Version
|
|
92
|
+
version: '0'
|
|
93
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
|
+
requirements:
|
|
95
|
+
- - ">="
|
|
96
|
+
- !ruby/object:Gem::Version
|
|
97
|
+
version: '0'
|
|
98
|
+
requirements: []
|
|
99
|
+
rubyforge_project:
|
|
100
|
+
rubygems_version: 2.5.2
|
|
101
|
+
signing_key:
|
|
102
|
+
specification_version: 4
|
|
103
|
+
summary: Kitchen::Driver::Machine - A Test Kitchen driver with no Hypervisor or cloud
|
|
104
|
+
test_files: []
|