beaker-hostgenerator 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG.md +4 -0
- data/HISTORY.md +233 -2
- data/README.md +50 -11
- data/beaker-hostgenerator.gemspec +2 -2
- data/lib/beaker-hostgenerator.rb +0 -1
- data/lib/beaker-hostgenerator/cli.rb +38 -26
- data/lib/beaker-hostgenerator/data.rb +960 -35
- data/lib/beaker-hostgenerator/generator.rb +57 -97
- data/lib/beaker-hostgenerator/hypervisor.rb +97 -0
- data/lib/beaker-hostgenerator/hypervisor/none.rb +17 -0
- data/lib/beaker-hostgenerator/hypervisor/vmpooler.rb +32 -0
- data/lib/beaker-hostgenerator/parser.rb +199 -0
- data/lib/beaker-hostgenerator/roles.rb +21 -14
- data/lib/beaker-hostgenerator/util.rb +10 -29
- data/lib/beaker-hostgenerator/version.rb +1 -1
- data/spec/beaker-hostgenerator/generator_spec.rb +73 -109
- data/spec/beaker-hostgenerator/parser_spec.rb +84 -0
- data/test/fixtures/default/cisconx-64a +1 -1
- data/test/fixtures/default/windows10ent-32d +22 -0
- data/test/fixtures/default/windows10ent-64f +22 -0
- data/test/fixtures/default/windows10pro-64m +22 -0
- data/test/fixtures/default/windows2003-6432d +22 -0
- data/test/fixtures/default/windows2003-64c +22 -0
- data/test/fixtures/default/windows2003r2-32f +22 -0
- data/test/fixtures/default/windows2003r2-6432aulcdfm +27 -0
- data/test/fixtures/default/windows2003r2-64m +22 -0
- data/test/fixtures/default/windows2008-6432u +22 -0
- data/test/fixtures/default/windows2008-64a +21 -0
- data/test/fixtures/default/windows2008r2-6432c +22 -0
- data/test/fixtures/default/windows2008r2-64l +22 -0
- data/test/fixtures/default/windows2012-6432f +22 -0
- data/test/fixtures/default/windows2012-64d +22 -0
- data/test/fixtures/default/windows2012r2-6432aulcdfm +27 -0
- data/test/fixtures/default/windows2012r2-64m +22 -0
- data/test/fixtures/default/windows7-64a +21 -0
- data/test/fixtures/default/windows8-64u +22 -0
- data/test/fixtures/default/windows81-64l +22 -0
- data/test/fixtures/default/windowsvista-64c +22 -0
- data/test/fixtures/multiplatform/arista4-32a-windows10pro-64-arista4-32aulcdfm +47 -0
- data/test/fixtures/multiplatform/centos4-32u-windows10ent-64-centos4-32m +43 -0
- data/test/fixtures/multiplatform/centos4-64l-windows10ent-32-centos4-64f +43 -0
- data/test/fixtures/multiplatform/centos5-32c-windowsvista-64-centos5-32d +43 -0
- data/test/fixtures/multiplatform/centos5-64d-windows81-64-centos5-64c +43 -0
- data/test/fixtures/multiplatform/centos6-32f-windows8-64-centos6-32l +43 -0
- data/test/fixtures/multiplatform/centos6-64m-windows7-64-centos6-64u +43 -0
- data/test/fixtures/multiplatform/centos7-64aulcdfm-windows2012r2-6432-centos7-64a +47 -0
- data/test/fixtures/multiplatform/cisconx-64a-windows2012r2-64-cisconx-64aulcdfm +53 -0
- data/test/fixtures/multiplatform/ciscoxr-64u-windows2012-6432-ciscoxr-64m +43 -0
- data/test/fixtures/multiplatform/cumulus25-64l-windows2012-64-cumulus25-64f +43 -0
- data/test/fixtures/multiplatform/debian6-32c-windows2008r2-6432-debian6-32d +43 -0
- data/test/fixtures/multiplatform/debian6-64d-windows2008r2-64-debian6-64c +43 -0
- data/test/fixtures/multiplatform/debian7-32f-windows2008-6432-debian7-32l +43 -0
- data/test/fixtures/multiplatform/debian7-64m-windows2008-64-debian7-64u +43 -0
- data/test/fixtures/multiplatform/debian8-32aulcdfm-windows2003r2-6432-debian8-32a +47 -0
- data/test/fixtures/multiplatform/debian8-64a-windows2003r2-64-debian8-64aulcdfm +47 -0
- data/test/fixtures/multiplatform/debian9-32u-windows2003r2-32-debian9-32m +43 -0
- data/test/fixtures/multiplatform/debian9-64l-windows2003-6432-debian9-64f +43 -0
- data/test/fixtures/multiplatform/fedora14-32l-solaris11-64-fedora14-32f +42 -0
- data/test/fixtures/multiplatform/fedora19-32c-solaris11-32-fedora19-32d +42 -0
- data/test/fixtures/multiplatform/fedora19-64d-solaris10-64-fedora19-64c +42 -0
- data/test/fixtures/multiplatform/fedora20-32f-solaris10-32-fedora20-32l +42 -0
- data/test/fixtures/multiplatform/fedora20-64m-sles12-64-fedora20-64u +42 -0
- data/test/fixtures/multiplatform/fedora21-32aulcdfm-sles11-64-fedora21-32a +46 -0
- data/test/fixtures/multiplatform/fedora21-64a-sles11-32-fedora21-64aulcdfm +46 -0
- data/test/fixtures/multiplatform/fedora22-32u-sles10-64-fedora22-32m +42 -0
- data/test/fixtures/multiplatform/fedora22-64l-sles10-32-fedora22-64f +42 -0
- data/test/fixtures/multiplatform/fedora23-32c-scientific7-64-fedora23-32d +42 -0
- data/test/fixtures/multiplatform/fedora23-64d-scientific6-64-fedora23-64c +42 -0
- data/test/fixtures/multiplatform/opensuse11-32f-scientific6-32-opensuse11-32l +42 -0
- data/test/fixtures/multiplatform/opensuse11-64m-scientific5-64-opensuse11-64u +42 -0
- data/test/fixtures/multiplatform/oracle5-32c-windows2003-64-oracle5-32d +43 -0
- data/test/fixtures/multiplatform/oracle5-64d-ubuntu1604-64-oracle5-64c +42 -0
- data/test/fixtures/multiplatform/oracle6-32f-ubuntu1604-32-oracle6-32l +42 -0
- data/test/fixtures/multiplatform/oracle6-64m-ubuntu1510-64-oracle6-64u +42 -0
- data/test/fixtures/multiplatform/oracle7-64aulcdfm-ubuntu1510-32-oracle7-64a +46 -0
- data/test/fixtures/multiplatform/osx1010-64u-ubuntu1504-32-osx1010-64m +42 -0
- data/test/fixtures/multiplatform/osx1011-64l-ubuntu1404-64-osx1011-64f +42 -0
- data/test/fixtures/multiplatform/osx109-64a-ubuntu1504-64-osx109-64aulcdfm +46 -0
- data/test/fixtures/multiplatform/redhat4-32c-ubuntu1404-32-redhat4-32d +42 -0
- data/test/fixtures/multiplatform/redhat4-64d-ubuntu1204-64-redhat4-64c +42 -0
- data/test/fixtures/multiplatform/redhat5-32f-ubuntu1204-32-redhat5-32l +42 -0
- data/test/fixtures/multiplatform/redhat5-64m-ubuntu1004-64-redhat5-64u +42 -0
- data/test/fixtures/multiplatform/redhat6-32aulcdfm-ubuntu1004-32-redhat6-32a +46 -0
- data/test/fixtures/multiplatform/redhat6-64a-solaris112-64-redhat6-64aulcdfm +46 -0
- data/test/fixtures/multiplatform/redhat7-64u-solaris112-32-redhat7-64m +42 -0
- data/test/fixtures/multiplatform/scientific5-32aulcdfm-scientific5-32-scientific5-32a +46 -0
- data/test/fixtures/multiplatform/scientific5-64a-opensuse11-64-scientific5-64aulcdfm +46 -0
- data/test/fixtures/multiplatform/scientific6-32u-opensuse11-32-scientific6-32m +42 -0
- data/test/fixtures/multiplatform/scientific6-64l-fedora23-64-scientific6-64f +42 -0
- data/test/fixtures/multiplatform/scientific7-64c-fedora23-32-scientific7-64d +42 -0
- data/test/fixtures/multiplatform/sles10-32d-fedora22-64-sles10-32c +42 -0
- data/test/fixtures/multiplatform/sles10-64f-fedora22-32-sles10-64l +42 -0
- data/test/fixtures/multiplatform/sles11-32m-fedora21-64-sles11-32u +42 -0
- data/test/fixtures/multiplatform/sles11-64aulcdfm-fedora21-32-sles11-64a +46 -0
- data/test/fixtures/multiplatform/sles12-64a-fedora20-64-sles12-64aulcdfm +46 -0
- data/test/fixtures/multiplatform/solaris10-32u-fedora20-32-solaris10-32m +42 -0
- data/test/fixtures/multiplatform/solaris10-64l-fedora19-64-solaris10-64f +42 -0
- data/test/fixtures/multiplatform/solaris11-32c-fedora19-32-solaris11-32d +42 -0
- data/test/fixtures/multiplatform/solaris11-64d-fedora14-32-solaris11-64c +42 -0
- data/test/fixtures/multiplatform/solaris112-32f-redhat7-64-solaris112-32l +42 -0
- data/test/fixtures/multiplatform/solaris112-64m-redhat6-64-solaris112-64u +42 -0
- data/test/fixtures/multiplatform/ubuntu1004-32aulcdfm-redhat6-32-ubuntu1004-32a +46 -0
- data/test/fixtures/multiplatform/ubuntu1004-64a-redhat5-64-ubuntu1004-64aulcdfm +46 -0
- data/test/fixtures/multiplatform/ubuntu1204-32u-redhat5-32-ubuntu1204-32m +42 -0
- data/test/fixtures/multiplatform/ubuntu1204-64l-redhat4-64-ubuntu1204-64f +42 -0
- data/test/fixtures/multiplatform/ubuntu1404-32c-redhat4-32-ubuntu1404-32d +42 -0
- data/test/fixtures/multiplatform/ubuntu1404-64d-osx1011-64-ubuntu1404-64c +42 -0
- data/test/fixtures/multiplatform/ubuntu1504-32f-osx1010-64-ubuntu1504-32l +42 -0
- data/test/fixtures/multiplatform/ubuntu1504-64m-osx109-64-ubuntu1504-64u +42 -0
- data/test/fixtures/multiplatform/ubuntu1510-32aulcdfm-oracle7-64-ubuntu1510-32a +46 -0
- data/test/fixtures/multiplatform/ubuntu1510-64a-oracle6-64-ubuntu1510-64aulcdfm +46 -0
- data/test/fixtures/multiplatform/ubuntu1604-32u-oracle6-32-ubuntu1604-32m +42 -0
- data/test/fixtures/multiplatform/ubuntu1604-64l-oracle5-64-ubuntu1604-64f +42 -0
- data/test/fixtures/multiplatform/windows10ent-32d-centos4-64-windows10ent-32c +44 -0
- data/test/fixtures/multiplatform/windows10ent-64f-centos4-32-windows10ent-64l +44 -0
- data/test/fixtures/multiplatform/windows10pro-64m-arista4-32-windows10pro-64u +44 -0
- data/test/fixtures/multiplatform/windows2003-6432d-debian9-64-windows2003-6432c +44 -0
- data/test/fixtures/multiplatform/windows2003-64c-oracle5-32-windows2003-64d +44 -0
- data/test/fixtures/multiplatform/windows2003r2-32f-debian9-32-windows2003r2-32l +44 -0
- data/test/fixtures/multiplatform/windows2003r2-6432aulcdfm-debian8-32-windows2003r2-6432a +48 -0
- data/test/fixtures/multiplatform/windows2003r2-64m-debian8-64-windows2003r2-64u +44 -0
- data/test/fixtures/multiplatform/windows2008-6432u-debian7-32-windows2008-6432m +44 -0
- data/test/fixtures/multiplatform/windows2008-64a-debian7-64-windows2008-64aulcdfm +48 -0
- data/test/fixtures/multiplatform/windows2008r2-6432c-debian6-32-windows2008r2-6432d +44 -0
- data/test/fixtures/multiplatform/windows2008r2-64l-debian6-64-windows2008r2-64f +44 -0
- data/test/fixtures/multiplatform/windows2012-6432f-ciscoxr-64-windows2012-6432l +44 -0
- data/test/fixtures/multiplatform/windows2012-64d-cumulus25-64-windows2012-64c +44 -0
- data/test/fixtures/multiplatform/windows2012r2-6432aulcdfm-centos7-64-windows2012r2-6432a +48 -0
- data/test/fixtures/multiplatform/windows2012r2-64m-cisconx-64-windows2012r2-64u +47 -0
- data/test/fixtures/multiplatform/windows7-64a-centos6-64-windows7-64aulcdfm +48 -0
- data/test/fixtures/multiplatform/windows8-64u-centos6-32-windows8-64m +44 -0
- data/test/fixtures/multiplatform/windows81-64l-centos5-64-windows81-64f +44 -0
- data/test/fixtures/multiplatform/windowsvista-64c-centos5-32-windowsvista-64d +44 -0
- data/test/fixtures/osinfo-version-0/cisconx-64a +1 -1
- data/test/fixtures/osinfo-version-0/windows10ent-32d +22 -0
- data/test/fixtures/osinfo-version-0/windows10ent-64f +22 -0
- data/test/fixtures/osinfo-version-0/windows10pro-64m +22 -0
- data/test/fixtures/osinfo-version-0/windows2003-6432d +22 -0
- data/test/fixtures/osinfo-version-0/windows2003-64c +22 -0
- data/test/fixtures/osinfo-version-0/windows2003r2-32f +22 -0
- data/test/fixtures/osinfo-version-0/windows2003r2-6432aulcdfm +27 -0
- data/test/fixtures/osinfo-version-0/windows2003r2-64m +22 -0
- data/test/fixtures/osinfo-version-0/windows2008-6432u +22 -0
- data/test/fixtures/osinfo-version-0/windows2008-64a +21 -0
- data/test/fixtures/osinfo-version-0/windows2008r2-6432c +22 -0
- data/test/fixtures/osinfo-version-0/windows2008r2-64l +22 -0
- data/test/fixtures/osinfo-version-0/windows2012-6432f +22 -0
- data/test/fixtures/osinfo-version-0/windows2012-64d +22 -0
- data/test/fixtures/osinfo-version-0/windows2012r2-6432aulcdfm +27 -0
- data/test/fixtures/osinfo-version-0/windows2012r2-64m +22 -0
- data/test/fixtures/osinfo-version-0/windows7-64a +21 -0
- data/test/fixtures/osinfo-version-0/windows8-64u +22 -0
- data/test/fixtures/osinfo-version-0/windows81-64l +22 -0
- data/test/fixtures/osinfo-version-0/windowsvista-64c +22 -0
- data/test/fixtures/osinfo-version-1/cisconx-64a +1 -1
- data/test/fixtures/osinfo-version-1/windows10ent-32d +22 -0
- data/test/fixtures/osinfo-version-1/windows10ent-64f +22 -0
- data/test/fixtures/osinfo-version-1/windows10pro-64m +22 -0
- data/test/fixtures/osinfo-version-1/windows2003-6432d +22 -0
- data/test/fixtures/osinfo-version-1/windows2003-64c +22 -0
- data/test/fixtures/osinfo-version-1/windows2003r2-32f +22 -0
- data/test/fixtures/osinfo-version-1/windows2003r2-6432aulcdfm +27 -0
- data/test/fixtures/osinfo-version-1/windows2003r2-64m +22 -0
- data/test/fixtures/osinfo-version-1/windows2008-6432u +22 -0
- data/test/fixtures/osinfo-version-1/windows2008-64a +21 -0
- data/test/fixtures/osinfo-version-1/windows2008r2-6432c +22 -0
- data/test/fixtures/osinfo-version-1/windows2008r2-64l +22 -0
- data/test/fixtures/osinfo-version-1/windows2012-6432f +22 -0
- data/test/fixtures/osinfo-version-1/windows2012-64d +22 -0
- data/test/fixtures/osinfo-version-1/windows2012r2-6432aulcdfm +27 -0
- data/test/fixtures/osinfo-version-1/windows2012r2-64m +22 -0
- data/test/fixtures/osinfo-version-1/windows7-64a +21 -0
- data/test/fixtures/osinfo-version-1/windows8-64u +22 -0
- data/test/fixtures/osinfo-version-1/windows81-64l +22 -0
- data/test/fixtures/osinfo-version-1/windowsvista-64c +22 -0
- data/test/fixtures/per-host-settings/arbitrary-settings.yaml +57 -0
- data/test/fixtures/per-host-settings/every-hypervisor.yaml +30 -0
- data/test/fixtures/per-host-settings/malformed-input.yaml +5 -0
- data/test/test_stdout.rb +2 -2
- data/test/util/generator_helpers.rb +12 -4
- metadata +167 -6
- data/lib/beaker-hostgenerator/data/vmpooler.rb +0 -467
- data/lib/beaker-hostgenerator/generator/vmpooler.rb +0 -59
- data/test/test_util.rb +0 -26
@@ -1,59 +0,0 @@
|
|
1
|
-
require 'beaker-hostgenerator/generator'
|
2
|
-
require 'beaker-hostgenerator/data/vmpooler'
|
3
|
-
require 'beaker-hostgenerator/data'
|
4
|
-
require 'deep_merge'
|
5
|
-
|
6
|
-
module BeakerHostGenerator
|
7
|
-
class Vmpooler < BeakerHostGenerator::Generator
|
8
|
-
include BeakerHostGenerator::Data
|
9
|
-
include BeakerHostGenerator::Data::Vmpooler
|
10
|
-
|
11
|
-
def initialize(options)
|
12
|
-
@config = {}
|
13
|
-
@config.deep_merge! BASE_CONFIG
|
14
|
-
@config.deep_merge! VMPOOLER_CONFIG
|
15
|
-
super(options)
|
16
|
-
end
|
17
|
-
|
18
|
-
def generate_node node_info, base_config, bhg_version=0
|
19
|
-
host_config = {}
|
20
|
-
host_config.deep_merge! base_config
|
21
|
-
|
22
|
-
# set hypervisor
|
23
|
-
host_config['hypervisor'] = 'vmpooler'
|
24
|
-
|
25
|
-
# generate node definition
|
26
|
-
ostype = node_info['ostype']
|
27
|
-
nodeid = node_info['nodeid']
|
28
|
-
bits = node_info['bits']
|
29
|
-
|
30
|
-
platform = "#{ostype}-#{bits}"
|
31
|
-
name = "#{platform}-#{nodeid}"
|
32
|
-
|
33
|
-
osinfo = get_osinfo(bhg_version)
|
34
|
-
host_config.deep_merge! osinfo[platform]
|
35
|
-
|
36
|
-
# Some vmpooler/vsphere platforms have special requirements. We munge the
|
37
|
-
# node host_config here if that is necessary.
|
38
|
-
fixup_node host_config
|
39
|
-
|
40
|
-
return name, host_config
|
41
|
-
end
|
42
|
-
|
43
|
-
def is_ostype_token? token, bhg_version=0
|
44
|
-
osinfo = get_osinfo(bhg_version)
|
45
|
-
osinfo.each do |key,value|
|
46
|
-
|
47
|
-
ostype = key.split('-')[0]
|
48
|
-
|
49
|
-
if ostype == token
|
50
|
-
return true
|
51
|
-
end
|
52
|
-
|
53
|
-
end
|
54
|
-
|
55
|
-
return false
|
56
|
-
end
|
57
|
-
|
58
|
-
end
|
59
|
-
end
|
data/test/test_util.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'minitest/autorun'
|
2
|
-
|
3
|
-
require 'beaker-hostgenerator/util'
|
4
|
-
|
5
|
-
class TestUtil < Minitest::Test
|
6
|
-
|
7
|
-
def setup
|
8
|
-
@stderr = StringIO.new
|
9
|
-
@stdout = StringIO.new
|
10
|
-
|
11
|
-
$stderr = @stderr
|
12
|
-
$stdout = @stdout
|
13
|
-
end
|
14
|
-
|
15
|
-
def test_get_platforms_vmpooler_osinfo_v0
|
16
|
-
expected = BeakerHostGenerator::Data::Vmpooler.get_osinfo(0)
|
17
|
-
actual = BeakerHostGenerator::Utils.get_platforms('vmpooler', 0)
|
18
|
-
assert_equal(expected, actual)
|
19
|
-
end
|
20
|
-
|
21
|
-
def test_get_platforms_vmpooler_osinfo_v1
|
22
|
-
expected = BeakerHostGenerator::Data::Vmpooler.get_osinfo(1)
|
23
|
-
actual = BeakerHostGenerator::Utils.get_platforms('vmpooler', 1)
|
24
|
-
assert_equal(expected, actual)
|
25
|
-
end
|
26
|
-
end
|