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.
Files changed (185) hide show
  1. checksums.yaml +8 -8
  2. data/CHANGELOG.md +4 -0
  3. data/HISTORY.md +233 -2
  4. data/README.md +50 -11
  5. data/beaker-hostgenerator.gemspec +2 -2
  6. data/lib/beaker-hostgenerator.rb +0 -1
  7. data/lib/beaker-hostgenerator/cli.rb +38 -26
  8. data/lib/beaker-hostgenerator/data.rb +960 -35
  9. data/lib/beaker-hostgenerator/generator.rb +57 -97
  10. data/lib/beaker-hostgenerator/hypervisor.rb +97 -0
  11. data/lib/beaker-hostgenerator/hypervisor/none.rb +17 -0
  12. data/lib/beaker-hostgenerator/hypervisor/vmpooler.rb +32 -0
  13. data/lib/beaker-hostgenerator/parser.rb +199 -0
  14. data/lib/beaker-hostgenerator/roles.rb +21 -14
  15. data/lib/beaker-hostgenerator/util.rb +10 -29
  16. data/lib/beaker-hostgenerator/version.rb +1 -1
  17. data/spec/beaker-hostgenerator/generator_spec.rb +73 -109
  18. data/spec/beaker-hostgenerator/parser_spec.rb +84 -0
  19. data/test/fixtures/default/cisconx-64a +1 -1
  20. data/test/fixtures/default/windows10ent-32d +22 -0
  21. data/test/fixtures/default/windows10ent-64f +22 -0
  22. data/test/fixtures/default/windows10pro-64m +22 -0
  23. data/test/fixtures/default/windows2003-6432d +22 -0
  24. data/test/fixtures/default/windows2003-64c +22 -0
  25. data/test/fixtures/default/windows2003r2-32f +22 -0
  26. data/test/fixtures/default/windows2003r2-6432aulcdfm +27 -0
  27. data/test/fixtures/default/windows2003r2-64m +22 -0
  28. data/test/fixtures/default/windows2008-6432u +22 -0
  29. data/test/fixtures/default/windows2008-64a +21 -0
  30. data/test/fixtures/default/windows2008r2-6432c +22 -0
  31. data/test/fixtures/default/windows2008r2-64l +22 -0
  32. data/test/fixtures/default/windows2012-6432f +22 -0
  33. data/test/fixtures/default/windows2012-64d +22 -0
  34. data/test/fixtures/default/windows2012r2-6432aulcdfm +27 -0
  35. data/test/fixtures/default/windows2012r2-64m +22 -0
  36. data/test/fixtures/default/windows7-64a +21 -0
  37. data/test/fixtures/default/windows8-64u +22 -0
  38. data/test/fixtures/default/windows81-64l +22 -0
  39. data/test/fixtures/default/windowsvista-64c +22 -0
  40. data/test/fixtures/multiplatform/arista4-32a-windows10pro-64-arista4-32aulcdfm +47 -0
  41. data/test/fixtures/multiplatform/centos4-32u-windows10ent-64-centos4-32m +43 -0
  42. data/test/fixtures/multiplatform/centos4-64l-windows10ent-32-centos4-64f +43 -0
  43. data/test/fixtures/multiplatform/centos5-32c-windowsvista-64-centos5-32d +43 -0
  44. data/test/fixtures/multiplatform/centos5-64d-windows81-64-centos5-64c +43 -0
  45. data/test/fixtures/multiplatform/centos6-32f-windows8-64-centos6-32l +43 -0
  46. data/test/fixtures/multiplatform/centos6-64m-windows7-64-centos6-64u +43 -0
  47. data/test/fixtures/multiplatform/centos7-64aulcdfm-windows2012r2-6432-centos7-64a +47 -0
  48. data/test/fixtures/multiplatform/cisconx-64a-windows2012r2-64-cisconx-64aulcdfm +53 -0
  49. data/test/fixtures/multiplatform/ciscoxr-64u-windows2012-6432-ciscoxr-64m +43 -0
  50. data/test/fixtures/multiplatform/cumulus25-64l-windows2012-64-cumulus25-64f +43 -0
  51. data/test/fixtures/multiplatform/debian6-32c-windows2008r2-6432-debian6-32d +43 -0
  52. data/test/fixtures/multiplatform/debian6-64d-windows2008r2-64-debian6-64c +43 -0
  53. data/test/fixtures/multiplatform/debian7-32f-windows2008-6432-debian7-32l +43 -0
  54. data/test/fixtures/multiplatform/debian7-64m-windows2008-64-debian7-64u +43 -0
  55. data/test/fixtures/multiplatform/debian8-32aulcdfm-windows2003r2-6432-debian8-32a +47 -0
  56. data/test/fixtures/multiplatform/debian8-64a-windows2003r2-64-debian8-64aulcdfm +47 -0
  57. data/test/fixtures/multiplatform/debian9-32u-windows2003r2-32-debian9-32m +43 -0
  58. data/test/fixtures/multiplatform/debian9-64l-windows2003-6432-debian9-64f +43 -0
  59. data/test/fixtures/multiplatform/fedora14-32l-solaris11-64-fedora14-32f +42 -0
  60. data/test/fixtures/multiplatform/fedora19-32c-solaris11-32-fedora19-32d +42 -0
  61. data/test/fixtures/multiplatform/fedora19-64d-solaris10-64-fedora19-64c +42 -0
  62. data/test/fixtures/multiplatform/fedora20-32f-solaris10-32-fedora20-32l +42 -0
  63. data/test/fixtures/multiplatform/fedora20-64m-sles12-64-fedora20-64u +42 -0
  64. data/test/fixtures/multiplatform/fedora21-32aulcdfm-sles11-64-fedora21-32a +46 -0
  65. data/test/fixtures/multiplatform/fedora21-64a-sles11-32-fedora21-64aulcdfm +46 -0
  66. data/test/fixtures/multiplatform/fedora22-32u-sles10-64-fedora22-32m +42 -0
  67. data/test/fixtures/multiplatform/fedora22-64l-sles10-32-fedora22-64f +42 -0
  68. data/test/fixtures/multiplatform/fedora23-32c-scientific7-64-fedora23-32d +42 -0
  69. data/test/fixtures/multiplatform/fedora23-64d-scientific6-64-fedora23-64c +42 -0
  70. data/test/fixtures/multiplatform/opensuse11-32f-scientific6-32-opensuse11-32l +42 -0
  71. data/test/fixtures/multiplatform/opensuse11-64m-scientific5-64-opensuse11-64u +42 -0
  72. data/test/fixtures/multiplatform/oracle5-32c-windows2003-64-oracle5-32d +43 -0
  73. data/test/fixtures/multiplatform/oracle5-64d-ubuntu1604-64-oracle5-64c +42 -0
  74. data/test/fixtures/multiplatform/oracle6-32f-ubuntu1604-32-oracle6-32l +42 -0
  75. data/test/fixtures/multiplatform/oracle6-64m-ubuntu1510-64-oracle6-64u +42 -0
  76. data/test/fixtures/multiplatform/oracle7-64aulcdfm-ubuntu1510-32-oracle7-64a +46 -0
  77. data/test/fixtures/multiplatform/osx1010-64u-ubuntu1504-32-osx1010-64m +42 -0
  78. data/test/fixtures/multiplatform/osx1011-64l-ubuntu1404-64-osx1011-64f +42 -0
  79. data/test/fixtures/multiplatform/osx109-64a-ubuntu1504-64-osx109-64aulcdfm +46 -0
  80. data/test/fixtures/multiplatform/redhat4-32c-ubuntu1404-32-redhat4-32d +42 -0
  81. data/test/fixtures/multiplatform/redhat4-64d-ubuntu1204-64-redhat4-64c +42 -0
  82. data/test/fixtures/multiplatform/redhat5-32f-ubuntu1204-32-redhat5-32l +42 -0
  83. data/test/fixtures/multiplatform/redhat5-64m-ubuntu1004-64-redhat5-64u +42 -0
  84. data/test/fixtures/multiplatform/redhat6-32aulcdfm-ubuntu1004-32-redhat6-32a +46 -0
  85. data/test/fixtures/multiplatform/redhat6-64a-solaris112-64-redhat6-64aulcdfm +46 -0
  86. data/test/fixtures/multiplatform/redhat7-64u-solaris112-32-redhat7-64m +42 -0
  87. data/test/fixtures/multiplatform/scientific5-32aulcdfm-scientific5-32-scientific5-32a +46 -0
  88. data/test/fixtures/multiplatform/scientific5-64a-opensuse11-64-scientific5-64aulcdfm +46 -0
  89. data/test/fixtures/multiplatform/scientific6-32u-opensuse11-32-scientific6-32m +42 -0
  90. data/test/fixtures/multiplatform/scientific6-64l-fedora23-64-scientific6-64f +42 -0
  91. data/test/fixtures/multiplatform/scientific7-64c-fedora23-32-scientific7-64d +42 -0
  92. data/test/fixtures/multiplatform/sles10-32d-fedora22-64-sles10-32c +42 -0
  93. data/test/fixtures/multiplatform/sles10-64f-fedora22-32-sles10-64l +42 -0
  94. data/test/fixtures/multiplatform/sles11-32m-fedora21-64-sles11-32u +42 -0
  95. data/test/fixtures/multiplatform/sles11-64aulcdfm-fedora21-32-sles11-64a +46 -0
  96. data/test/fixtures/multiplatform/sles12-64a-fedora20-64-sles12-64aulcdfm +46 -0
  97. data/test/fixtures/multiplatform/solaris10-32u-fedora20-32-solaris10-32m +42 -0
  98. data/test/fixtures/multiplatform/solaris10-64l-fedora19-64-solaris10-64f +42 -0
  99. data/test/fixtures/multiplatform/solaris11-32c-fedora19-32-solaris11-32d +42 -0
  100. data/test/fixtures/multiplatform/solaris11-64d-fedora14-32-solaris11-64c +42 -0
  101. data/test/fixtures/multiplatform/solaris112-32f-redhat7-64-solaris112-32l +42 -0
  102. data/test/fixtures/multiplatform/solaris112-64m-redhat6-64-solaris112-64u +42 -0
  103. data/test/fixtures/multiplatform/ubuntu1004-32aulcdfm-redhat6-32-ubuntu1004-32a +46 -0
  104. data/test/fixtures/multiplatform/ubuntu1004-64a-redhat5-64-ubuntu1004-64aulcdfm +46 -0
  105. data/test/fixtures/multiplatform/ubuntu1204-32u-redhat5-32-ubuntu1204-32m +42 -0
  106. data/test/fixtures/multiplatform/ubuntu1204-64l-redhat4-64-ubuntu1204-64f +42 -0
  107. data/test/fixtures/multiplatform/ubuntu1404-32c-redhat4-32-ubuntu1404-32d +42 -0
  108. data/test/fixtures/multiplatform/ubuntu1404-64d-osx1011-64-ubuntu1404-64c +42 -0
  109. data/test/fixtures/multiplatform/ubuntu1504-32f-osx1010-64-ubuntu1504-32l +42 -0
  110. data/test/fixtures/multiplatform/ubuntu1504-64m-osx109-64-ubuntu1504-64u +42 -0
  111. data/test/fixtures/multiplatform/ubuntu1510-32aulcdfm-oracle7-64-ubuntu1510-32a +46 -0
  112. data/test/fixtures/multiplatform/ubuntu1510-64a-oracle6-64-ubuntu1510-64aulcdfm +46 -0
  113. data/test/fixtures/multiplatform/ubuntu1604-32u-oracle6-32-ubuntu1604-32m +42 -0
  114. data/test/fixtures/multiplatform/ubuntu1604-64l-oracle5-64-ubuntu1604-64f +42 -0
  115. data/test/fixtures/multiplatform/windows10ent-32d-centos4-64-windows10ent-32c +44 -0
  116. data/test/fixtures/multiplatform/windows10ent-64f-centos4-32-windows10ent-64l +44 -0
  117. data/test/fixtures/multiplatform/windows10pro-64m-arista4-32-windows10pro-64u +44 -0
  118. data/test/fixtures/multiplatform/windows2003-6432d-debian9-64-windows2003-6432c +44 -0
  119. data/test/fixtures/multiplatform/windows2003-64c-oracle5-32-windows2003-64d +44 -0
  120. data/test/fixtures/multiplatform/windows2003r2-32f-debian9-32-windows2003r2-32l +44 -0
  121. data/test/fixtures/multiplatform/windows2003r2-6432aulcdfm-debian8-32-windows2003r2-6432a +48 -0
  122. data/test/fixtures/multiplatform/windows2003r2-64m-debian8-64-windows2003r2-64u +44 -0
  123. data/test/fixtures/multiplatform/windows2008-6432u-debian7-32-windows2008-6432m +44 -0
  124. data/test/fixtures/multiplatform/windows2008-64a-debian7-64-windows2008-64aulcdfm +48 -0
  125. data/test/fixtures/multiplatform/windows2008r2-6432c-debian6-32-windows2008r2-6432d +44 -0
  126. data/test/fixtures/multiplatform/windows2008r2-64l-debian6-64-windows2008r2-64f +44 -0
  127. data/test/fixtures/multiplatform/windows2012-6432f-ciscoxr-64-windows2012-6432l +44 -0
  128. data/test/fixtures/multiplatform/windows2012-64d-cumulus25-64-windows2012-64c +44 -0
  129. data/test/fixtures/multiplatform/windows2012r2-6432aulcdfm-centos7-64-windows2012r2-6432a +48 -0
  130. data/test/fixtures/multiplatform/windows2012r2-64m-cisconx-64-windows2012r2-64u +47 -0
  131. data/test/fixtures/multiplatform/windows7-64a-centos6-64-windows7-64aulcdfm +48 -0
  132. data/test/fixtures/multiplatform/windows8-64u-centos6-32-windows8-64m +44 -0
  133. data/test/fixtures/multiplatform/windows81-64l-centos5-64-windows81-64f +44 -0
  134. data/test/fixtures/multiplatform/windowsvista-64c-centos5-32-windowsvista-64d +44 -0
  135. data/test/fixtures/osinfo-version-0/cisconx-64a +1 -1
  136. data/test/fixtures/osinfo-version-0/windows10ent-32d +22 -0
  137. data/test/fixtures/osinfo-version-0/windows10ent-64f +22 -0
  138. data/test/fixtures/osinfo-version-0/windows10pro-64m +22 -0
  139. data/test/fixtures/osinfo-version-0/windows2003-6432d +22 -0
  140. data/test/fixtures/osinfo-version-0/windows2003-64c +22 -0
  141. data/test/fixtures/osinfo-version-0/windows2003r2-32f +22 -0
  142. data/test/fixtures/osinfo-version-0/windows2003r2-6432aulcdfm +27 -0
  143. data/test/fixtures/osinfo-version-0/windows2003r2-64m +22 -0
  144. data/test/fixtures/osinfo-version-0/windows2008-6432u +22 -0
  145. data/test/fixtures/osinfo-version-0/windows2008-64a +21 -0
  146. data/test/fixtures/osinfo-version-0/windows2008r2-6432c +22 -0
  147. data/test/fixtures/osinfo-version-0/windows2008r2-64l +22 -0
  148. data/test/fixtures/osinfo-version-0/windows2012-6432f +22 -0
  149. data/test/fixtures/osinfo-version-0/windows2012-64d +22 -0
  150. data/test/fixtures/osinfo-version-0/windows2012r2-6432aulcdfm +27 -0
  151. data/test/fixtures/osinfo-version-0/windows2012r2-64m +22 -0
  152. data/test/fixtures/osinfo-version-0/windows7-64a +21 -0
  153. data/test/fixtures/osinfo-version-0/windows8-64u +22 -0
  154. data/test/fixtures/osinfo-version-0/windows81-64l +22 -0
  155. data/test/fixtures/osinfo-version-0/windowsvista-64c +22 -0
  156. data/test/fixtures/osinfo-version-1/cisconx-64a +1 -1
  157. data/test/fixtures/osinfo-version-1/windows10ent-32d +22 -0
  158. data/test/fixtures/osinfo-version-1/windows10ent-64f +22 -0
  159. data/test/fixtures/osinfo-version-1/windows10pro-64m +22 -0
  160. data/test/fixtures/osinfo-version-1/windows2003-6432d +22 -0
  161. data/test/fixtures/osinfo-version-1/windows2003-64c +22 -0
  162. data/test/fixtures/osinfo-version-1/windows2003r2-32f +22 -0
  163. data/test/fixtures/osinfo-version-1/windows2003r2-6432aulcdfm +27 -0
  164. data/test/fixtures/osinfo-version-1/windows2003r2-64m +22 -0
  165. data/test/fixtures/osinfo-version-1/windows2008-6432u +22 -0
  166. data/test/fixtures/osinfo-version-1/windows2008-64a +21 -0
  167. data/test/fixtures/osinfo-version-1/windows2008r2-6432c +22 -0
  168. data/test/fixtures/osinfo-version-1/windows2008r2-64l +22 -0
  169. data/test/fixtures/osinfo-version-1/windows2012-6432f +22 -0
  170. data/test/fixtures/osinfo-version-1/windows2012-64d +22 -0
  171. data/test/fixtures/osinfo-version-1/windows2012r2-6432aulcdfm +27 -0
  172. data/test/fixtures/osinfo-version-1/windows2012r2-64m +22 -0
  173. data/test/fixtures/osinfo-version-1/windows7-64a +21 -0
  174. data/test/fixtures/osinfo-version-1/windows8-64u +22 -0
  175. data/test/fixtures/osinfo-version-1/windows81-64l +22 -0
  176. data/test/fixtures/osinfo-version-1/windowsvista-64c +22 -0
  177. data/test/fixtures/per-host-settings/arbitrary-settings.yaml +57 -0
  178. data/test/fixtures/per-host-settings/every-hypervisor.yaml +30 -0
  179. data/test/fixtures/per-host-settings/malformed-input.yaml +5 -0
  180. data/test/test_stdout.rb +2 -2
  181. data/test/util/generator_helpers.rb +12 -4
  182. metadata +167 -6
  183. data/lib/beaker-hostgenerator/data/vmpooler.rb +0 -467
  184. data/lib/beaker-hostgenerator/generator/vmpooler.rb +0 -59
  185. 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
@@ -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