vagrant-skytap 0.1.11 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (342) hide show
  1. checksums.yaml +4 -4
  2. data/.byebug_history +242 -19
  3. data/CHANGELOG.md +9 -0
  4. data/README.md +30 -8
  5. data/Vagrantfile.rej +83 -0
  6. data/_patches-20160112/0 +388 -0
  7. data/_patches-20160112/1 +82 -0
  8. data/_patches-20160112/2 +239 -0
  9. data/_patches-20160112/COMPLETED-ABOVE-THIS-LINE +4 -0
  10. data/_patches-20160112/COMPLETED-BELOW-THIS-LINE +4 -0
  11. data/_patches-20160112/CR-ABOVE-THIS-LINE +4 -0
  12. data/_patches-20160112/CR-BELOW-THIS-LINE +4 -0
  13. data/_patches-20160112/WIP-ABOVE-THIS-LINE +4 -0
  14. data/_patches-20160112/WIP-BELOW-THIS-LINE +4 -0
  15. data/_patches-20160112/acceptance-test-runner +29 -0
  16. data/_patches-20160112/ansible-1 +92 -0
  17. data/_patches-20160112/cache-api-client-in-up +40 -0
  18. data/_patches-20160112/dead-code-in-actions +44 -0
  19. data/_patches-20160112/debug-changes +42 -0
  20. data/_patches-20160112/demo-rails-app +1276 -0
  21. data/_patches-20160112/eng-10166-halt-spec +40 -0
  22. data/_patches-20160112/eng-10256 +527 -0
  23. data/_patches-20160112/eng-10256-2 +162 -0
  24. data/_patches-20160112/eng-10256-ubuntu-testing +88 -0
  25. data/_patches-20160112/eng-10269-test-stuff +87 -0
  26. data/_patches-20160112/eng-10269-wtf +119 -0
  27. data/_patches-20160112/eng-10369 +143 -0
  28. data/_patches-20160112/eng-10369-tmp +60 -0
  29. data/_patches-20160112/eng-10919 +56 -0
  30. data/_patches-20160112/eng-11177-fix-actions-requires +44 -0
  31. data/_patches-20160112/eng-11442 +4 -0
  32. data/_patches-20160112/eng-11616 +403 -0
  33. data/_patches-20160112/eng-11616-2 +67 -0
  34. data/_patches-20160112/eng-11616-actual +184 -0
  35. data/_patches-20160112/eng-11625a +4 -0
  36. data/_patches-20160112/eng-11711 +85 -0
  37. data/_patches-20160112/eng-12232-command-spec +236 -0
  38. data/_patches-20160112/eng-12235 +83 -0
  39. data/_patches-20160112/eng-12235-override-refactor +140 -0
  40. data/_patches-20160112/eng-12240 +103 -0
  41. data/_patches-20160112/eng-12249 +40 -0
  42. data/_patches-20160112/eng-12301 +50 -0
  43. data/_patches-20160112/eng-12843 +95 -0
  44. data/_patches-20160112/env-source +112 -0
  45. data/_patches-20160112/frickin-vagrant-spec +163 -0
  46. data/_patches-20160112/gem-pre-version +14 -0
  47. data/_patches-20160112/gems-old +9 -0
  48. data/_patches-20160112/googles-specs +713 -0
  49. data/_patches-20160112/local-configs-ignore +61 -0
  50. data/_patches-20160112/misc +79 -0
  51. data/_patches-20160112/network-unreachable +31 -0
  52. data/_patches-20160112/new-boxfile +288 -0
  53. data/_patches-20160112/parallelization-maybe +198 -0
  54. data/_patches-20160112/read-state +23 -0
  55. data/_patches-20160112/refactor-to-use-public_address-cap +25 -0
  56. data/_patches-20160112/series +60 -0
  57. data/_patches-20160112/status +12 -0
  58. data/_patches-20160112/test-move-env-data +231 -0
  59. data/_patches-20160112/test-vagrantfile-vm1 +167 -0
  60. data/_patches-20160112/the_version_in_0.1.13.pre1 +598 -0
  61. data/_patches-20160112/vagrant-spec-mock-api +137 -0
  62. data/_patches-20160112/vagrant-vmware-plugin +233 -0
  63. data/_patches-20160112/vagrantfile +403 -0
  64. data/_patches-20160112/vagrantfile-for-acceptance-tests +29 -0
  65. data/_patches-20160112/vagrantfile-for-nick +95 -0
  66. data/_patches-20160112/vagrantfiles-to-forget-what-they-are-for +134 -0
  67. data/_patches-20160112/vm-vanished +42 -0
  68. data/_patches-20160112a/01 +148 -0
  69. data/_patches-20160112a/2 +239 -0
  70. data/_patches-20160112a/COMPLETED-ABOVE-THIS-LINE +4 -0
  71. data/_patches-20160112a/COMPLETED-BELOW-THIS-LINE +4 -0
  72. data/_patches-20160112a/CR-ABOVE-THIS-LINE +4 -0
  73. data/_patches-20160112a/CR-BELOW-THIS-LINE +4 -0
  74. data/_patches-20160112a/WIP-ABOVE-THIS-LINE +4 -0
  75. data/_patches-20160112a/WIP-BELOW-THIS-LINE +4 -0
  76. data/_patches-20160112a/acceptance-test-runner +29 -0
  77. data/_patches-20160112a/ansible-1 +92 -0
  78. data/_patches-20160112a/cache-api-client-in-up +40 -0
  79. data/_patches-20160112a/dead-code-in-actions +44 -0
  80. data/_patches-20160112a/debug-changes +42 -0
  81. data/_patches-20160112a/demo-rails-app +1276 -0
  82. data/_patches-20160112a/eng-10166-halt-spec +40 -0
  83. data/_patches-20160112a/eng-10256-ubuntu-testing +88 -0
  84. data/_patches-20160112a/eng-10269-test-stuff +87 -0
  85. data/_patches-20160112a/eng-10269-wtf +119 -0
  86. data/_patches-20160112a/eng-10369 +143 -0
  87. data/_patches-20160112a/eng-10369-tmp +60 -0
  88. data/_patches-20160112a/eng-10919 +56 -0
  89. data/_patches-20160112a/eng-11177-fix-actions-requires +44 -0
  90. data/_patches-20160112a/eng-11442 +4 -0
  91. data/_patches-20160112a/eng-11616 +403 -0
  92. data/_patches-20160112a/eng-11616-2 +67 -0
  93. data/_patches-20160112a/eng-11616-actual +184 -0
  94. data/_patches-20160112a/eng-11625a +4 -0
  95. data/_patches-20160112a/eng-11711 +85 -0
  96. data/_patches-20160112a/eng-12232-command-spec +236 -0
  97. data/_patches-20160112a/eng-12235 +83 -0
  98. data/_patches-20160112a/eng-12235-override-refactor +140 -0
  99. data/_patches-20160112a/eng-12240 +103 -0
  100. data/_patches-20160112a/eng-12249 +40 -0
  101. data/_patches-20160112a/eng-12301 +50 -0
  102. data/_patches-20160112a/eng-12843 +95 -0
  103. data/_patches-20160112a/env-source +112 -0
  104. data/_patches-20160112a/frickin-vagrant-spec +163 -0
  105. data/_patches-20160112a/gem-pre-version +14 -0
  106. data/_patches-20160112a/gems-old +9 -0
  107. data/_patches-20160112a/googles-specs +713 -0
  108. data/_patches-20160112a/local-configs-ignore +61 -0
  109. data/_patches-20160112a/misc +79 -0
  110. data/_patches-20160112a/network-unreachable +31 -0
  111. data/_patches-20160112a/new-boxfile +288 -0
  112. data/_patches-20160112a/parallelization-maybe +198 -0
  113. data/_patches-20160112a/read-state +23 -0
  114. data/_patches-20160112a/refactor-to-use-public_address-cap +25 -0
  115. data/_patches-20160112a/series +58 -0
  116. data/_patches-20160112a/status +14 -0
  117. data/_patches-20160112a/test-move-env-data +231 -0
  118. data/_patches-20160112a/test-vagrantfile-vm1 +167 -0
  119. data/_patches-20160112a/the_version_in_0.1.13.pre1 +612 -0
  120. data/_patches-20160112a/then-copy-the-newer-files +632 -0
  121. data/_patches-20160112a/vagrant-spec-mock-api +137 -0
  122. data/_patches-20160112a/vagrant-vmware-plugin +233 -0
  123. data/_patches-20160112a/vagrantfile +403 -0
  124. data/_patches-20160112a/vagrantfile-for-acceptance-tests +29 -0
  125. data/_patches-20160112a/vagrantfile-for-nick +95 -0
  126. data/_patches-20160112a/vagrantfiles-to-forget-what-they-are-for +134 -0
  127. data/_patches-20160112a/vm-vanished +42 -0
  128. data/_patches-20160113/COMPLETED-ABOVE-THIS-LINE +4 -0
  129. data/_patches-20160113/COMPLETED-BELOW-THIS-LINE +4 -0
  130. data/_patches-20160113/CR-ABOVE-THIS-LINE +4 -0
  131. data/_patches-20160113/CR-BELOW-THIS-LINE +4 -0
  132. data/_patches-20160113/WIP-ABOVE-THIS-LINE +4 -0
  133. data/_patches-20160113/WIP-BELOW-THIS-LINE +4 -0
  134. data/_patches-20160113/acceptance-test-runner +29 -0
  135. data/_patches-20160113/ansible-1 +92 -0
  136. data/_patches-20160113/cache-api-client-in-up +40 -0
  137. data/_patches-20160113/dead-code-in-actions +44 -0
  138. data/_patches-20160113/debug-changes +55 -0
  139. data/_patches-20160113/demo-rails-app +1276 -0
  140. data/_patches-20160113/eng-10166-halt-spec +40 -0
  141. data/_patches-20160113/eng-10256 +543 -0
  142. data/_patches-20160113/eng-10256-ubuntu-testing +88 -0
  143. data/_patches-20160113/eng-10269-test-stuff +87 -0
  144. data/_patches-20160113/eng-10269-wtf +119 -0
  145. data/_patches-20160113/eng-10369 +143 -0
  146. data/_patches-20160113/eng-10369-tmp +60 -0
  147. data/_patches-20160113/eng-10919 +56 -0
  148. data/_patches-20160113/eng-11177-fix-actions-requires +44 -0
  149. data/_patches-20160113/eng-11442 +4 -0
  150. data/_patches-20160113/eng-11616 +403 -0
  151. data/_patches-20160113/eng-11616-2 +67 -0
  152. data/_patches-20160113/eng-11616-actual +184 -0
  153. data/_patches-20160113/eng-11625a +4 -0
  154. data/_patches-20160113/eng-11711 +85 -0
  155. data/_patches-20160113/eng-12232-command-spec +236 -0
  156. data/_patches-20160113/eng-12235 +83 -0
  157. data/_patches-20160113/eng-12235-override-refactor +140 -0
  158. data/_patches-20160113/eng-12240 +103 -0
  159. data/_patches-20160113/eng-12249 +40 -0
  160. data/_patches-20160113/eng-12301 +50 -0
  161. data/_patches-20160113/eng-12720 +47 -0
  162. data/_patches-20160113/eng-12843 +95 -0
  163. data/_patches-20160113/env-source +112 -0
  164. data/_patches-20160113/frickin-vagrant-spec +163 -0
  165. data/_patches-20160113/gem-pre-version +14 -0
  166. data/_patches-20160113/gems-old +9 -0
  167. data/_patches-20160113/googles-specs +713 -0
  168. data/_patches-20160113/local-configs-ignore +61 -0
  169. data/_patches-20160113/misc +79 -0
  170. data/_patches-20160113/network-unreachable +31 -0
  171. data/_patches-20160113/new-boxfile +288 -0
  172. data/_patches-20160113/parallelization-maybe +198 -0
  173. data/_patches-20160113/read-state +23 -0
  174. data/_patches-20160113/refactor-to-use-public_address-cap +25 -0
  175. data/_patches-20160113/series +56 -0
  176. data/_patches-20160113/status +14 -0
  177. data/_patches-20160113/test-move-env-data +231 -0
  178. data/_patches-20160113/test-vagrantfile-vm1 +167 -0
  179. data/_patches-20160113/vagrant-spec-mock-api +137 -0
  180. data/_patches-20160113/vagrant-vmware-plugin +233 -0
  181. data/_patches-20160113/vagrantfile +403 -0
  182. data/_patches-20160113/vagrantfile-for-acceptance-tests +29 -0
  183. data/_patches-20160113/vagrantfile-for-nick +95 -0
  184. data/_patches-20160113/vagrantfiles-to-forget-what-they-are-for +134 -0
  185. data/_patches-20160113/vm-vanished +42 -0
  186. data/_patches-20160118/COMPLETED-ABOVE-THIS-LINE +4 -0
  187. data/_patches-20160118/COMPLETED-BELOW-THIS-LINE +4 -0
  188. data/_patches-20160118/CR-ABOVE-THIS-LINE +4 -0
  189. data/_patches-20160118/CR-BELOW-THIS-LINE +4 -0
  190. data/_patches-20160118/WIP-ABOVE-THIS-LINE +4 -0
  191. data/_patches-20160118/WIP-BELOW-THIS-LINE +4 -0
  192. data/_patches-20160118/acceptance-test-runner +29 -0
  193. data/_patches-20160118/ansible-1 +92 -0
  194. data/_patches-20160118/cache-api-client-in-up +40 -0
  195. data/_patches-20160118/dead-code-in-actions +44 -0
  196. data/_patches-20160118/debug-changes +55 -0
  197. data/_patches-20160118/demo-rails-app +1276 -0
  198. data/_patches-20160118/eng-10166-halt-spec +40 -0
  199. data/_patches-20160118/eng-10256 +554 -0
  200. data/_patches-20160118/eng-10256-cr +314 -0
  201. data/_patches-20160118/eng-10256-ubuntu-testing +88 -0
  202. data/_patches-20160118/eng-10269-test-stuff +87 -0
  203. data/_patches-20160118/eng-10269-wtf +119 -0
  204. data/_patches-20160118/eng-10369 +143 -0
  205. data/_patches-20160118/eng-10369-tmp +60 -0
  206. data/_patches-20160118/eng-10919 +56 -0
  207. data/_patches-20160118/eng-11177-fix-actions-requires +44 -0
  208. data/_patches-20160118/eng-11442 +4 -0
  209. data/_patches-20160118/eng-11616 +403 -0
  210. data/_patches-20160118/eng-11616-2 +67 -0
  211. data/_patches-20160118/eng-11616-actual +184 -0
  212. data/_patches-20160118/eng-11625a +4 -0
  213. data/_patches-20160118/eng-11711 +85 -0
  214. data/_patches-20160118/eng-12232-command-spec +236 -0
  215. data/_patches-20160118/eng-12235 +83 -0
  216. data/_patches-20160118/eng-12235-override-refactor +140 -0
  217. data/_patches-20160118/eng-12240 +103 -0
  218. data/_patches-20160118/eng-12249 +40 -0
  219. data/_patches-20160118/eng-12301 +50 -0
  220. data/_patches-20160118/eng-12720 +74 -0
  221. data/_patches-20160118/eng-12843 +95 -0
  222. data/_patches-20160118/eng-13040 +291 -0
  223. data/_patches-20160118/env-source +112 -0
  224. data/_patches-20160118/frickin-vagrant-spec +163 -0
  225. data/_patches-20160118/gem-pre-version +14 -0
  226. data/_patches-20160118/gems-old +9 -0
  227. data/_patches-20160118/googles-specs +713 -0
  228. data/_patches-20160118/local-configs-ignore +61 -0
  229. data/_patches-20160118/misc +79 -0
  230. data/_patches-20160118/network-unreachable +31 -0
  231. data/_patches-20160118/new-boxfile +288 -0
  232. data/_patches-20160118/parallelization-maybe +198 -0
  233. data/_patches-20160118/port-forwarding-processes +87 -0
  234. data/_patches-20160118/read-state +23 -0
  235. data/_patches-20160118/refactor-to-use-public_address-cap +25 -0
  236. data/_patches-20160118/series +59 -0
  237. data/_patches-20160118/status +13 -0
  238. data/_patches-20160118/test-move-env-data +231 -0
  239. data/_patches-20160118/test-vagrantfile-vm1 +167 -0
  240. data/_patches-20160118/vagrant-spec-mock-api +137 -0
  241. data/_patches-20160118/vagrant-vmware-plugin +233 -0
  242. data/_patches-20160118/vagrantfile +403 -0
  243. data/_patches-20160118/vagrantfile-for-acceptance-tests +29 -0
  244. data/_patches-20160118/vagrantfile-for-nick +95 -0
  245. data/_patches-20160118/vagrantfiles-to-forget-what-they-are-for +134 -0
  246. data/_patches-20160118/vm-vanished +42 -0
  247. data/_patches-20160118a/COMPLETED-ABOVE-THIS-LINE +4 -0
  248. data/_patches-20160118a/COMPLETED-BELOW-THIS-LINE +4 -0
  249. data/_patches-20160118a/CR-ABOVE-THIS-LINE +4 -0
  250. data/_patches-20160118a/CR-BELOW-THIS-LINE +4 -0
  251. data/_patches-20160118a/WIP-ABOVE-THIS-LINE +4 -0
  252. data/_patches-20160118a/WIP-BELOW-THIS-LINE +4 -0
  253. data/_patches-20160118a/acceptance-test-runner +29 -0
  254. data/_patches-20160118a/ansible-1 +92 -0
  255. data/_patches-20160118a/bar +189 -0
  256. data/_patches-20160118a/cache-api-client-in-up +40 -0
  257. data/_patches-20160118a/dead-code-in-actions +44 -0
  258. data/_patches-20160118a/debug-changes +55 -0
  259. data/_patches-20160118a/demo-rails-app +1276 -0
  260. data/_patches-20160118a/eng-10166-halt-spec +40 -0
  261. data/_patches-20160118a/eng-10256 +554 -0
  262. data/_patches-20160118a/eng-10256-cr +314 -0
  263. data/_patches-20160118a/eng-10256-ubuntu-testing +88 -0
  264. data/_patches-20160118a/eng-10269-test-stuff +87 -0
  265. data/_patches-20160118a/eng-10269-wtf +119 -0
  266. data/_patches-20160118a/eng-10369 +143 -0
  267. data/_patches-20160118a/eng-10369-tmp +60 -0
  268. data/_patches-20160118a/eng-10919 +56 -0
  269. data/_patches-20160118a/eng-11177-fix-actions-requires +44 -0
  270. data/_patches-20160118a/eng-11442 +4 -0
  271. data/_patches-20160118a/eng-11616 +403 -0
  272. data/_patches-20160118a/eng-11616-2 +67 -0
  273. data/_patches-20160118a/eng-11616-actual +184 -0
  274. data/_patches-20160118a/eng-11625a +4 -0
  275. data/_patches-20160118a/eng-11711 +85 -0
  276. data/_patches-20160118a/eng-12232-command-spec +236 -0
  277. data/_patches-20160118a/eng-12235 +83 -0
  278. data/_patches-20160118a/eng-12235-override-refactor +140 -0
  279. data/_patches-20160118a/eng-12240 +103 -0
  280. data/_patches-20160118a/eng-12249 +40 -0
  281. data/_patches-20160118a/eng-12301 +50 -0
  282. data/_patches-20160118a/eng-12720 +74 -0
  283. data/_patches-20160118a/eng-12843 +95 -0
  284. data/_patches-20160118a/eng-13040 +291 -0
  285. data/_patches-20160118a/env-source +112 -0
  286. data/_patches-20160118a/foo +169 -0
  287. data/_patches-20160118a/frickin-vagrant-spec +163 -0
  288. data/_patches-20160118a/gem-pre-version +14 -0
  289. data/_patches-20160118a/gems-old +9 -0
  290. data/_patches-20160118a/googles-specs +713 -0
  291. data/_patches-20160118a/guestport-madness +59 -0
  292. data/_patches-20160118a/local-configs-ignore +61 -0
  293. data/_patches-20160118a/misc +79 -0
  294. data/_patches-20160118a/network-unreachable +31 -0
  295. data/_patches-20160118a/new-boxfile +288 -0
  296. data/_patches-20160118a/parallelization-maybe +198 -0
  297. data/_patches-20160118a/port-forwarding-processes +87 -0
  298. data/_patches-20160118a/read-state +23 -0
  299. data/_patches-20160118a/refactor-to-use-public_address-cap +25 -0
  300. data/_patches-20160118a/series +62 -0
  301. data/_patches-20160118a/status +14 -0
  302. data/_patches-20160118a/test-move-env-data +231 -0
  303. data/_patches-20160118a/test-vagrantfile-vm1 +167 -0
  304. data/_patches-20160118a/vagrant-spec-mock-api +137 -0
  305. data/_patches-20160118a/vagrant-vmware-plugin +233 -0
  306. data/_patches-20160118a/vagrantfile +403 -0
  307. data/_patches-20160118a/vagrantfile-for-acceptance-tests +29 -0
  308. data/_patches-20160118a/vagrantfile-for-nick +95 -0
  309. data/_patches-20160118a/vagrantfiles-to-forget-what-they-are-for +134 -0
  310. data/_patches-20160118a/vm-vanished +42 -0
  311. data/lib/vagrant-skytap/action/clear_forwarded_ports.rb +19 -0
  312. data/lib/vagrant-skytap/action/forward_ports.rb +42 -0
  313. data/lib/vagrant-skytap/action/prepare_forwarded_port_collision_params.rb +37 -0
  314. data/lib/vagrant-skytap/action.rb +18 -0
  315. data/lib/vagrant-skytap/api/environment.rb +19 -4
  316. data/lib/vagrant-skytap/api/vm.rb +10 -6
  317. data/lib/vagrant-skytap/command/up.rb +7 -1
  318. data/lib/vagrant-skytap/errors.rb +4 -0
  319. data/lib/vagrant-skytap/hosts/bsd/cap/ssh_tunnel.rb +15 -0
  320. data/lib/vagrant-skytap/hosts/common/cap/ssh_tunnel.rb +183 -0
  321. data/lib/vagrant-skytap/hosts/linux/cap/ssh_tunnel.rb +15 -0
  322. data/lib/vagrant-skytap/hosts/windows/cap/ssh_tunnel.rb +27 -0
  323. data/lib/vagrant-skytap/model/forwarded_port.rb +78 -0
  324. data/lib/vagrant-skytap/plugin.rb +15 -0
  325. data/lib/vagrant-skytap/util/compile_forwarded_ports.rb +35 -0
  326. data/lib/vagrant-skytap/version.rb +1 -1
  327. data/locales/en.yml +3 -0
  328. data/spec/unit/environment_spec.rb +14 -2
  329. data/spec/unit/forwarded_port_spec.rb +45 -0
  330. data/spec/unit/hosts/common/cap/ssh_tunnel_spec.rb +180 -0
  331. data/spec/unit/prepare_collision_params_spec.rb +57 -0
  332. data/spec/unit/support/forwarded_ports/machines/vm1/skytap/id +1 -0
  333. data/spec/unit/support/forwarded_ports/machines/vm1/skytap/private_key +4 -0
  334. data/spec/unit/support/forwarded_ports/machines/vm1/skytap/tcp9000_tcp_9000_80.pid +1 -0
  335. data/spec/unit/support/forwarded_ports/machines/vm1/skytap/tcp9001_tcp_9001_81.pid +1 -0
  336. data/spec/unit/support/forwarded_ports/machines/vm1/virtualbox/id +1 -0
  337. data/spec/unit/support/forwarded_ports/machines/vm2/skytap/id +1 -0
  338. data/spec/unit/support/forwarded_ports/machines/vm2/skytap/tcp8080_tcp_8080_80.pid +1 -0
  339. data/spec/unit/support/forwarded_ports/machines/vm3/virtualbox/id +1 -0
  340. data/spec/unit/support/forwarded_ports/machines/vm4/skytap/id +1 -0
  341. data/spec/unit/support/forwarded_ports/machines/vm4/skytap/tcp8888_tcp_8888_80.pid +1 -0
  342. metadata +330 -2
@@ -0,0 +1,713 @@
1
+ # HG changeset patch
2
+ # Parent cc7a47cd4204ca0a01605c415bad7f2f3e1ba9a9
3
+ imported patch googles-specs
4
+
5
+ diff -r cc7a47cd4204 Rakefile
6
+ --- a/Rakefile Thu Sep 10 15:27:23 2015 -0700
7
+ +++ b/Rakefile Fri Sep 11 15:11:26 2015 -0700
8
+ @@ -19,3 +19,12 @@
9
+
10
+ # Default task is to run the unit tests
11
+ task :default => "spec"
12
+ +
13
+ +# Load all the rake tasks from the "tasks" folder. This folder
14
+ +# allows us to nicely separate rake tasks into individual files
15
+ +# based on their role, which makes development and debugging easier
16
+ +# than one monolithic file.
17
+ +task_dir = File.expand_path("../tasks", __FILE__)
18
+ +Dir["#{task_dir}/**/*.rake"].each do |task_file|
19
+ + load task_file
20
+ +end
21
+ diff -r cc7a47cd4204 spec/vagrant-skytap/acceptance/base.rb
22
+ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
23
+ +++ b/spec/vagrant-skytap/acceptance/base.rb Fri Sep 11 15:11:26 2015 -0700
24
+ @@ -0,0 +1,2 @@
25
+ +require "vagrant-spec/acceptance"
26
+ +require_relative "shared/context_google"
27
+ diff -r cc7a47cd4204 spec/vagrant-skytap/acceptance/provider/halt_spec.rb
28
+ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
29
+ +++ b/spec/vagrant-skytap/acceptance/provider/halt_spec.rb Fri Sep 11 15:11:26 2015 -0700
30
+ @@ -0,0 +1,34 @@
31
+ +# This tests that an instance can be halted correctly
32
+ +shared_examples 'provider/halt' do |provider, options|
33
+ + if !options[:box]
34
+ + raise ArgumentError,
35
+ + "box option must be specified for provider: #{provider}"
36
+ + end
37
+ +
38
+ + include_context 'acceptance'
39
+ +
40
+ + before do
41
+ + environment.skeleton('generic')
42
+ + assert_execute('vagrant', 'box', 'add', 'basic', options[:box])
43
+ + assert_execute('vagrant', 'up', "--provider=#{provider}")
44
+ + end
45
+ +
46
+ + after do
47
+ + assert_execute('vagrant', 'destroy', '--force')
48
+ + end
49
+ +
50
+ + it 'should halt the machine and bring it back up' do
51
+ + status("Test: machine can be halted")
52
+ + halt_result = execute("vagrant", "halt")
53
+ + expect(halt_result).to exit_with(0)
54
+ +
55
+ + status("Test: machine can be brought up after halt")
56
+ + up_result = execute("vagrant", "up")
57
+ + expect(up_result).to exit_with(0)
58
+ +
59
+ + status("Test: machine is running after up")
60
+ + echo_result = execute("vagrant", "ssh", "-c", "echo foo")
61
+ + expect(echo_result).to exit_with(0)
62
+ + expect(echo_result.stdout).to match(/foo\n$/)
63
+ + end
64
+ +end
65
+ diff -r cc7a47cd4204 spec/vagrant-skytap/acceptance/provider/multi_instance_spec.rb
66
+ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
67
+ +++ b/spec/vagrant-skytap/acceptance/provider/multi_instance_spec.rb Fri Sep 11 15:11:26 2015 -0700
68
+ @@ -0,0 +1,31 @@
69
+ +# This tests that multiple instances can be brought up correctly
70
+ +shared_examples 'provider/multi_instance' do |provider, options|
71
+ + if !options[:box]
72
+ + raise ArgumentError,
73
+ + "box option must be specified for provider: #{provider}"
74
+ + end
75
+ +
76
+ + include_context 'acceptance'
77
+ +
78
+ + before do
79
+ + environment.skeleton('multi_instance')
80
+ + assert_execute('vagrant', 'box', 'add', 'basic', options[:box])
81
+ + assert_execute('vagrant', 'up', "--provider=#{provider}")
82
+ + end
83
+ +
84
+ + after do
85
+ + assert_execute('vagrant', 'destroy', '--force')
86
+ + end
87
+ +
88
+ + it 'should bring up 2 machines in different zones' do
89
+ + status("Test: both machines are running after up")
90
+ + status("Test: machine1 is running after up")
91
+ + result1 = execute("vagrant", "ssh", "z1a", "-c", "echo foo")
92
+ + expect(result1).to exit_with(0)
93
+ + expect(result1.stdout).to match(/foo\n$/)
94
+ + status("Test: machine2 is running after up")
95
+ + result1 = execute("vagrant", "ssh", "z1b", "-c", "echo foo")
96
+ + expect(result1).to exit_with(0)
97
+ + expect(result1.stdout).to match(/foo\n$/)
98
+ + end
99
+ +end
100
+ diff -r cc7a47cd4204 spec/vagrant-skytap/acceptance/provider/preemptible_spec.rb
101
+ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
102
+ +++ b/spec/vagrant-skytap/acceptance/provider/preemptible_spec.rb Fri Sep 11 15:11:26 2015 -0700
103
+ @@ -0,0 +1,26 @@
104
+ +# This tests that a preemptible instance can be brought up correctly
105
+ +shared_examples 'provider/preemptible' do |provider, options|
106
+ + if !options[:box]
107
+ + raise ArgumentError,
108
+ + "box option must be specified for provider: #{provider}"
109
+ + end
110
+ +
111
+ + include_context 'acceptance'
112
+ +
113
+ + before do
114
+ + environment.skeleton('preemptible')
115
+ + assert_execute('vagrant', 'box', 'add', 'basic', options[:box])
116
+ + assert_execute('vagrant', 'up', "--provider=#{provider}")
117
+ + end
118
+ +
119
+ + after do
120
+ + assert_execute('vagrant', 'destroy', '--force')
121
+ + end
122
+ +
123
+ + it 'should bring up machine with preemptible option' do
124
+ + status("Test: machine is running after up")
125
+ + result = execute("vagrant", "ssh", "-c", "echo foo")
126
+ + expect(result).to exit_with(0)
127
+ + expect(result.stdout).to match(/foo\n$/)
128
+ + end
129
+ +end
130
+ diff -r cc7a47cd4204 spec/vagrant-skytap/acceptance/provider/reload_spec.rb
131
+ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
132
+ +++ b/spec/vagrant-skytap/acceptance/provider/reload_spec.rb Fri Sep 11 15:11:26 2015 -0700
133
+ @@ -0,0 +1,29 @@
134
+ +# This tests that an instance can be reloaded correctly
135
+ +shared_examples 'provider/reload' do |provider, options|
136
+ + if !options[:box]
137
+ + raise ArgumentError,
138
+ + "box option must be specified for provider: #{provider}"
139
+ + end
140
+ +
141
+ + include_context 'acceptance'
142
+ +
143
+ + before do
144
+ + environment.skeleton('generic')
145
+ + assert_execute('vagrant', 'box', 'add', 'basic', options[:box])
146
+ + assert_execute('vagrant', 'up', "--provider=#{provider}")
147
+ + end
148
+ +
149
+ + after do
150
+ + assert_execute('vagrant', 'destroy', '--force')
151
+ + end
152
+ +
153
+ + it 'should reload the machine correctly' do
154
+ + status("Test: machine can be reloaded")
155
+ + reload_result = execute("vagrant", "reload")
156
+ + expect(reload_result).to exit_with(0)
157
+ +
158
+ + echo_result = execute("vagrant", "ssh", "-c", "echo foo")
159
+ + expect(echo_result).to exit_with(0)
160
+ + expect(echo_result.stdout).to match(/foo\n$/)
161
+ + end
162
+ +end
163
+ diff -r cc7a47cd4204 spec/vagrant-skytap/acceptance/provider/scopes_spec.rb
164
+ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
165
+ +++ b/spec/vagrant-skytap/acceptance/provider/scopes_spec.rb Fri Sep 11 15:11:26 2015 -0700
166
+ @@ -0,0 +1,29 @@
167
+ +# This tests that account scopes can be configured correctly
168
+ +# Additionally, this verifies that the 'scopes' method alias is
169
+ +# available and gcloud GCE aliases can be used.
170
+ +# (see lib/fog/google/models/compute/server.rb in fog-google)
171
+ +shared_examples 'provider/scopes' do |provider, options|
172
+ + if !options[:box]
173
+ + raise ArgumentError,
174
+ + "box option must be specified for provider: #{provider}"
175
+ + end
176
+ +
177
+ + include_context 'acceptance'
178
+ +
179
+ + before do
180
+ + environment.skeleton('scopes')
181
+ + assert_execute('vagrant', 'box', 'add', 'basic', options[:box])
182
+ + assert_execute('vagrant', 'up', "--provider=#{provider}")
183
+ + end
184
+ +
185
+ + after do
186
+ + assert_execute('vagrant', 'destroy', '--force')
187
+ + end
188
+ +
189
+ + it 'should bring up machine with scope definitions' do
190
+ + status("Test: machine is running after up")
191
+ + result = execute("vagrant", "ssh", "-c", "echo foo")
192
+ + expect(result).to exit_with(0)
193
+ + expect(result.stdout).to match(/foo\n$/)
194
+ + end
195
+ +end
196
+ diff -r cc7a47cd4204 spec/vagrant-skytap/acceptance/shared/context_google.rb
197
+ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
198
+ +++ b/spec/vagrant-skytap/acceptance/shared/context_google.rb Fri Sep 11 15:11:26 2015 -0700
199
+ @@ -0,0 +1,3 @@
200
+ +shared_context "provider-context/google" do
201
+ +
202
+ +end
203
+ diff -r cc7a47cd4204 spec/vagrant-skytap/acceptance/skeletons/generic/Vagrantfile
204
+ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
205
+ +++ b/spec/vagrant-skytap/acceptance/skeletons/generic/Vagrantfile Fri Sep 11 15:11:26 2015 -0700
206
+ @@ -0,0 +1,17 @@
207
+ +# This is a generic acceptance skeleton with no particular settings, set in
208
+ +# europe-west1-d zone
209
+ +
210
+ +Vagrant.configure("2") do |config|
211
+ + config.vm.box = "basic"
212
+ +
213
+ + config.vm.provider :google do |google, override|
214
+ +
215
+ + google.zone = "europe-west1-d"
216
+ +
217
+ + google.zone_config "europe-west1-d" do |zone1d|
218
+ + zone1d.name = "vagrant-testing-halt"
219
+ + zone1d.image = "debian-7-wheezy-v20150603"
220
+ + zone1d.zone = "europe-west1-d"
221
+ + end
222
+ + end
223
+ +end
224
+ diff -r cc7a47cd4204 spec/vagrant-skytap/acceptance/skeletons/multi_instance/Vagrantfile
225
+ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
226
+ +++ b/spec/vagrant-skytap/acceptance/skeletons/multi_instance/Vagrantfile Fri Sep 11 15:11:26 2015 -0700
227
+ @@ -0,0 +1,29 @@
228
+ +Vagrant.configure("2") do |config|
229
+ + config.vm.box = "basic"
230
+ +
231
+ + config.vm.define :z1a do |z1a|
232
+ + z1a.vm.provider :google do |google, override|
233
+ + google.zone = "europe-west1-c"
234
+ +
235
+ + google.zone_config "europe-west1-c" do |z1a_zone|
236
+ + z1a_zone.name = "vagrant-testing-acceptance-multi-z1a"
237
+ + z1a_zone.image = "debian-7-wheezy-v20150603"
238
+ + z1a_zone.machine_type = "n1-standard-1"
239
+ + z1a_zone.zone = "europe-west1-c"
240
+ + end
241
+ + end
242
+ + end
243
+ +
244
+ + config.vm.define :z1b do |z1b|
245
+ + z1b.vm.provider :google do |google, override|
246
+ + google.zone = "europe-west1-d"
247
+ +
248
+ + google.zone_config "europe-west1-d" do |z1b_zone|
249
+ + z1b_zone.name = "vagrant-testing-acceptance-multi-z1b"
250
+ + z1b_zone.image = "debian-7-wheezy-v20150603"
251
+ + z1b_zone.machine_type = "n1-standard-2"
252
+ + z1b_zone.zone = "europe-west1-d"
253
+ + end
254
+ + end
255
+ + end
256
+ +end
257
+ diff -r cc7a47cd4204 spec/vagrant-skytap/acceptance/skeletons/preemptible/Vagrantfile
258
+ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
259
+ +++ b/spec/vagrant-skytap/acceptance/skeletons/preemptible/Vagrantfile Fri Sep 11 15:11:26 2015 -0700
260
+ @@ -0,0 +1,17 @@
261
+ +Vagrant.configure("2") do |config|
262
+ + config.vm.box = "basic"
263
+ +
264
+ + config.vm.provider :google do |google, override|
265
+ +
266
+ + google.zone = "europe-west1-d"
267
+ +
268
+ + google.zone_config "europe-west1-d" do |zone1d|
269
+ + zone1d.name = "vagrant-testing-preemptible"
270
+ + zone1d.image = "debian-7-wheezy-v20150603"
271
+ + zone1d.zone = "europe-west1-d"
272
+ + zone1d.preemptible = true
273
+ + zone1d.auto_restart = false
274
+ + zone1d.on_host_maintenance = "TERMINATE"
275
+ + end
276
+ + end
277
+ +end
278
+ diff -r cc7a47cd4204 spec/vagrant-skytap/acceptance/skeletons/scopes/Vagrantfile
279
+ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
280
+ +++ b/spec/vagrant-skytap/acceptance/skeletons/scopes/Vagrantfile Fri Sep 11 15:11:26 2015 -0700
281
+ @@ -0,0 +1,18 @@
282
+ +Vagrant.configure("2") do |config|
283
+ + config.vm.box = "basic"
284
+ +
285
+ + config.vm.provider :google do |google, override|
286
+ +
287
+ + google.zone = "europe-west1-d"
288
+ +
289
+ + google.zone_config "europe-west1-d" do |zone1d|
290
+ + zone1d.name = "vagrant-testing-acceptance-scopes"
291
+ + zone1d.scopes = ['sql-admin',
292
+ + 'bigquery',
293
+ + 'https://www.googleapis.com/auth/compute'
294
+ + ]
295
+ + zone1d.image = "debian-7-wheezy-v20150603"
296
+ + zone1d.zone = "europe-west1-d"
297
+ + end
298
+ + end
299
+ +end
300
+ diff -r cc7a47cd4204 spec/vagrant-skytap/unit/base.rb
301
+ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
302
+ +++ b/spec/vagrant-skytap/unit/base.rb Fri Sep 11 15:11:26 2015 -0700
303
+ @@ -0,0 +1,19 @@
304
+ +require "rubygems"
305
+ +require "rspec/autorun"
306
+ +
307
+ +# Require Vagrant itself so we can reference the proper
308
+ +# classes to test.
309
+ +require "vagrant"
310
+ +require "vagrant-google"
311
+ +
312
+ +# Add the test directory to the load path
313
+ +$LOAD_PATH.unshift File.expand_path("../../", __FILE__)
314
+ +
315
+ +# Do not buffer output
316
+ +$stdout.sync = true
317
+ +$stderr.sync = true
318
+ +
319
+ +# Configure RSpec
320
+ +RSpec.configure do |c|
321
+ + c.formatter = :progress
322
+ +end
323
+ diff -r cc7a47cd4204 spec/vagrant-skytap/unit/common/config_test.rb
324
+ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
325
+ +++ b/spec/vagrant-skytap/unit/common/config_test.rb Fri Sep 11 15:11:26 2015 -0700
326
+ @@ -0,0 +1,297 @@
327
+ +# Copyright 2013 Google Inc. All Rights Reserved.
328
+ +#
329
+ +# Licensed under the Apache License, Version 2.0 (the "License");
330
+ +# you may not use this file except in compliance with the License.
331
+ +# You may obtain a copy of the License at
332
+ +#
333
+ +# http://www.apache.org/licenses/LICENSE-2.0
334
+ +#
335
+ +# Unless required by applicable law or agreed to in writing, software
336
+ +# distributed under the License is distributed on an "AS IS" BASIS,
337
+ +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
338
+ +# See the License for the specific language governing permissions and
339
+ +# limitations under the License.
340
+ +require File.expand_path("../../base", __FILE__)
341
+ +
342
+ +require "vagrant-google/config"
343
+ +
344
+ +describe VagrantPlugins::Google::Config do
345
+ + let(:instance) { described_class.new }
346
+ +
347
+ + # Ensure tests are not affected by Google credential environment variables
348
+ + before :each do
349
+ + ENV.stub(:[] => nil)
350
+ + end
351
+ +
352
+ + describe "defaults" do
353
+ + subject do
354
+ + instance.tap do |o|
355
+ + o.finalize!
356
+ + end
357
+ + end
358
+ +
359
+ + its("name") { should match "i-[0-9]{10}-[0-9a-f]{4}" }
360
+ + its("image") { should == "debian-7-wheezy-v20150127" }
361
+ + its("zone") { should == "us-central1-f" }
362
+ + its("network") { should == "default" }
363
+ + its("machine_type") { should == "n1-standard-1" }
364
+ + its("disk_size") { should == 10 }
365
+ + its("disk_name") { should be_nil }
366
+ + its("disk_type") { should == "pd-standard" }
367
+ + its("instance_ready_timeout") { should == 20 }
368
+ + its("metadata") { should == {} }
369
+ + its("tags") { should == [] }
370
+ + its("service_accounts") { should == nil }
371
+ + its("preemptible") { should be_false }
372
+ + its("auto_restart") { should }
373
+ + its("on_host_maintenance") { should == "MIGRATE" }
374
+ + end
375
+ +
376
+ + describe "overriding defaults" do
377
+ + # I typically don't meta-program in tests, but this is a very
378
+ + # simple boilerplate test, so I cut corners here. It just sets
379
+ + # each of these attributes to "foo" in isolation, and reads the value
380
+ + # and asserts the proper result comes back out.
381
+ + [:name, :image, :zone, :instance_ready_timeout, :machine_type, :disk_size, :disk_name, :disk_type,
382
+ + :network, :metadata, :can_ip_forward, :external_ip, :autodelete_disk].each do |attribute|
383
+ +
384
+ + it "should not default #{attribute} if overridden" do
385
+ + instance.send("#{attribute}=".to_sym, "foo")
386
+ + instance.finalize!
387
+ + instance.send(attribute).should == "foo"
388
+ + end
389
+ + end
390
+ +
391
+ + it "should raise error when preemptible and auto_restart is true" do
392
+ + instance.preemptible = true
393
+ + instance.auto_restart = true
394
+ + expected_error = "en.vagrant_google.config.auto_restart_invalid_on_preemptible"
395
+ + instance.finalize!
396
+ + errors = instance.validate("foo")["Google Provider"]
397
+ + errors.inject(false) { |a, e| a or e.include?(expected_error) }.should == true
398
+ + end
399
+ +
400
+ + it "should raise error when preemptible and on_host_maintenance is not TERMINATE" do
401
+ + instance.preemptible = true
402
+ + instance.on_host_maintenance = "MIGRATE"
403
+ + expected_error = "en.vagrant_google.config.on_host_maintenance_invalid_on_preemptible"
404
+ + instance.finalize!
405
+ + errors = instance.validate("foo")["Google Provider"]
406
+ + errors.inject(false) { |a, e| a or e.include?(expected_error) }.should == true
407
+ + end
408
+ + end
409
+ +
410
+ + describe "getting credentials from environment" do
411
+ + context "without Google credential environment variables" do
412
+ + subject do
413
+ + instance.tap do |o|
414
+ + o.finalize!
415
+ + end
416
+ + end
417
+ +
418
+ + its("google_client_email") { should be_nil }
419
+ + its("google_key_location") { should be_nil }
420
+ + its("google_json_key_location") { should be_nil }
421
+ + end
422
+ +
423
+ + context "with Google credential environment variables" do
424
+ + before :each do
425
+ + ENV.stub(:[]).with("GOOGLE_CLIENT_EMAIL").and_return("client_id_email")
426
+ + ENV.stub(:[]).with("GOOGLE_KEY_LOCATION").and_return("/path/to/key")
427
+ + ENV.stub(:[]).with("GOOGLE_JSON_KEY_LOCATION").and_return("/path/to/json/key")
428
+ + end
429
+ +
430
+ + subject do
431
+ + instance.tap do |o|
432
+ + o.finalize!
433
+ + end
434
+ + end
435
+ +
436
+ + its("google_client_email") { should == "client_id_email" }
437
+ + its("google_key_location") { should == "/path/to/key" }
438
+ + its("google_json_key_location") { should == "/path/to/json/key" }
439
+ + end
440
+ +
441
+ + context "With both Google credential environment variables" do
442
+ + before :each do
443
+ + ENV.stub(:[]).with("GOOGLE_CLIENT_EMAIL").and_return("client_id_email")
444
+ + ENV.stub(:[]).with("GOOGLE_KEY_LOCATION").and_return("/path/to/key")
445
+ + ENV.stub(:[]).with("GOOGLE_JSON_KEY_LOCATION").and_return("/path/to/json/key")
446
+ + end
447
+ +
448
+ + it "Should return duplicate key location errors" do
449
+ + instance.finalize!
450
+ + expect(instance.validate("foo")["Google Provider"][1]).to include("en.vagrant_google.config.google_duplicate_key_location")
451
+ + end
452
+ + end
453
+ +
454
+ + context "With none of the Google credential environment variables set" do
455
+ + before :each do
456
+ + ENV.stub(:[]).with("GOOGLE_CLIENT_EMAIL").and_return("client_id_email")
457
+ + end
458
+ +
459
+ + it "Should return no key set errors" do
460
+ + instance.finalize!
461
+ + expect(instance.validate("foo")["Google Provider"][1]).to include("en.vagrant_google.config.google_key_location_required")
462
+ + end
463
+ + end
464
+ + end
465
+ +
466
+ + describe "zone config" do
467
+ + let(:config_image) { "foo" }
468
+ + let(:config_machine_type) { "foo" }
469
+ + let(:config_disk_size) { 99 }
470
+ + let(:config_disk_name) { "foo" }
471
+ + let(:config_disk_type) { "foo" }
472
+ + let(:config_name) { "foo" }
473
+ + let(:config_zone) { "foo" }
474
+ + let(:config_network) { "foo" }
475
+ + let(:can_ip_forward) { true }
476
+ + let(:external_ip) { "foo" }
477
+ +
478
+ + def set_test_values(instance)
479
+ + instance.name = config_name
480
+ + instance.network = config_network
481
+ + instance.image = config_image
482
+ + instance.machine_type = config_machine_type
483
+ + instance.disk_size = config_disk_size
484
+ + instance.disk_name = config_disk_name
485
+ + instance.disk_type = config_disk_type
486
+ + instance.zone = config_zone
487
+ + instance.can_ip_forward = can_ip_forward
488
+ + instance.external_ip = external_ip
489
+ + end
490
+ +
491
+ + it "should raise an exception if not finalized" do
492
+ + expect { instance.get_zone_config("us-central1-f") }.
493
+ + to raise_error
494
+ + end
495
+ +
496
+ + context "with no specific config set" do
497
+ + subject do
498
+ + # Set the values on the top-level object
499
+ + set_test_values(instance)
500
+ +
501
+ + # Finalize so we can get the zone config
502
+ + instance.finalize!
503
+ +
504
+ + # Get a lower level zone
505
+ + instance.get_zone_config("us-central1-f")
506
+ + end
507
+ +
508
+ + its("name") { should == config_name }
509
+ + its("image") { should == config_image }
510
+ + its("machine_type") { should == config_machine_type }
511
+ + its("disk_size") { should == config_disk_size }
512
+ + its("disk_name") { should == config_disk_name }
513
+ + its("disk_type") { should == config_disk_type }
514
+ + its("network") { should == config_network }
515
+ + its("zone") { should == config_zone }
516
+ + its("can_ip_forward") { should == can_ip_forward }
517
+ + its("external_ip") { should == external_ip }
518
+ + end
519
+ +
520
+ + context "with a specific config set" do
521
+ + let(:zone_name) { "hashi-zone" }
522
+ +
523
+ + subject do
524
+ + # Set the values on a specific zone
525
+ + instance.zone_config zone_name do |config|
526
+ + set_test_values(config)
527
+ + end
528
+ +
529
+ + # Finalize so we can get the zone config
530
+ + instance.finalize!
531
+ +
532
+ + # Get the zone
533
+ + instance.get_zone_config(zone_name)
534
+ + end
535
+ +
536
+ + its("name") { should == config_name }
537
+ + its("image") { should == config_image }
538
+ + its("machine_type") { should == config_machine_type }
539
+ + its("disk_size") { should == config_disk_size }
540
+ + its("disk_name") { should == config_disk_name }
541
+ + its("disk_type") { should == config_disk_type }
542
+ + its("network") { should == config_network }
543
+ + its("zone") { should == zone_name }
544
+ + its("can_ip_forward") { should == can_ip_forward }
545
+ + its("external_ip") { should == external_ip }
546
+ + end
547
+ +
548
+ + describe "inheritance of parent config" do
549
+ + let(:zone) { "hashi-zone" }
550
+ +
551
+ + subject do
552
+ + # Set the values on a specific zone
553
+ + instance.zone_config zone do |config|
554
+ + config.image = "child"
555
+ + end
556
+ +
557
+ + # Set some top-level values
558
+ + instance.image = "parent"
559
+ +
560
+ + # Finalize and get the zone
561
+ + instance.finalize!
562
+ + instance.get_zone_config(zone)
563
+ + end
564
+ +
565
+ + its("image") { should == "child" }
566
+ + end
567
+ +
568
+ + describe "shortcut configuration" do
569
+ + subject do
570
+ + # Use the shortcut configuration to set some values
571
+ + instance.zone_config "us-central1-f", :image => "child"
572
+ + instance.finalize!
573
+ + instance.get_zone_config("us-central1-f")
574
+ + end
575
+ +
576
+ + its("image") { should == "child" }
577
+ + end
578
+ +
579
+ + describe "merging" do
580
+ + let(:first) { described_class.new }
581
+ + let(:second) { described_class.new }
582
+ +
583
+ + it "should merge the metadata" do
584
+ + first.metadata["one"] = "foo"
585
+ + second.metadata["two"] = "bar"
586
+ +
587
+ + third = first.merge(second)
588
+ + third.metadata.should == {
589
+ + "one" => "foo",
590
+ + "two" => "bar"
591
+ + }
592
+ + end
593
+ + end
594
+ +
595
+ + describe "zone_preemptible" do
596
+ + let(:zone) { "hashi-zone" }
597
+ + subject do
598
+ + instance.zone = zone
599
+ + instance.zone_config zone do |config|
600
+ + config.preemptible = true
601
+ + config.auto_restart = true
602
+ + config.on_host_maintenance = "MIGRATE"
603
+ + end
604
+ +
605
+ + instance.tap do |o|
606
+ + o.finalize!
607
+ + end
608
+ + end
609
+ +
610
+ + it "should fail auto_restart validation" do
611
+ + expected_error = "en.vagrant_google.config.auto_restart_invalid_on_preemptible"
612
+ + errors = subject.validate("foo")["Google Provider"]
613
+ + errors.inject(false) { |a, e| a or e.include?(expected_error) }.should == true
614
+ + end
615
+ +
616
+ + it "should fail on_host_maintenance validation" do
617
+ + expected_error = "en.vagrant_google.config.on_host_maintenance_invalid_on_preemptible"
618
+ + errors = subject.validate("foo")["Google Provider"]
619
+ + errors.inject(false) { |a, e| a or e.include?(expected_error) }.should == true
620
+ + end
621
+ + end
622
+ + end
623
+ +end
624
+ diff -r cc7a47cd4204 tasks/acceptance.rake
625
+ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
626
+ +++ b/tasks/acceptance.rake Fri Sep 11 15:11:26 2015 -0700
627
+ @@ -0,0 +1,52 @@
628
+ +def colorize(text, color_code)
629
+ + puts "\033[#{color_code}m#{text}\033[0m"
630
+ +end
631
+ +
632
+ +{
633
+ + :red => 31,
634
+ + :green => 32,
635
+ + :yellow => 33
636
+ +}.each do |key, color_code|
637
+ + define_method key do |text|
638
+ + colorize(text, color_code)
639
+ + end
640
+ +end
641
+ +
642
+ +namespace :acceptance do
643
+ +
644
+ + desc "shows components that can be tested separately"
645
+ + task :components do
646
+ + exec("bundle exec vagrant-spec components")
647
+ + end
648
+ +
649
+ + desc "runs acceptance tests using vagrant-spec"
650
+ + task :run do
651
+ +
652
+ +# yellow "NOTE: For acceptance tests to be functional, correct ssh key needs to be added to GCE metadata."
653
+ +#
654
+ +# if !ENV["GOOGLE_JSON_KEY_LOCATION"] && !ENV["GOOGLE_KEY_LOCATION"]
655
+ +# abort ("Environment variables GOOGLE_JSON_KEY_LOCATION or GOOGLE_KEY_LOCATION are not set. Aborting.")
656
+ +# end
657
+ +#
658
+ +# if !ENV["GOOGLE_PROJECT_ID"]
659
+ +# abort ("Environment variable GOOGLE_PROJECT_ID is not set. Aborting.")
660
+ +# end
661
+ +#
662
+ +# if !ENV["GOOGLE_CLIENT_EMAIL"]
663
+ +# abort ("Environment variable GOOGLE_CLIENT_EMAIL is not set. Aborting.")
664
+ +# end
665
+ +#
666
+ +# if !ENV["GOOGLE_SSH_USER"]
667
+ +# puts "WARNING: GOOGLE_SSH_USER variable is not set. Will try to start tests using insecure Vagrant private key."
668
+ +# end
669
+ +
670
+ + components = %w(
671
+ + halt
672
+ + ).map{ |s| "provider/skytap/#{s}" }
673
+ +
674
+ + command = "bundle exec vagrant-spec test --components=#{components.join(" ")}"
675
+ + puts command
676
+ + puts
677
+ + exec(command)
678
+ + end
679
+ +end
680
+ diff -r cc7a47cd4204 tasks/bundler.rake
681
+ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
682
+ +++ b/tasks/bundler.rake Fri Sep 11 15:11:26 2015 -0700
683
+ @@ -0,0 +1,3 @@
684
+ +# This installs the tasks that help with gem creation and
685
+ +# publishing.
686
+ +Bundler::GemHelper.install_tasks
687
+ diff -r cc7a47cd4204 tasks/lint.rake
688
+ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
689
+ +++ b/tasks/lint.rake Fri Sep 11 15:11:26 2015 -0700
690
+ @@ -0,0 +1,3 @@
691
+ +#require 'rubocop/rake_task'
692
+ +
693
+ +#RuboCop::RakeTask.new(:lint)
694
+ diff -r cc7a47cd4204 tasks/test.rake
695
+ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
696
+ +++ b/tasks/test.rake Fri Sep 11 15:11:26 2015 -0700
697
+ @@ -0,0 +1,9 @@
698
+ +require 'rake/testtask'
699
+ +require 'rspec/core/rake_task'
700
+ +
701
+ +namespace :test do
702
+ + RSpec::Core::RakeTask.new(:unit) do |t|
703
+ + t.pattern = "test/unit/**/*_test.rb"
704
+ + t.rspec_opts = "--color"
705
+ + end
706
+ +end
707
+ diff -r cc7a47cd4204 vagrant-spec.config.rb
708
+ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
709
+ +++ b/vagrant-spec.config.rb Fri Sep 11 15:11:26 2015 -0700
710
+ @@ -0,0 +1,3 @@
711
+ +Vagrant::Spec::Acceptance.configure do |c|
712
+ + # ...
713
+ +end