testlab 1.10.0 → 1.11.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.
- data/lib/testlab/provider.rb +1 -0
- data/lib/testlab/providers/bare_metal.rb +92 -0
- data/lib/testlab/providers/local.rb +2 -0
- data/lib/testlab/version.rb +1 -1
- metadata +5 -4
data/lib/testlab/provider.rb
CHANGED
@@ -10,6 +10,7 @@ class TestLab
|
|
10
10
|
PROXY_METHODS = %w(instance_id state user identity ip port create destroy up down reload status alive? dead? exists?).map(&:to_sym)
|
11
11
|
|
12
12
|
autoload :AWS, 'testlab/providers/aws'
|
13
|
+
autoload :BareMetal, 'testlab/providers/bare_metal'
|
13
14
|
autoload :Local, 'testlab/providers/local'
|
14
15
|
autoload :OpenStack, 'testlab/providers/open_stack'
|
15
16
|
autoload :Vagrant, 'testlab/providers/vagrant'
|
@@ -0,0 +1,92 @@
|
|
1
|
+
class TestLab
|
2
|
+
|
3
|
+
class Provider
|
4
|
+
|
5
|
+
# BareMetal Provider Error Class
|
6
|
+
class BareMetalError < ProviderError; end
|
7
|
+
|
8
|
+
# BareMetal Provider Class
|
9
|
+
#
|
10
|
+
# @author Zachary Patten <zachary AT jovelabs DOT com>
|
11
|
+
class BareMetal
|
12
|
+
|
13
|
+
def initialize(config={}, ui=nil)
|
14
|
+
@config = (config || Hash.new)
|
15
|
+
@ui = (ui || TestLab.ui)
|
16
|
+
|
17
|
+
# ensure our bare_metal key exists
|
18
|
+
@config[:bare_metal] ||= Hash.new
|
19
|
+
end
|
20
|
+
|
21
|
+
# This is a NO-OP
|
22
|
+
def create
|
23
|
+
true
|
24
|
+
end
|
25
|
+
|
26
|
+
# This is a NO-OP
|
27
|
+
def destroy
|
28
|
+
true
|
29
|
+
end
|
30
|
+
|
31
|
+
# This is a NO-OP
|
32
|
+
def up
|
33
|
+
true
|
34
|
+
end
|
35
|
+
|
36
|
+
# This is a NO-OP
|
37
|
+
def down
|
38
|
+
true
|
39
|
+
end
|
40
|
+
|
41
|
+
# This is a NO-OP
|
42
|
+
def reload
|
43
|
+
self.down
|
44
|
+
self.up
|
45
|
+
|
46
|
+
true
|
47
|
+
end
|
48
|
+
|
49
|
+
# This is a NO-OP
|
50
|
+
def state
|
51
|
+
:running
|
52
|
+
end
|
53
|
+
|
54
|
+
# This is a NO-OP
|
55
|
+
def exists?
|
56
|
+
true
|
57
|
+
end
|
58
|
+
|
59
|
+
# This is a NO-OP
|
60
|
+
def alive?
|
61
|
+
true
|
62
|
+
end
|
63
|
+
|
64
|
+
# This is a NO-OP
|
65
|
+
def dead?
|
66
|
+
false
|
67
|
+
end
|
68
|
+
|
69
|
+
def instance_id
|
70
|
+
TestLab.hostname
|
71
|
+
end
|
72
|
+
|
73
|
+
def user
|
74
|
+
(@config[:bare_metal][:user] || ENV['USER'])
|
75
|
+
end
|
76
|
+
|
77
|
+
def identity
|
78
|
+
(@config[:bare_metal][:identity] || File.join(ENV['HOME'], ".ssh", "id_rsa"))
|
79
|
+
end
|
80
|
+
|
81
|
+
def ip
|
82
|
+
(@config[:bare_metal][:ip] || "127.0.0.1")
|
83
|
+
end
|
84
|
+
|
85
|
+
def port
|
86
|
+
(@config[:bare_metal][:port] || 22)
|
87
|
+
end
|
88
|
+
|
89
|
+
end
|
90
|
+
|
91
|
+
end
|
92
|
+
end
|
data/lib/testlab/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: testlab
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.11.0
|
5
5
|
prerelease:
|
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-
|
12
|
+
date: 2013-11-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: gli
|
@@ -273,6 +273,7 @@ files:
|
|
273
273
|
- lib/testlab/node/status.rb
|
274
274
|
- lib/testlab/provider.rb
|
275
275
|
- lib/testlab/providers/aws.rb
|
276
|
+
- lib/testlab/providers/bare_metal.rb
|
276
277
|
- lib/testlab/providers/local.rb
|
277
278
|
- lib/testlab/providers/open_stack.rb
|
278
279
|
- lib/testlab/providers/templates/vagrant/Vagrantfile.erb
|
@@ -349,7 +350,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
349
350
|
version: '0'
|
350
351
|
segments:
|
351
352
|
- 0
|
352
|
-
hash:
|
353
|
+
hash: -2228261480596938404
|
353
354
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
354
355
|
none: false
|
355
356
|
requirements:
|
@@ -358,7 +359,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
358
359
|
version: '0'
|
359
360
|
segments:
|
360
361
|
- 0
|
361
|
-
hash:
|
362
|
+
hash: -2228261480596938404
|
362
363
|
requirements: []
|
363
364
|
rubyforge_project:
|
364
365
|
rubygems_version: 1.8.25
|