beaker-hostgenerator 0.3.3 → 0.4.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.
Files changed (310) hide show
  1. checksums.yaml +8 -8
  2. data/CHANGELOG.md +17 -0
  3. data/Gemfile +4 -0
  4. data/HISTORY.md +201 -2
  5. data/README.md +91 -0
  6. data/Rakefile +27 -1
  7. data/beaker-hostgenerator.gemspec +0 -1
  8. data/bin/beaker-hostgenerator +5 -1
  9. data/bin/genconfig2 +5 -1
  10. data/lib/beaker-hostgenerator/cli.rb +28 -8
  11. data/lib/beaker-hostgenerator/data/vmpooler.rb +3 -2
  12. data/lib/beaker-hostgenerator/data.rb +15 -5
  13. data/lib/beaker-hostgenerator/exceptions.rb +7 -0
  14. data/lib/beaker-hostgenerator/generator.rb +16 -9
  15. data/lib/beaker-hostgenerator/util.rb +2 -2
  16. data/lib/beaker-hostgenerator/version.rb +1 -1
  17. data/spec/beaker-hostgenerator/generator_spec.rb +35 -3
  18. data/test/fixtures/default/arista4-32a +20 -0
  19. data/test/fixtures/default/centos4-32u +21 -0
  20. data/test/fixtures/default/centos4-64l +21 -0
  21. data/test/fixtures/default/centos5-32c +21 -0
  22. data/test/fixtures/default/centos5-64d +21 -0
  23. data/test/fixtures/default/centos6-32f +21 -0
  24. data/test/fixtures/default/centos6-64m +21 -0
  25. data/test/fixtures/default/centos7-64aulcdfm +26 -0
  26. data/test/fixtures/default/ciscoexr7-64u +22 -0
  27. data/test/fixtures/default/cisconxos5-64a +23 -0
  28. data/test/fixtures/default/cumulus25-64l +21 -0
  29. data/test/fixtures/default/debian6-32c +21 -0
  30. data/test/fixtures/default/debian6-64d +21 -0
  31. data/test/fixtures/default/debian7-32f +21 -0
  32. data/test/fixtures/default/debian7-64m +21 -0
  33. data/test/fixtures/default/debian8-32aulcdfm +26 -0
  34. data/test/fixtures/default/debian8-64a +20 -0
  35. data/test/fixtures/default/debian9-32u +21 -0
  36. data/test/fixtures/default/debian9-64l +21 -0
  37. data/test/fixtures/default/fedora14-32l +21 -0
  38. data/test/fixtures/default/fedora19-32c +21 -0
  39. data/test/fixtures/default/fedora19-64d +21 -0
  40. data/test/fixtures/default/fedora20-32f +21 -0
  41. data/test/fixtures/default/fedora20-64m +21 -0
  42. data/test/fixtures/default/fedora21-32aulcdfm +26 -0
  43. data/test/fixtures/default/fedora21-64a +20 -0
  44. data/test/fixtures/default/fedora22-32u +21 -0
  45. data/test/fixtures/default/fedora22-64l +21 -0
  46. data/test/fixtures/default/fedora23-32c +21 -0
  47. data/test/fixtures/default/fedora23-64d +21 -0
  48. data/test/fixtures/default/opensuse11-32f +21 -0
  49. data/test/fixtures/default/opensuse11-64m +21 -0
  50. data/test/fixtures/default/oracle5-32c +21 -0
  51. data/test/fixtures/default/oracle5-64d +21 -0
  52. data/test/fixtures/default/oracle6-32f +21 -0
  53. data/test/fixtures/default/oracle6-64m +21 -0
  54. data/test/fixtures/default/oracle7-64aulcdfm +26 -0
  55. data/test/fixtures/default/osx1010-64u +21 -0
  56. data/test/fixtures/default/osx1011-64l +21 -0
  57. data/test/fixtures/default/osx109-64a +20 -0
  58. data/test/fixtures/default/redhat4-32c +21 -0
  59. data/test/fixtures/default/redhat4-64d +21 -0
  60. data/test/fixtures/default/redhat5-32f +21 -0
  61. data/test/fixtures/default/redhat5-64m +21 -0
  62. data/test/fixtures/default/redhat6-32aulcdfm +26 -0
  63. data/test/fixtures/default/redhat6-64a +20 -0
  64. data/test/fixtures/default/redhat7-64u +21 -0
  65. data/test/fixtures/default/scientific5-32aulcdfm +26 -0
  66. data/test/fixtures/default/scientific5-64a +20 -0
  67. data/test/fixtures/default/scientific6-32u +21 -0
  68. data/test/fixtures/default/scientific6-64l +21 -0
  69. data/test/fixtures/default/scientific7-64c +21 -0
  70. data/test/fixtures/default/sles10-32d +21 -0
  71. data/test/fixtures/default/sles10-64f +21 -0
  72. data/test/fixtures/default/sles11-32m +21 -0
  73. data/test/fixtures/default/sles11-64aulcdfm +26 -0
  74. data/test/fixtures/default/sles12-64a +20 -0
  75. data/test/fixtures/default/solaris10-32u +21 -0
  76. data/test/fixtures/default/solaris10-64l +21 -0
  77. data/test/fixtures/default/solaris11-32c +21 -0
  78. data/test/fixtures/default/solaris11-64d +21 -0
  79. data/test/fixtures/default/solaris112-32f +21 -0
  80. data/test/fixtures/default/solaris112-64m +21 -0
  81. data/test/fixtures/default/ubuntu1004-32aulcdfm +26 -0
  82. data/test/fixtures/default/ubuntu1004-64a +20 -0
  83. data/test/fixtures/default/ubuntu1204-32u +21 -0
  84. data/test/fixtures/default/ubuntu1204-64l +21 -0
  85. data/test/fixtures/default/ubuntu1404-32c +21 -0
  86. data/test/fixtures/default/ubuntu1404-64d +21 -0
  87. data/test/fixtures/default/ubuntu1504-32f +21 -0
  88. data/test/fixtures/default/ubuntu1504-64m +21 -0
  89. data/test/fixtures/default/ubuntu1510-32aulcdfm +26 -0
  90. data/test/fixtures/default/ubuntu1510-64a +20 -0
  91. data/test/fixtures/default/windows10ent-32l +22 -0
  92. data/test/fixtures/default/windows10ent-64c +22 -0
  93. data/test/fixtures/default/windows10pro-64d +22 -0
  94. data/test/fixtures/default/windows2003-6432l +22 -0
  95. data/test/fixtures/default/windows2003-64u +22 -0
  96. data/test/fixtures/default/windows2003r2-32c +22 -0
  97. data/test/fixtures/default/windows2003r2-6432f +22 -0
  98. data/test/fixtures/default/windows2003r2-64d +22 -0
  99. data/test/fixtures/default/windows2008-6432aulcdfm +27 -0
  100. data/test/fixtures/default/windows2008-64m +22 -0
  101. data/test/fixtures/default/windows2008r2-6432u +22 -0
  102. data/test/fixtures/default/windows2008r2-64a +21 -0
  103. data/test/fixtures/default/windows2012-6432c +22 -0
  104. data/test/fixtures/default/windows2012-64l +22 -0
  105. data/test/fixtures/default/windows2012r2-6432f +22 -0
  106. data/test/fixtures/default/windows2012r2-64d +22 -0
  107. data/test/fixtures/default/windows7-64m +22 -0
  108. data/test/fixtures/default/windows8-64aulcdfm +27 -0
  109. data/test/fixtures/default/windows81-64a +21 -0
  110. data/test/fixtures/default/windowsvista-64u +22 -0
  111. data/test/fixtures/environment_variable_tests/pe_version_and_pe_family/centos6-32a +24 -0
  112. data/test/fixtures/environment_variable_tests/pe_version_and_pe_family_no_upgrade/centos6-32a +22 -0
  113. data/test/fixtures/environment_variable_tests/pe_version_and_pe_family_upgrade_only/centos6-32a +22 -0
  114. data/test/fixtures/osinfo-version-0/arista4-32a +20 -0
  115. data/test/fixtures/osinfo-version-0/centos4-32u +21 -0
  116. data/test/fixtures/osinfo-version-0/centos4-64l +21 -0
  117. data/test/fixtures/osinfo-version-0/centos5-32c +21 -0
  118. data/test/fixtures/osinfo-version-0/centos5-64d +21 -0
  119. data/test/fixtures/osinfo-version-0/centos6-32f +21 -0
  120. data/test/fixtures/osinfo-version-0/centos6-64m +21 -0
  121. data/test/fixtures/osinfo-version-0/centos7-64aulcdfm +26 -0
  122. data/test/fixtures/osinfo-version-0/ciscoexr7-64u +22 -0
  123. data/test/fixtures/osinfo-version-0/cisconxos5-64a +23 -0
  124. data/test/fixtures/osinfo-version-0/cumulus25-64l +21 -0
  125. data/test/fixtures/osinfo-version-0/debian6-32c +21 -0
  126. data/test/fixtures/osinfo-version-0/debian6-64d +21 -0
  127. data/test/fixtures/osinfo-version-0/debian7-32f +21 -0
  128. data/test/fixtures/osinfo-version-0/debian7-64m +21 -0
  129. data/test/fixtures/osinfo-version-0/debian8-32aulcdfm +26 -0
  130. data/test/fixtures/osinfo-version-0/debian8-64a +20 -0
  131. data/test/fixtures/osinfo-version-0/debian9-32u +21 -0
  132. data/test/fixtures/osinfo-version-0/debian9-64l +21 -0
  133. data/test/fixtures/osinfo-version-0/fedora14-32l +21 -0
  134. data/test/fixtures/osinfo-version-0/fedora19-32c +21 -0
  135. data/test/fixtures/osinfo-version-0/fedora19-64d +21 -0
  136. data/test/fixtures/osinfo-version-0/fedora20-32f +21 -0
  137. data/test/fixtures/osinfo-version-0/fedora20-64m +21 -0
  138. data/test/fixtures/osinfo-version-0/fedora21-32aulcdfm +26 -0
  139. data/test/fixtures/osinfo-version-0/fedora21-64a +20 -0
  140. data/test/fixtures/osinfo-version-0/fedora22-32u +21 -0
  141. data/test/fixtures/osinfo-version-0/fedora22-64l +21 -0
  142. data/test/fixtures/osinfo-version-0/fedora23-32c +21 -0
  143. data/test/fixtures/osinfo-version-0/fedora23-64d +21 -0
  144. data/test/fixtures/osinfo-version-0/opensuse11-32f +21 -0
  145. data/test/fixtures/osinfo-version-0/opensuse11-64m +21 -0
  146. data/test/fixtures/osinfo-version-0/oracle5-32c +21 -0
  147. data/test/fixtures/osinfo-version-0/oracle5-64d +21 -0
  148. data/test/fixtures/osinfo-version-0/oracle6-32f +21 -0
  149. data/test/fixtures/osinfo-version-0/oracle6-64m +21 -0
  150. data/test/fixtures/osinfo-version-0/oracle7-64aulcdfm +26 -0
  151. data/test/fixtures/osinfo-version-0/osx1010-64u +21 -0
  152. data/test/fixtures/osinfo-version-0/osx1011-64l +21 -0
  153. data/test/fixtures/osinfo-version-0/osx109-64a +20 -0
  154. data/test/fixtures/osinfo-version-0/redhat4-32c +21 -0
  155. data/test/fixtures/osinfo-version-0/redhat4-64d +21 -0
  156. data/test/fixtures/osinfo-version-0/redhat5-32f +21 -0
  157. data/test/fixtures/osinfo-version-0/redhat5-64m +21 -0
  158. data/test/fixtures/osinfo-version-0/redhat6-32aulcdfm +26 -0
  159. data/test/fixtures/osinfo-version-0/redhat6-64a +20 -0
  160. data/test/fixtures/osinfo-version-0/redhat7-64u +21 -0
  161. data/test/fixtures/osinfo-version-0/scientific5-32aulcdfm +26 -0
  162. data/test/fixtures/osinfo-version-0/scientific5-64a +20 -0
  163. data/test/fixtures/osinfo-version-0/scientific6-32u +21 -0
  164. data/test/fixtures/osinfo-version-0/scientific6-64l +21 -0
  165. data/test/fixtures/osinfo-version-0/scientific7-64c +21 -0
  166. data/test/fixtures/osinfo-version-0/sles10-32d +21 -0
  167. data/test/fixtures/osinfo-version-0/sles10-64f +21 -0
  168. data/test/fixtures/osinfo-version-0/sles11-32m +21 -0
  169. data/test/fixtures/osinfo-version-0/sles11-64aulcdfm +26 -0
  170. data/test/fixtures/osinfo-version-0/sles12-64a +20 -0
  171. data/test/fixtures/osinfo-version-0/solaris10-32u +21 -0
  172. data/test/fixtures/osinfo-version-0/solaris10-64l +21 -0
  173. data/test/fixtures/osinfo-version-0/solaris11-32c +21 -0
  174. data/test/fixtures/osinfo-version-0/solaris11-64d +21 -0
  175. data/test/fixtures/osinfo-version-0/solaris112-32f +21 -0
  176. data/test/fixtures/osinfo-version-0/solaris112-64m +21 -0
  177. data/test/fixtures/osinfo-version-0/ubuntu1004-32aulcdfm +26 -0
  178. data/test/fixtures/osinfo-version-0/ubuntu1004-64a +20 -0
  179. data/test/fixtures/osinfo-version-0/ubuntu1204-32u +21 -0
  180. data/test/fixtures/osinfo-version-0/ubuntu1204-64l +21 -0
  181. data/test/fixtures/osinfo-version-0/ubuntu1404-32c +21 -0
  182. data/test/fixtures/osinfo-version-0/ubuntu1404-64d +21 -0
  183. data/test/fixtures/osinfo-version-0/ubuntu1504-32f +21 -0
  184. data/test/fixtures/osinfo-version-0/ubuntu1504-64m +21 -0
  185. data/test/fixtures/osinfo-version-0/ubuntu1510-32aulcdfm +26 -0
  186. data/test/fixtures/osinfo-version-0/ubuntu1510-64a +20 -0
  187. data/test/fixtures/osinfo-version-0/windows10ent-32l +22 -0
  188. data/test/fixtures/osinfo-version-0/windows10ent-64c +22 -0
  189. data/test/fixtures/osinfo-version-0/windows10pro-64d +22 -0
  190. data/test/fixtures/osinfo-version-0/windows2003-6432l +22 -0
  191. data/test/fixtures/osinfo-version-0/windows2003-64u +22 -0
  192. data/test/fixtures/osinfo-version-0/windows2003r2-32c +22 -0
  193. data/test/fixtures/osinfo-version-0/windows2003r2-6432f +22 -0
  194. data/test/fixtures/osinfo-version-0/windows2003r2-64d +22 -0
  195. data/test/fixtures/osinfo-version-0/windows2008-6432aulcdfm +27 -0
  196. data/test/fixtures/osinfo-version-0/windows2008-64m +22 -0
  197. data/test/fixtures/osinfo-version-0/windows2008r2-6432u +22 -0
  198. data/test/fixtures/osinfo-version-0/windows2008r2-64a +21 -0
  199. data/test/fixtures/osinfo-version-0/windows2012-6432c +22 -0
  200. data/test/fixtures/osinfo-version-0/windows2012-64l +22 -0
  201. data/test/fixtures/osinfo-version-0/windows2012r2-6432f +22 -0
  202. data/test/fixtures/osinfo-version-0/windows2012r2-64d +22 -0
  203. data/test/fixtures/osinfo-version-0/windows7-64m +22 -0
  204. data/test/fixtures/osinfo-version-0/windows8-64aulcdfm +27 -0
  205. data/test/fixtures/osinfo-version-0/windows81-64a +21 -0
  206. data/test/fixtures/osinfo-version-0/windowsvista-64u +22 -0
  207. data/test/fixtures/osinfo-version-1/arista4-32a +20 -0
  208. data/test/fixtures/osinfo-version-1/centos4-32u +21 -0
  209. data/test/fixtures/osinfo-version-1/centos4-64l +21 -0
  210. data/test/fixtures/osinfo-version-1/centos5-32c +21 -0
  211. data/test/fixtures/osinfo-version-1/centos5-64d +21 -0
  212. data/test/fixtures/osinfo-version-1/centos6-32f +21 -0
  213. data/test/fixtures/osinfo-version-1/centos6-64m +21 -0
  214. data/test/fixtures/osinfo-version-1/centos7-64aulcdfm +26 -0
  215. data/test/fixtures/osinfo-version-1/ciscoexr7-64u +22 -0
  216. data/test/fixtures/osinfo-version-1/cisconxos5-64a +23 -0
  217. data/test/fixtures/osinfo-version-1/cumulus25-64l +21 -0
  218. data/test/fixtures/osinfo-version-1/debian6-32c +21 -0
  219. data/test/fixtures/osinfo-version-1/debian6-64d +21 -0
  220. data/test/fixtures/osinfo-version-1/debian7-32f +21 -0
  221. data/test/fixtures/osinfo-version-1/debian7-64m +21 -0
  222. data/test/fixtures/osinfo-version-1/debian8-32aulcdfm +26 -0
  223. data/test/fixtures/osinfo-version-1/debian8-64a +20 -0
  224. data/test/fixtures/osinfo-version-1/debian9-32u +21 -0
  225. data/test/fixtures/osinfo-version-1/debian9-64l +21 -0
  226. data/test/fixtures/osinfo-version-1/fedora14-32l +21 -0
  227. data/test/fixtures/osinfo-version-1/fedora19-32c +21 -0
  228. data/test/fixtures/osinfo-version-1/fedora19-64d +21 -0
  229. data/test/fixtures/osinfo-version-1/fedora20-32f +21 -0
  230. data/test/fixtures/osinfo-version-1/fedora20-64m +21 -0
  231. data/test/fixtures/osinfo-version-1/fedora21-32aulcdfm +26 -0
  232. data/test/fixtures/osinfo-version-1/fedora21-64a +20 -0
  233. data/test/fixtures/osinfo-version-1/fedora22-32u +21 -0
  234. data/test/fixtures/osinfo-version-1/fedora22-64l +21 -0
  235. data/test/fixtures/osinfo-version-1/fedora23-32c +21 -0
  236. data/test/fixtures/osinfo-version-1/fedora23-64d +21 -0
  237. data/test/fixtures/osinfo-version-1/opensuse11-32f +21 -0
  238. data/test/fixtures/osinfo-version-1/opensuse11-64m +21 -0
  239. data/test/fixtures/osinfo-version-1/oracle5-32c +21 -0
  240. data/test/fixtures/osinfo-version-1/oracle5-64d +21 -0
  241. data/test/fixtures/osinfo-version-1/oracle6-32f +21 -0
  242. data/test/fixtures/osinfo-version-1/oracle6-64m +21 -0
  243. data/test/fixtures/osinfo-version-1/oracle7-64aulcdfm +26 -0
  244. data/test/fixtures/osinfo-version-1/osx1010-64u +21 -0
  245. data/test/fixtures/osinfo-version-1/osx1011-64l +21 -0
  246. data/test/fixtures/osinfo-version-1/osx109-64a +20 -0
  247. data/test/fixtures/osinfo-version-1/redhat4-32c +21 -0
  248. data/test/fixtures/osinfo-version-1/redhat4-64d +21 -0
  249. data/test/fixtures/osinfo-version-1/redhat5-32f +21 -0
  250. data/test/fixtures/osinfo-version-1/redhat5-64m +21 -0
  251. data/test/fixtures/osinfo-version-1/redhat6-32aulcdfm +26 -0
  252. data/test/fixtures/osinfo-version-1/redhat6-64a +20 -0
  253. data/test/fixtures/osinfo-version-1/redhat7-64u +21 -0
  254. data/test/fixtures/osinfo-version-1/scientific5-32aulcdfm +26 -0
  255. data/test/fixtures/osinfo-version-1/scientific5-64a +20 -0
  256. data/test/fixtures/osinfo-version-1/scientific6-32u +21 -0
  257. data/test/fixtures/osinfo-version-1/scientific6-64l +21 -0
  258. data/test/fixtures/osinfo-version-1/scientific7-64c +21 -0
  259. data/test/fixtures/osinfo-version-1/sles10-32d +21 -0
  260. data/test/fixtures/osinfo-version-1/sles10-64f +21 -0
  261. data/test/fixtures/osinfo-version-1/sles11-32m +21 -0
  262. data/test/fixtures/osinfo-version-1/sles11-64aulcdfm +26 -0
  263. data/test/fixtures/osinfo-version-1/sles12-64a +20 -0
  264. data/test/fixtures/osinfo-version-1/solaris10-32u +21 -0
  265. data/test/fixtures/osinfo-version-1/solaris10-64l +21 -0
  266. data/test/fixtures/osinfo-version-1/solaris11-32c +21 -0
  267. data/test/fixtures/osinfo-version-1/solaris11-64d +21 -0
  268. data/test/fixtures/osinfo-version-1/solaris112-32f +21 -0
  269. data/test/fixtures/osinfo-version-1/solaris112-64m +21 -0
  270. data/test/fixtures/osinfo-version-1/ubuntu1004-32aulcdfm +26 -0
  271. data/test/fixtures/osinfo-version-1/ubuntu1004-64a +20 -0
  272. data/test/fixtures/osinfo-version-1/ubuntu1204-32u +21 -0
  273. data/test/fixtures/osinfo-version-1/ubuntu1204-64l +21 -0
  274. data/test/fixtures/osinfo-version-1/ubuntu1404-32c +21 -0
  275. data/test/fixtures/osinfo-version-1/ubuntu1404-64d +21 -0
  276. data/test/fixtures/osinfo-version-1/ubuntu1504-32f +21 -0
  277. data/test/fixtures/osinfo-version-1/ubuntu1504-64m +21 -0
  278. data/test/fixtures/osinfo-version-1/ubuntu1510-32aulcdfm +26 -0
  279. data/test/fixtures/osinfo-version-1/ubuntu1510-64a +20 -0
  280. data/test/fixtures/osinfo-version-1/windows10ent-32l +22 -0
  281. data/test/fixtures/osinfo-version-1/windows10ent-64c +22 -0
  282. data/test/fixtures/osinfo-version-1/windows10pro-64d +22 -0
  283. data/test/fixtures/osinfo-version-1/windows2003-6432l +22 -0
  284. data/test/fixtures/osinfo-version-1/windows2003-64u +22 -0
  285. data/test/fixtures/osinfo-version-1/windows2003r2-32c +22 -0
  286. data/test/fixtures/osinfo-version-1/windows2003r2-6432f +22 -0
  287. data/test/fixtures/osinfo-version-1/windows2003r2-64d +22 -0
  288. data/test/fixtures/osinfo-version-1/windows2008-6432aulcdfm +27 -0
  289. data/test/fixtures/osinfo-version-1/windows2008-64m +22 -0
  290. data/test/fixtures/osinfo-version-1/windows2008r2-6432u +22 -0
  291. data/test/fixtures/osinfo-version-1/windows2008r2-64a +21 -0
  292. data/test/fixtures/osinfo-version-1/windows2012-6432c +22 -0
  293. data/test/fixtures/osinfo-version-1/windows2012-64l +22 -0
  294. data/test/fixtures/osinfo-version-1/windows2012r2-6432f +22 -0
  295. data/test/fixtures/osinfo-version-1/windows2012r2-64d +22 -0
  296. data/test/fixtures/osinfo-version-1/windows7-64m +22 -0
  297. data/test/fixtures/osinfo-version-1/windows8-64aulcdfm +27 -0
  298. data/test/fixtures/osinfo-version-1/windows81-64a +21 -0
  299. data/test/fixtures/osinfo-version-1/windowsvista-64u +22 -0
  300. data/test/fixtures/pe_dir/centos6-64mdc +23 -0
  301. data/test/fixtures/pe_upgrade_dir/centos6-64mdc +23 -0
  302. data/test/fixtures/pe_upgrade_ver/centos6-64mdc +23 -0
  303. data/test/fixtures/pe_ver/centos6-64mdc +23 -0
  304. data/test/test_cli.rb +20 -0
  305. data/test/test_generator.rb +27 -0
  306. data/test/test_stdout.rb +24 -0
  307. data/test/test_util.rb +26 -0
  308. data/test/util/generator_helpers.rb +150 -0
  309. metadata +294 -3
  310. data/lib/beaker-hostgenerator/error.rb +0 -6
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTBmNmVmOGQzOGFiZmRjZDliZjJlNmZlYjc5OTljYzY1NmVhZWNhNA==
4
+ ZTQyMTQzOTYwYjk2NzU5NTdjZGI1NzE0NzFlY2JjZWQ5OTFiZWNjOQ==
5
5
  data.tar.gz: !binary |-
6
- NjYzYzI1MWQyYjNmMTUyNTIwODUyYTAwMTk1ZDIyMjlmNjdjMWJjYQ==
6
+ YzIxMWNjZWJmZDQ2ODFhZWI0NTk5YjcxNzUxZTQ5OWMwZTBlMmZiOQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZDBhMWMwOTRlZGI5NTg1NGJkZDExMzhlZTRiYTcxZjA3OTdmOTdiMWIwYTMw
10
- YWZiNzlhMTdhZTY2ZGU0MTJiMmU4YTdiMTI1ZjM3MjEwNTRjZTI0YzM1OTBh
11
- YzQ3ZWU3OTgxYmY5ODY0MzIxMjRlMzkxYzBiZjg2NjQ5YzY5OTQ=
9
+ ZTE3ZTcyZjE0YzM1MGJiMWE2MzJlYTFiOTJmYjRiZjllNDM1MmI1MDI1N2U4
10
+ ODU5MGQyZmI3YjE0NmQwNzE1NmU4Zjc4NzVmNmM2OWJiN2M2ODBmMDdjMzUw
11
+ ZTUxMjQyZTMzNTNkYjQ1OWI3MTllZTAyZWQ2ZmYyMWMyNjllNDE=
12
12
  data.tar.gz: !binary |-
13
- MTUxNGQ5MmVlMTk3NWZhMGFmMDdiYWIzNmZjNzEzN2Y4OThkNjhkZDg1MjZi
14
- OWMxM2ZiNjJkMThiZGIzOTM4ZWJkYjdjZDgyMzAxZWNmOThiMDQzZGE3ODRl
15
- ZmZjZGU0ZWFiZmU0YjlhMGYyNzk3ODQyYjNiYzMxYmUzMzFlMjA=
13
+ NmYxZjUyOGEyYjY1OTdiODVjNmNhZTExN2RmNWI3YWI4MzE3N2RjYWI2NDU1
14
+ MDE1ZDFmMzExMTdlYTZjY2NiN2ZjZDY0NWNjZWQ4MWZhNmM1ODM0NTMyYzU5
15
+ ODY1NTYyNWE0MGMwZDNiYzQyMTdmZDE1YTI2NDdiNzY3NjYyODE=
data/CHANGELOG.md CHANGED
@@ -7,6 +7,23 @@ Versioning](http://semver.org).
7
7
  ## [Unreleased][unreleased]
8
8
  ### Changed
9
9
 
10
+ ## [0.4.0] - 2016-02-05
11
+ - Add new optional parameters to CLI:
12
+ --pe_upgrade_dir UPGRADE_PATH
13
+ Explicitly set pe_upgrade_dir attribute on generated hosts.
14
+ --pe_upgrade_ver UPGRADE_VERSION
15
+ Explicitly set pe_upgrade_ver attribute on generated hosts.
16
+ --pe_dir PATH
17
+ Explicitly set pe_dir attribute on generated hosts.
18
+ --pe_ver VERSION
19
+ Explicitly set pe_ver attribute on generated hosts.
20
+
21
+ - Implement data-driven testing approach that separates test logic from test
22
+ data to improve coverage on important code path (BeakerHostGenerator::CLI).
23
+
24
+ ## [0.3.3] - 2016-02-04
25
+ - Fix Cisco platforms by setting required parameters for the vmpooler templates.
26
+
10
27
  ## [0.3.2] - 2016-01-28
11
28
  - Change the way we generate the platform string for windows 10 hosts.
12
29
 
data/Gemfile CHANGED
@@ -21,6 +21,10 @@ group :acceptance_testing do
21
21
  gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 2.0')
22
22
  end
23
23
 
24
+ group :testing do
25
+ gem "minitest"
26
+ end
27
+
24
28
 
25
29
  if File.exists? "#{__FILE__}.local"
26
30
  eval(File.read("#{__FILE__}.local"), binding)
data/HISTORY.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # default - History
2
2
  ## Tags
3
- * [LATEST - 3 Feb, 2016 (34f5cee5)](#LATEST)
3
+ * [LATEST - 10 Feb, 2016 (fe10edc1)](#LATEST)
4
+ * [0.3.3 - 3 Feb, 2016 (41051da9)](#0.3.3)
4
5
  * [0.3.2 - 28 Jan, 2016 (299df8ec)](#0.3.2)
5
6
  * [0.3.1 - 30 Dec, 2015 (7a3f10ca)](#0.3.1)
6
7
  * [0.3.0 - 30 Dec, 2015 (4b03eaf4)](#0.3.0)
@@ -9,7 +10,205 @@
9
10
  * [0.0.1 - 7 Oct, 2015 (d99251e6)](#0.0.1)
10
11
 
11
12
  ## Details
12
- ### <a name = "LATEST">LATEST - 3 Feb, 2016 (34f5cee5)
13
+ ### <a name = "LATEST">LATEST - 10 Feb, 2016 (fe10edc1)
14
+
15
+ * (GEM) update beaker-hostgenerator version to 0.4.0 (fe10edc1)
16
+
17
+ * (MAINT) Remove hard-coded gemspec date. (4770b013)
18
+
19
+ * Merge pull request #23 from puppetlabs/maint (f8b77852)
20
+
21
+
22
+ ```
23
+ Merge pull request #23 from puppetlabs/maint
24
+
25
+ (QENG-3466) Fix --list bug and write tests to prevent recurrences.
26
+ ```
27
+ * (MAINT) s/Errors/Exceptions/ in bin directory (b8b68c60)
28
+
29
+ * (MAINT) Better semantics for exception naming. (d0129893)
30
+
31
+ * (MAINT) Actually add new test. (f80192f3)
32
+
33
+ * (MAINT) Be more explicit in CHANGELOG (0a39fb6b)
34
+
35
+ * (MAINT) Write test for safe early exit behavior. (34866de1)
36
+
37
+
38
+ ```
39
+ (MAINT) Write test for safe early exit behavior.
40
+
41
+ Specifically, ensure that when passed the "--list" options,
42
+ BeakerHostGenerator::CLI.initialize will raise the
43
+ BeakerHostGenerator::Errors::SafeEarlyExit exception which is intended to be
44
+ ignored by the script calling BeakerHostGenerator::CLI.initialize
45
+ ```
46
+ * (MAINT) Update CHANGELOG (bb52432b)
47
+
48
+ * (MAINT) Write tests to protect --list CLI behavior. (e523773f)
49
+
50
+ * (MAINT) Don't call 'exit' in BeakerHostGenerator::CLI class. (e3bac654)
51
+
52
+ * (MAINT) Fix bug introduced by eecc04c (865b04c2)
53
+
54
+ * Merge pull request #21 from puppetlabs/qeng-3370 (45bf2295)
55
+
56
+
57
+ ```
58
+ Merge pull request #21 from puppetlabs/qeng-3370
59
+
60
+ (QENG-3370) Add pe_* value CLI override options.
61
+ ```
62
+ * (QENG-3370) Use mixins instead of module method references. (eecc04c8)
63
+
64
+ * (QENG-3370) Address PR feedback. (19cc3a9b)
65
+
66
+ * (QENG-3370) Fix grammar no no. (4d7d5db3)
67
+
68
+ * Revert "(QENG-3370) Add .projectile (emacs plugin) path exclusion." (1db7dfcc)
69
+
70
+
71
+ ```
72
+ Revert "(QENG-3370) Add .projectile (emacs plugin) path exclusion."
73
+
74
+ This reverts commit 3dd4eb3a5488b55f6aae1d65db43e84c7c0ff625.
75
+ ```
76
+ * (QENG-3370) Fix fixtures after merging cisco changes from master branch. (e1c65ffc)
77
+
78
+ * Merge remote-tracking branch 'origin/master' into qeng-3370 (8559505b)
79
+
80
+ * (QENG-3370) Fix module constant initialization bug. (aa3e08cd)
81
+
82
+
83
+ ```
84
+ (QENG-3370) Fix module constant initialization bug.
85
+
86
+ Similar to the BeakerHostGenerator::Data::Vmpooler data initialization bug, this
87
+ is something that would not typically show up during normal command line usage
88
+ of beaker-hostgenerator because at that time there is typically only one
89
+ reference made to the BeakerHostGenerator::Utils module constant. However during
90
+ test fixture generation and rspec tests the modules were only loaded once so
91
+ there was only one attempt to read in environment variables which led to
92
+ inconsisten results depending on the order in which the fixtures were
93
+ generated/tested.
94
+ ```
95
+ * (QENG-3370) Fix major bug in BeakerHostGenerator::Data::Vmpooler (f3359c8f)
96
+
97
+
98
+ ```
99
+ (QENG-3370) Fix major bug in BeakerHostGenerator::Data::Vmpooler
100
+
101
+ Since the OSINFO and OSINFO_BHGv1 module constants are only initialized once
102
+ (during library load), do not refer directly to them using reference variables.
103
+ Instead, initialize the osinfo variable directly on each call of get_osinfo and
104
+ merge in the module constants as appropriate based on the given
105
+ beaker-hostenerator version integer.
106
+
107
+ This bug never came up during normal command-line usage of beaker-hostgenerator
108
+ because get_osinfo would never be expected to be called with both bhg_version=0
109
+ and bhg_version=1. However, it came up both during generation of test fixtures
110
+ and validation of those test fixtures in rspec since the module is only loaded
111
+ once which led to the mutated value of the OSINFO module constant to persist
112
+ across all initializations of the BeakerHostGenerator::CLI class.
113
+ ```
114
+ * (QENG-3370) Generate test cases for pe_{family,version} variable combinations. (99965b3f)
115
+
116
+ * (QENG-3370) Minor cleanup of new rspec test. (e9a77bb5)
117
+
118
+ * (QENG-3370) Use fixtures in rspec tests instead of minitest. (b401574d)
119
+
120
+
121
+ ```
122
+ (QENG-3370) Use fixtures in rspec tests instead of minitest.
123
+
124
+ This makes it possible to treat each individual fixture its own test case which
125
+ improves the reporting and ensures that all fixtures are tested even if some
126
+ fail.
127
+
128
+ Using a loop containing an assertion in minitest did not work for this purpose
129
+ because a failed assertion caused the loop to break prematurely; it probably
130
+ would have been possible to catch whatever the exception was and continue the
131
+ loop but whatever. I already did this.
132
+ ```
133
+ * (QENG-3370) Rename options_string to arguments_string. (c6507fd4)
134
+
135
+ * (QENG-3370) Add documentation for test fixtures. (b6712a9b)
136
+
137
+ * (QENG-3370) Make it a little easier to generate fixtures. (a829a425)
138
+
139
+
140
+ ```
141
+ (QENG-3370) Make it a little easier to generate fixtures.
142
+
143
+ * Move FixtureGenerator class into test/utils/generator_helpers.rb
144
+ * Create generate:test Rake task
145
+ ```
146
+ * (QENG-3370) Add assert_equal mismatch message. (11cbba23)
147
+
148
+ * (QENG-3370) Add .projectile (emacs plugin) path exclusion. (3dd4eb3a)
149
+
150
+ * (QENG-3370) Use YAML.load_file method. (0b353986)
151
+
152
+ * (QENG-3370) Don't use minitest to generate fixtures. (6c3a890f)
153
+
154
+ * (QENG-3370) Generate various option fixtures. (71e4efca)
155
+
156
+ * (QENG-3370) Add some fixtures and a test case to iterate over them. (722abcd5)
157
+
158
+ * (QENG-3370) Use enumerators to produce more diverse combinations of host roles. (2f913aec)
159
+
160
+ * (QENG-3370) Move helper methods into helper module. (f4fd1cf5)
161
+
162
+
163
+ ```
164
+ (QENG-3370) Move helper methods into helper module.
165
+
166
+ Unclutters the fixture generator class and maintains distinction between test
167
+ and helper methods.
168
+ ```
169
+ * (QENG-3370) Create common method for generating options-based fixtures. (6be93ddc)
170
+
171
+
172
+ ```
173
+ (QENG-3370) Create common method for generating options-based fixtures.
174
+
175
+ This will make it easier to generate many many fixtures.
176
+ ```
177
+ * (QENG-3370) Add janky fixture generator. (88ac0341)
178
+
179
+
180
+ ```
181
+ (QENG-3370) Add janky fixture generator.
182
+
183
+ This script allows one to generate test fixtures using beaker-hostgenerator
184
+ itself. Yay. The generated directory structure could use some more thought.
185
+ ```
186
+ * (QENG-3370) Move GeneratorTestHelpers into its own file. (f7d3f996)
187
+
188
+ * (QENG-3370) Use BeakerHostGenerator::CLI directly. (45a2f7e4)
189
+
190
+
191
+ ```
192
+ (QENG-3370) Use BeakerHostGenerator::CLI directly.
193
+
194
+ This may be necessary to ensure coverage checks can work correctly. Also, it
195
+ makes sense to test at this since I know of at least one project that is doing
196
+ something similar.
197
+
198
+ Not so sure about the way this is handling stderr though--just trying to avoid
199
+ polluting the minitest console output.
200
+ ```
201
+ * (QENG-3770) Add GeneratorTestHelpers and default options test for test class. (388867d1)
202
+
203
+ * (QENG-3770) Stub out minitest for Generator class. (3af5796d)
204
+
205
+ * (QENG-3770) Get test:spec rake task to run minitest also. (436bb778)
206
+
207
+ * (QENG-3370) Add pe_* value CLI override options. (e321afc3)
208
+
209
+ ### <a name = "0.3.3">0.3.3 - 3 Feb, 2016 (41051da9)
210
+
211
+ * (HISTORY) update beaker-hostgenerator history for gem release 0.3.3 (41051da9)
13
212
 
14
213
  * (GEM) update beaker-hostgenerator version to 0.3.3 (34f5cee5)
15
214
 
data/README.md CHANGED
@@ -8,6 +8,21 @@ but is designed in a way that makes it possible to easily add support for
8
8
  additional hypervisor templates (any hypervisor type supported by
9
9
  [beaker][beaker]).
10
10
 
11
+ <!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-generate-toc again -->
12
+ **Table of Contents**
13
+
14
+ - [Beaker Host Generator](#beaker-host-generator)
15
+ - [Usage](#usage)
16
+ - [Simple two-host SUT layout](#simple-two-host-sut-layout)
17
+ - [Single-host SUT layout with Arbitrary Roles](#single-host-sut-layout-with-arbitrary-roles)
18
+ - [Testing](#testing)
19
+ - [Test Fixtures](#test-fixtures)
20
+ - [Generated Fixtures](#generated-fixtures)
21
+ - [Support](#support)
22
+ - [License](#license)
23
+
24
+ <!-- markdown-toc end -->
25
+
11
26
  ## Usage
12
27
 
13
28
  Below are some example usages of `beaker-hostgenerator`.
@@ -86,6 +101,82 @@ CONFIG:
86
101
  pooling_api: http://vmpooler.delivery.puppetlabs.net/
87
102
  ```
88
103
 
104
+ ## Testing
105
+
106
+ Beaker Host Generator currently uses both rspec and minitest tests. To run both
107
+ at the same time, run:
108
+ ```bash
109
+ bundle exec rake tests
110
+ ```
111
+
112
+ ### Test Fixtures
113
+
114
+ Beaker Host Generator makes extensive use of test fixtures to validate its
115
+ behavior under specific conditions. An example of such a test fixture is as
116
+ follows:
117
+
118
+ ```yaml
119
+ ---
120
+ arguments_string: "--pe_dir /opt/hello centos6-64mdc"
121
+ environment_variables: {}
122
+ expected_hash:
123
+ HOSTS:
124
+ centos6-64-1:
125
+ pe_dir: "/opt/hello"
126
+ pe_ver:
127
+ pe_upgrade_dir:
128
+ pe_upgrade_ver:
129
+ hypervisor: vmpooler
130
+ platform: centos-6-x86_64
131
+ template: centos-6-x86_64
132
+ roles:
133
+ - agent
134
+ - master
135
+ - database
136
+ - dashboard
137
+ CONFIG:
138
+ nfs_server: none
139
+ consoleport: 443
140
+ pooling_api: http://vmpooler.delivery.puppetlabs.net/
141
+ expected_exception:
142
+ ```
143
+
144
+ These test fixtures are yaml files searched for in the directory
145
+ `test/fixtures`. The data structure expected in these files is a hash with four
146
+ keys:
147
+
148
+ - `arguments_string`: The command line arguments that should be passed to
149
+ `beaker-hostgenerator`
150
+ - `environment_variables`: The environment variables that should be set during
151
+ the `beaker-hostgenerator` call.
152
+ - `expected_hash`: A hash that should match the output of `beaker-hostgenerator`
153
+ when it is run with `options\_string`
154
+ - `expected_exception`: If the `arguments_string` passed to `beaker-hostgenerator`
155
+ is expected to lead to an exceptional state, this is the name of the exception
156
+ that the fixture test will attempt to match.
157
+
158
+ #### Generated Fixtures
159
+
160
+ It is possible to generate test fixtures using the current state of the
161
+ `beaker-hostgenerator` library. To do this, call the `generate:fixtures` Rake
162
+ task.
163
+
164
+ However, this is not something that should need to be done very often. If you
165
+ are running tests and find that some fixtures no longer work, you have most
166
+ likely made a change that incompatibly changes the behavior of
167
+ `beaker-hostgenerator` for other users. Use the test fixtures as a guide to
168
+ figure out what you did wrong and figure out how to achieve your goal without
169
+ potentially breaking `beaker-hostgenerator` for other users.
170
+
171
+ There are a few circumstances when you should expect to run the
172
+ `generate:fixtures` task:
173
+
174
+ - When you modify the `FixtureGenerator` to generate new fixtures.
175
+ - When you need to fix a bug (generated hosts are not usable without your
176
+ change, for example).
177
+ - When preparing for a major version bump of Beaker Host Generator.
178
+
179
+
89
180
  ## Support
90
181
 
91
182
  Support offered by [Puppet Labs](https://puppetlabs.com) may not always be timely
data/Rakefile CHANGED
@@ -1,13 +1,24 @@
1
1
  require 'rspec/core/rake_task'
2
+ require 'rake/testtask'
2
3
 
3
4
  namespace :test do
4
5
 
5
6
  namespace :spec do
6
7
 
8
+ task :minitest do
9
+ desc "Run minitest tests"
10
+ Rake::TestTask.new do |task|
11
+ task.libs << %w(test lib)
12
+ task.test_files = FileList['test/test*.rb']
13
+ task.verbose = true
14
+ end
15
+ end
16
+
7
17
  desc "Run spec tests"
8
18
  RSpec::Core::RakeTask.new(:run) do |t|
9
19
  t.rspec_opts = ['--color']
10
20
  t.pattern = 'spec/'
21
+ t.ruby_opts = '-Itest'
11
22
  end
12
23
 
13
24
  desc "Run spec tests with coverage"
@@ -37,10 +48,25 @@ A quick acceptance test, named because it has no pre-suites to run
37
48
 
38
49
  end
39
50
 
51
+ namespace :generate do
52
+ desc "Generate test fixtures."
53
+ task :fixtures do
54
+ $LOAD_PATH.unshift(
55
+ File.join(Dir.pwd, 'lib'),
56
+ File.join(Dir.pwd, 'test')
57
+ )
58
+ require 'beaker-hostgenerator'
59
+ require 'util/generator_helpers'
60
+
61
+ fixgen = FixtureGenerator.new
62
+ fixgen.generate
63
+ end
64
+ end
65
+
40
66
  # namespace-named default tasks.
41
67
  # these are the default tasks invoked when only the namespace is referenced.
42
68
  # they're needed because `task :default` in those blocks doesn't work as expected.
43
- task 'test:spec' => 'test:spec:run'
69
+ task 'test:spec' => ['test:spec:run', 'test:spec:minitest']
44
70
  task 'test:acceptance' => 'test:acceptance:quick'
45
71
 
46
72
  # global defaults
@@ -5,7 +5,6 @@ require 'beaker-hostgenerator/version'
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "beaker-hostgenerator"
7
7
  s.version = BeakerHostGenerator::Version::STRING
8
- s.date = "2015-10-07"
9
8
  s.authors = ["Branan Purvine-Riley", "Wayne Warren"]
10
9
  s.email = ["qe-team@puppetlabs.com"]
11
10
  s.homepage = "https://github.com/puppetlabs/beaker-hostgenerator"
@@ -5,4 +5,8 @@ $LOAD_PATH.unshift(lib_dir)
5
5
 
6
6
  require 'beaker-hostgenerator'
7
7
 
8
- BeakerHostGenerator::CLI.new.execute!
8
+ begin
9
+ cli = BeakerHostGenerator::CLI.new
10
+ cli.execute!
11
+ rescue BeakerHostGenerator::Exceptions::SafeEarlyExit
12
+ end
data/bin/genconfig2 CHANGED
@@ -7,4 +7,8 @@ require 'beaker-hostgenerator'
7
7
 
8
8
  STDERR.puts("Warning: 'genconfig2' is deprecated and will be removed in beaker-hostgenerator 1.x\n\n")
9
9
 
10
- BeakerHostGenerator::CLI.new.execute!
10
+ begin
11
+ cli = BeakerHostGenerator::CLI.new
12
+ cli.execute!
13
+ rescue BeakerHostGenerator::Exceptions::SafeEarlyExit
14
+ end
@@ -64,6 +64,26 @@ Usage: beaker-hostgenerator [options] <layout>
64
64
  @options[:hypervisor] = h
65
65
  end
66
66
 
67
+ opts.on('--pe_upgrade_dir UPGRADE_PATH',
68
+ 'Explicitly set pe_upgrade_dir attribute on generated hosts. ') do |p|
69
+ @options[:pe_upgrade_dir] = p
70
+ end
71
+
72
+ opts.on('--pe_upgrade_ver UPGRADE_VERSION',
73
+ 'Explicitly set pe_upgrade_ver attribute on generated hosts. ') do |p|
74
+ @options[:pe_upgrade_ver] = p
75
+ end
76
+
77
+ opts.on('--pe_dir PATH',
78
+ 'Explicitly set pe_dir attribute on generated hosts. ') do |p|
79
+ @options[:pe_dir] = p
80
+ end
81
+
82
+ opts.on('--pe_ver VERSION',
83
+ 'Explicitly set pe_ver attribute on generated hosts. ') do |p|
84
+ @options[:pe_ver] = p
85
+ end
86
+
67
87
  opts.on('--disable-role-config',
68
88
  "Do not include role-specific configuration.") do
69
89
  @options[:disable_role_config] = true
@@ -98,14 +118,13 @@ Usage: beaker-hostgenerator [options] <layout>
98
118
 
99
119
  if @options[:list_platforms_and_roles]
100
120
  print_platforms_and_roles
101
- exit
102
- end
121
+ raise BeakerHostGenerator::Exceptions::SafeEarlyExit
122
+ else
123
+ # Tokenizing the config definition for great justice
124
+ @tokens = argv[0].split('-')
103
125
 
104
- # Tokenizing the config definition for great justice
105
- @tokens = argv[0].split('-')
106
-
107
- if @options[:osinfo_version] === 0
108
- warning = <<-eow
126
+ if @options[:osinfo_version] === 0
127
+ warning = <<-eow
109
128
  WARNING: Starting with beaker-hostgenerator 1.x platform strings for "el" hosts
110
129
  will correspond to the actual linux distribution name. ie, the platform string
111
130
  corresponding to a host specified as "centos4_64a" will be "centos-4-x86_64"
@@ -113,7 +132,8 @@ rather than "el-4-x86_64". It is recommended that you update your project's test
113
132
  suites ASAP or be forced to do so when beaker-hostgenerator development moves on
114
133
  to the 1.x series. We don't intend to backport features or platforms to 0.x.
115
134
  eow
116
- STDERR.puts(warning)
135
+ STDERR.puts(warning)
136
+ end
117
137
  end
118
138
  end
119
139
 
@@ -441,11 +441,12 @@ module BeakerHostGenerator
441
441
  }
442
442
 
443
443
  def get_osinfo(bhg_version=0)
444
+ osinfo = {}
444
445
  case bhg_version
445
446
  when 0
446
- osinfo = OSINFO
447
+ osinfo.deep_merge! OSINFO
447
448
  when 1
448
- osinfo = OSINFO
449
+ osinfo.deep_merge! OSINFO
449
450
  osinfo.deep_merge! OSINFO_BHGv1
450
451
  else
451
452
  raise "Invalid beaker-hostgenerator version: #{bhg_version}"
@@ -1,11 +1,21 @@
1
1
  module BeakerHostGenerator
2
2
  module Data
3
3
 
4
- # Pull various informations out of the environment.
5
- PE_VERSION=ENV['pe_version']
6
- PE_FAMILY=ENV['pe_family']
7
- PE_UPGRADE_VERSION=ENV['pe_upgrade_version']
8
- PE_UPGRADE_FAMILY=ENV['pe_upgrade_family']
4
+ def pe_version
5
+ ENV['pe_version']
6
+ end
7
+
8
+ def pe_family
9
+ ENV['pe_family']
10
+ end
11
+
12
+ def pe_upgrade_version
13
+ ENV['pe_upgrade_version']
14
+ end
15
+
16
+ def pe_upgrade_family
17
+ ENV['pe_upgrade_family']
18
+ end
9
19
 
10
20
  PE_USE_WIN32=ENV['pe_use_win32']
11
21
 
@@ -0,0 +1,7 @@
1
+ module BeakerHostGenerator
2
+ module Exceptions
3
+ class Error < RuntimeError ; end
4
+ class InvalidNodeSpecError < BeakerHostGenerator::Exceptions::Error ; end
5
+ class SafeEarlyExit < SystemExit ; end
6
+ end
7
+ end
@@ -1,6 +1,6 @@
1
1
  require 'beaker-hostgenerator/util'
2
2
  require 'beaker-hostgenerator/data'
3
- require 'beaker-hostgenerator/error'
3
+ require 'beaker-hostgenerator/exceptions'
4
4
  require 'beaker-hostgenerator/roles'
5
5
 
6
6
  require 'yaml'
@@ -8,15 +8,9 @@ require 'yaml'
8
8
  module BeakerHostGenerator
9
9
  class Generator
10
10
  include BeakerHostGenerator::Data
11
- include BeakerHostGenerator::Errors
11
+ include BeakerHostGenerator::Exceptions
12
12
  include BeakerHostGenerator::Utils
13
13
 
14
- BASE_HOST_CONFIG = {
15
- 'pe_dir' => BeakerHostGenerator::Utils.pe_dir(PE_VERSION, PE_FAMILY),
16
- 'pe_ver' => PE_VERSION,
17
- 'pe_upgrade_dir' => BeakerHostGenerator::Utils.pe_dir(PE_UPGRADE_VERSION, PE_UPGRADE_FAMILY),
18
- 'pe_upgrade_ver' => PE_UPGRADE_VERSION,
19
- }
20
14
  attr_reader :options
21
15
 
22
16
  def initialize options
@@ -56,8 +50,21 @@ module BeakerHostGenerator
56
50
  node_info['ostype'] = ostype
57
51
  node_info['nodeid'] = nodeid[ostype]
58
52
 
53
+ config = {
54
+ 'pe_dir' => pe_dir(pe_version, pe_family),
55
+ 'pe_ver' => pe_version,
56
+ 'pe_upgrade_dir' => pe_dir(pe_upgrade_version, pe_upgrade_family),
57
+ 'pe_upgrade_ver' => pe_upgrade_version,
58
+ }
59
+
60
+ [:pe_dir, :pe_ver, :pe_upgrade_dir, :pe_upgrade_ver].each do |option|
61
+ if @options[option]
62
+ config[option.to_s] = @options[option]
63
+ end
64
+ end
65
+
59
66
  host_name, host_config = generate_node(
60
- node_info, BASE_HOST_CONFIG, bhg_version=@options[:osinfo_version])
67
+ node_info, config, bhg_version=@options[:osinfo_version])
61
68
 
62
69
  if PE_USE_WIN32 && ostype =~ /windows/ && node_info['bits'] == "64"
63
70
  host_config['ruby_arch'] = 'x86'
@@ -22,7 +22,7 @@ module BeakerHostGenerator
22
22
 
23
23
  def fixup_node(cfg)
24
24
  # PE 2.8 doesn't exist for EL 4. We use 2.0 instead.
25
- if cfg['platform'] =~ /el-4/ and PE_VERSION =~ /2\.8/
25
+ if cfg['platform'] =~ /el-4/ and pe_version =~ /2\.8/
26
26
  cfg['pe_ver'] = "2.0.3"
27
27
  end
28
28
  end
@@ -59,6 +59,6 @@ module BeakerHostGenerator
59
59
  return BeakerHostGenerator::Data::ROLES
60
60
  end
61
61
 
62
- module_function :dump_hosts, :get_platforms, :get_roles, :pe_dir
62
+ module_function :get_roles, :get_platforms, :dump_hosts, :fixup_node, :pe_dir
63
63
  end
64
64
  end
@@ -1,5 +1,5 @@
1
1
  module BeakerHostGenerator
2
2
  module Version
3
- STRING = '0.3.3'
3
+ STRING = '0.4.0'
4
4
  end
5
5
  end