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.
- checksums.yaml +4 -4
- data/.byebug_history +242 -19
- data/CHANGELOG.md +9 -0
- data/README.md +30 -8
- data/Vagrantfile.rej +83 -0
- data/_patches-20160112/0 +388 -0
- data/_patches-20160112/1 +82 -0
- data/_patches-20160112/2 +239 -0
- data/_patches-20160112/COMPLETED-ABOVE-THIS-LINE +4 -0
- data/_patches-20160112/COMPLETED-BELOW-THIS-LINE +4 -0
- data/_patches-20160112/CR-ABOVE-THIS-LINE +4 -0
- data/_patches-20160112/CR-BELOW-THIS-LINE +4 -0
- data/_patches-20160112/WIP-ABOVE-THIS-LINE +4 -0
- data/_patches-20160112/WIP-BELOW-THIS-LINE +4 -0
- data/_patches-20160112/acceptance-test-runner +29 -0
- data/_patches-20160112/ansible-1 +92 -0
- data/_patches-20160112/cache-api-client-in-up +40 -0
- data/_patches-20160112/dead-code-in-actions +44 -0
- data/_patches-20160112/debug-changes +42 -0
- data/_patches-20160112/demo-rails-app +1276 -0
- data/_patches-20160112/eng-10166-halt-spec +40 -0
- data/_patches-20160112/eng-10256 +527 -0
- data/_patches-20160112/eng-10256-2 +162 -0
- data/_patches-20160112/eng-10256-ubuntu-testing +88 -0
- data/_patches-20160112/eng-10269-test-stuff +87 -0
- data/_patches-20160112/eng-10269-wtf +119 -0
- data/_patches-20160112/eng-10369 +143 -0
- data/_patches-20160112/eng-10369-tmp +60 -0
- data/_patches-20160112/eng-10919 +56 -0
- data/_patches-20160112/eng-11177-fix-actions-requires +44 -0
- data/_patches-20160112/eng-11442 +4 -0
- data/_patches-20160112/eng-11616 +403 -0
- data/_patches-20160112/eng-11616-2 +67 -0
- data/_patches-20160112/eng-11616-actual +184 -0
- data/_patches-20160112/eng-11625a +4 -0
- data/_patches-20160112/eng-11711 +85 -0
- data/_patches-20160112/eng-12232-command-spec +236 -0
- data/_patches-20160112/eng-12235 +83 -0
- data/_patches-20160112/eng-12235-override-refactor +140 -0
- data/_patches-20160112/eng-12240 +103 -0
- data/_patches-20160112/eng-12249 +40 -0
- data/_patches-20160112/eng-12301 +50 -0
- data/_patches-20160112/eng-12843 +95 -0
- data/_patches-20160112/env-source +112 -0
- data/_patches-20160112/frickin-vagrant-spec +163 -0
- data/_patches-20160112/gem-pre-version +14 -0
- data/_patches-20160112/gems-old +9 -0
- data/_patches-20160112/googles-specs +713 -0
- data/_patches-20160112/local-configs-ignore +61 -0
- data/_patches-20160112/misc +79 -0
- data/_patches-20160112/network-unreachable +31 -0
- data/_patches-20160112/new-boxfile +288 -0
- data/_patches-20160112/parallelization-maybe +198 -0
- data/_patches-20160112/read-state +23 -0
- data/_patches-20160112/refactor-to-use-public_address-cap +25 -0
- data/_patches-20160112/series +60 -0
- data/_patches-20160112/status +12 -0
- data/_patches-20160112/test-move-env-data +231 -0
- data/_patches-20160112/test-vagrantfile-vm1 +167 -0
- data/_patches-20160112/the_version_in_0.1.13.pre1 +598 -0
- data/_patches-20160112/vagrant-spec-mock-api +137 -0
- data/_patches-20160112/vagrant-vmware-plugin +233 -0
- data/_patches-20160112/vagrantfile +403 -0
- data/_patches-20160112/vagrantfile-for-acceptance-tests +29 -0
- data/_patches-20160112/vagrantfile-for-nick +95 -0
- data/_patches-20160112/vagrantfiles-to-forget-what-they-are-for +134 -0
- data/_patches-20160112/vm-vanished +42 -0
- data/_patches-20160112a/01 +148 -0
- data/_patches-20160112a/2 +239 -0
- data/_patches-20160112a/COMPLETED-ABOVE-THIS-LINE +4 -0
- data/_patches-20160112a/COMPLETED-BELOW-THIS-LINE +4 -0
- data/_patches-20160112a/CR-ABOVE-THIS-LINE +4 -0
- data/_patches-20160112a/CR-BELOW-THIS-LINE +4 -0
- data/_patches-20160112a/WIP-ABOVE-THIS-LINE +4 -0
- data/_patches-20160112a/WIP-BELOW-THIS-LINE +4 -0
- data/_patches-20160112a/acceptance-test-runner +29 -0
- data/_patches-20160112a/ansible-1 +92 -0
- data/_patches-20160112a/cache-api-client-in-up +40 -0
- data/_patches-20160112a/dead-code-in-actions +44 -0
- data/_patches-20160112a/debug-changes +42 -0
- data/_patches-20160112a/demo-rails-app +1276 -0
- data/_patches-20160112a/eng-10166-halt-spec +40 -0
- data/_patches-20160112a/eng-10256-ubuntu-testing +88 -0
- data/_patches-20160112a/eng-10269-test-stuff +87 -0
- data/_patches-20160112a/eng-10269-wtf +119 -0
- data/_patches-20160112a/eng-10369 +143 -0
- data/_patches-20160112a/eng-10369-tmp +60 -0
- data/_patches-20160112a/eng-10919 +56 -0
- data/_patches-20160112a/eng-11177-fix-actions-requires +44 -0
- data/_patches-20160112a/eng-11442 +4 -0
- data/_patches-20160112a/eng-11616 +403 -0
- data/_patches-20160112a/eng-11616-2 +67 -0
- data/_patches-20160112a/eng-11616-actual +184 -0
- data/_patches-20160112a/eng-11625a +4 -0
- data/_patches-20160112a/eng-11711 +85 -0
- data/_patches-20160112a/eng-12232-command-spec +236 -0
- data/_patches-20160112a/eng-12235 +83 -0
- data/_patches-20160112a/eng-12235-override-refactor +140 -0
- data/_patches-20160112a/eng-12240 +103 -0
- data/_patches-20160112a/eng-12249 +40 -0
- data/_patches-20160112a/eng-12301 +50 -0
- data/_patches-20160112a/eng-12843 +95 -0
- data/_patches-20160112a/env-source +112 -0
- data/_patches-20160112a/frickin-vagrant-spec +163 -0
- data/_patches-20160112a/gem-pre-version +14 -0
- data/_patches-20160112a/gems-old +9 -0
- data/_patches-20160112a/googles-specs +713 -0
- data/_patches-20160112a/local-configs-ignore +61 -0
- data/_patches-20160112a/misc +79 -0
- data/_patches-20160112a/network-unreachable +31 -0
- data/_patches-20160112a/new-boxfile +288 -0
- data/_patches-20160112a/parallelization-maybe +198 -0
- data/_patches-20160112a/read-state +23 -0
- data/_patches-20160112a/refactor-to-use-public_address-cap +25 -0
- data/_patches-20160112a/series +58 -0
- data/_patches-20160112a/status +14 -0
- data/_patches-20160112a/test-move-env-data +231 -0
- data/_patches-20160112a/test-vagrantfile-vm1 +167 -0
- data/_patches-20160112a/the_version_in_0.1.13.pre1 +612 -0
- data/_patches-20160112a/then-copy-the-newer-files +632 -0
- data/_patches-20160112a/vagrant-spec-mock-api +137 -0
- data/_patches-20160112a/vagrant-vmware-plugin +233 -0
- data/_patches-20160112a/vagrantfile +403 -0
- data/_patches-20160112a/vagrantfile-for-acceptance-tests +29 -0
- data/_patches-20160112a/vagrantfile-for-nick +95 -0
- data/_patches-20160112a/vagrantfiles-to-forget-what-they-are-for +134 -0
- data/_patches-20160112a/vm-vanished +42 -0
- data/_patches-20160113/COMPLETED-ABOVE-THIS-LINE +4 -0
- data/_patches-20160113/COMPLETED-BELOW-THIS-LINE +4 -0
- data/_patches-20160113/CR-ABOVE-THIS-LINE +4 -0
- data/_patches-20160113/CR-BELOW-THIS-LINE +4 -0
- data/_patches-20160113/WIP-ABOVE-THIS-LINE +4 -0
- data/_patches-20160113/WIP-BELOW-THIS-LINE +4 -0
- data/_patches-20160113/acceptance-test-runner +29 -0
- data/_patches-20160113/ansible-1 +92 -0
- data/_patches-20160113/cache-api-client-in-up +40 -0
- data/_patches-20160113/dead-code-in-actions +44 -0
- data/_patches-20160113/debug-changes +55 -0
- data/_patches-20160113/demo-rails-app +1276 -0
- data/_patches-20160113/eng-10166-halt-spec +40 -0
- data/_patches-20160113/eng-10256 +543 -0
- data/_patches-20160113/eng-10256-ubuntu-testing +88 -0
- data/_patches-20160113/eng-10269-test-stuff +87 -0
- data/_patches-20160113/eng-10269-wtf +119 -0
- data/_patches-20160113/eng-10369 +143 -0
- data/_patches-20160113/eng-10369-tmp +60 -0
- data/_patches-20160113/eng-10919 +56 -0
- data/_patches-20160113/eng-11177-fix-actions-requires +44 -0
- data/_patches-20160113/eng-11442 +4 -0
- data/_patches-20160113/eng-11616 +403 -0
- data/_patches-20160113/eng-11616-2 +67 -0
- data/_patches-20160113/eng-11616-actual +184 -0
- data/_patches-20160113/eng-11625a +4 -0
- data/_patches-20160113/eng-11711 +85 -0
- data/_patches-20160113/eng-12232-command-spec +236 -0
- data/_patches-20160113/eng-12235 +83 -0
- data/_patches-20160113/eng-12235-override-refactor +140 -0
- data/_patches-20160113/eng-12240 +103 -0
- data/_patches-20160113/eng-12249 +40 -0
- data/_patches-20160113/eng-12301 +50 -0
- data/_patches-20160113/eng-12720 +47 -0
- data/_patches-20160113/eng-12843 +95 -0
- data/_patches-20160113/env-source +112 -0
- data/_patches-20160113/frickin-vagrant-spec +163 -0
- data/_patches-20160113/gem-pre-version +14 -0
- data/_patches-20160113/gems-old +9 -0
- data/_patches-20160113/googles-specs +713 -0
- data/_patches-20160113/local-configs-ignore +61 -0
- data/_patches-20160113/misc +79 -0
- data/_patches-20160113/network-unreachable +31 -0
- data/_patches-20160113/new-boxfile +288 -0
- data/_patches-20160113/parallelization-maybe +198 -0
- data/_patches-20160113/read-state +23 -0
- data/_patches-20160113/refactor-to-use-public_address-cap +25 -0
- data/_patches-20160113/series +56 -0
- data/_patches-20160113/status +14 -0
- data/_patches-20160113/test-move-env-data +231 -0
- data/_patches-20160113/test-vagrantfile-vm1 +167 -0
- data/_patches-20160113/vagrant-spec-mock-api +137 -0
- data/_patches-20160113/vagrant-vmware-plugin +233 -0
- data/_patches-20160113/vagrantfile +403 -0
- data/_patches-20160113/vagrantfile-for-acceptance-tests +29 -0
- data/_patches-20160113/vagrantfile-for-nick +95 -0
- data/_patches-20160113/vagrantfiles-to-forget-what-they-are-for +134 -0
- data/_patches-20160113/vm-vanished +42 -0
- data/_patches-20160118/COMPLETED-ABOVE-THIS-LINE +4 -0
- data/_patches-20160118/COMPLETED-BELOW-THIS-LINE +4 -0
- data/_patches-20160118/CR-ABOVE-THIS-LINE +4 -0
- data/_patches-20160118/CR-BELOW-THIS-LINE +4 -0
- data/_patches-20160118/WIP-ABOVE-THIS-LINE +4 -0
- data/_patches-20160118/WIP-BELOW-THIS-LINE +4 -0
- data/_patches-20160118/acceptance-test-runner +29 -0
- data/_patches-20160118/ansible-1 +92 -0
- data/_patches-20160118/cache-api-client-in-up +40 -0
- data/_patches-20160118/dead-code-in-actions +44 -0
- data/_patches-20160118/debug-changes +55 -0
- data/_patches-20160118/demo-rails-app +1276 -0
- data/_patches-20160118/eng-10166-halt-spec +40 -0
- data/_patches-20160118/eng-10256 +554 -0
- data/_patches-20160118/eng-10256-cr +314 -0
- data/_patches-20160118/eng-10256-ubuntu-testing +88 -0
- data/_patches-20160118/eng-10269-test-stuff +87 -0
- data/_patches-20160118/eng-10269-wtf +119 -0
- data/_patches-20160118/eng-10369 +143 -0
- data/_patches-20160118/eng-10369-tmp +60 -0
- data/_patches-20160118/eng-10919 +56 -0
- data/_patches-20160118/eng-11177-fix-actions-requires +44 -0
- data/_patches-20160118/eng-11442 +4 -0
- data/_patches-20160118/eng-11616 +403 -0
- data/_patches-20160118/eng-11616-2 +67 -0
- data/_patches-20160118/eng-11616-actual +184 -0
- data/_patches-20160118/eng-11625a +4 -0
- data/_patches-20160118/eng-11711 +85 -0
- data/_patches-20160118/eng-12232-command-spec +236 -0
- data/_patches-20160118/eng-12235 +83 -0
- data/_patches-20160118/eng-12235-override-refactor +140 -0
- data/_patches-20160118/eng-12240 +103 -0
- data/_patches-20160118/eng-12249 +40 -0
- data/_patches-20160118/eng-12301 +50 -0
- data/_patches-20160118/eng-12720 +74 -0
- data/_patches-20160118/eng-12843 +95 -0
- data/_patches-20160118/eng-13040 +291 -0
- data/_patches-20160118/env-source +112 -0
- data/_patches-20160118/frickin-vagrant-spec +163 -0
- data/_patches-20160118/gem-pre-version +14 -0
- data/_patches-20160118/gems-old +9 -0
- data/_patches-20160118/googles-specs +713 -0
- data/_patches-20160118/local-configs-ignore +61 -0
- data/_patches-20160118/misc +79 -0
- data/_patches-20160118/network-unreachable +31 -0
- data/_patches-20160118/new-boxfile +288 -0
- data/_patches-20160118/parallelization-maybe +198 -0
- data/_patches-20160118/port-forwarding-processes +87 -0
- data/_patches-20160118/read-state +23 -0
- data/_patches-20160118/refactor-to-use-public_address-cap +25 -0
- data/_patches-20160118/series +59 -0
- data/_patches-20160118/status +13 -0
- data/_patches-20160118/test-move-env-data +231 -0
- data/_patches-20160118/test-vagrantfile-vm1 +167 -0
- data/_patches-20160118/vagrant-spec-mock-api +137 -0
- data/_patches-20160118/vagrant-vmware-plugin +233 -0
- data/_patches-20160118/vagrantfile +403 -0
- data/_patches-20160118/vagrantfile-for-acceptance-tests +29 -0
- data/_patches-20160118/vagrantfile-for-nick +95 -0
- data/_patches-20160118/vagrantfiles-to-forget-what-they-are-for +134 -0
- data/_patches-20160118/vm-vanished +42 -0
- data/_patches-20160118a/COMPLETED-ABOVE-THIS-LINE +4 -0
- data/_patches-20160118a/COMPLETED-BELOW-THIS-LINE +4 -0
- data/_patches-20160118a/CR-ABOVE-THIS-LINE +4 -0
- data/_patches-20160118a/CR-BELOW-THIS-LINE +4 -0
- data/_patches-20160118a/WIP-ABOVE-THIS-LINE +4 -0
- data/_patches-20160118a/WIP-BELOW-THIS-LINE +4 -0
- data/_patches-20160118a/acceptance-test-runner +29 -0
- data/_patches-20160118a/ansible-1 +92 -0
- data/_patches-20160118a/bar +189 -0
- data/_patches-20160118a/cache-api-client-in-up +40 -0
- data/_patches-20160118a/dead-code-in-actions +44 -0
- data/_patches-20160118a/debug-changes +55 -0
- data/_patches-20160118a/demo-rails-app +1276 -0
- data/_patches-20160118a/eng-10166-halt-spec +40 -0
- data/_patches-20160118a/eng-10256 +554 -0
- data/_patches-20160118a/eng-10256-cr +314 -0
- data/_patches-20160118a/eng-10256-ubuntu-testing +88 -0
- data/_patches-20160118a/eng-10269-test-stuff +87 -0
- data/_patches-20160118a/eng-10269-wtf +119 -0
- data/_patches-20160118a/eng-10369 +143 -0
- data/_patches-20160118a/eng-10369-tmp +60 -0
- data/_patches-20160118a/eng-10919 +56 -0
- data/_patches-20160118a/eng-11177-fix-actions-requires +44 -0
- data/_patches-20160118a/eng-11442 +4 -0
- data/_patches-20160118a/eng-11616 +403 -0
- data/_patches-20160118a/eng-11616-2 +67 -0
- data/_patches-20160118a/eng-11616-actual +184 -0
- data/_patches-20160118a/eng-11625a +4 -0
- data/_patches-20160118a/eng-11711 +85 -0
- data/_patches-20160118a/eng-12232-command-spec +236 -0
- data/_patches-20160118a/eng-12235 +83 -0
- data/_patches-20160118a/eng-12235-override-refactor +140 -0
- data/_patches-20160118a/eng-12240 +103 -0
- data/_patches-20160118a/eng-12249 +40 -0
- data/_patches-20160118a/eng-12301 +50 -0
- data/_patches-20160118a/eng-12720 +74 -0
- data/_patches-20160118a/eng-12843 +95 -0
- data/_patches-20160118a/eng-13040 +291 -0
- data/_patches-20160118a/env-source +112 -0
- data/_patches-20160118a/foo +169 -0
- data/_patches-20160118a/frickin-vagrant-spec +163 -0
- data/_patches-20160118a/gem-pre-version +14 -0
- data/_patches-20160118a/gems-old +9 -0
- data/_patches-20160118a/googles-specs +713 -0
- data/_patches-20160118a/guestport-madness +59 -0
- data/_patches-20160118a/local-configs-ignore +61 -0
- data/_patches-20160118a/misc +79 -0
- data/_patches-20160118a/network-unreachable +31 -0
- data/_patches-20160118a/new-boxfile +288 -0
- data/_patches-20160118a/parallelization-maybe +198 -0
- data/_patches-20160118a/port-forwarding-processes +87 -0
- data/_patches-20160118a/read-state +23 -0
- data/_patches-20160118a/refactor-to-use-public_address-cap +25 -0
- data/_patches-20160118a/series +62 -0
- data/_patches-20160118a/status +14 -0
- data/_patches-20160118a/test-move-env-data +231 -0
- data/_patches-20160118a/test-vagrantfile-vm1 +167 -0
- data/_patches-20160118a/vagrant-spec-mock-api +137 -0
- data/_patches-20160118a/vagrant-vmware-plugin +233 -0
- data/_patches-20160118a/vagrantfile +403 -0
- data/_patches-20160118a/vagrantfile-for-acceptance-tests +29 -0
- data/_patches-20160118a/vagrantfile-for-nick +95 -0
- data/_patches-20160118a/vagrantfiles-to-forget-what-they-are-for +134 -0
- data/_patches-20160118a/vm-vanished +42 -0
- data/lib/vagrant-skytap/action/clear_forwarded_ports.rb +19 -0
- data/lib/vagrant-skytap/action/forward_ports.rb +42 -0
- data/lib/vagrant-skytap/action/prepare_forwarded_port_collision_params.rb +37 -0
- data/lib/vagrant-skytap/action.rb +18 -0
- data/lib/vagrant-skytap/api/environment.rb +19 -4
- data/lib/vagrant-skytap/api/vm.rb +10 -6
- data/lib/vagrant-skytap/command/up.rb +7 -1
- data/lib/vagrant-skytap/errors.rb +4 -0
- data/lib/vagrant-skytap/hosts/bsd/cap/ssh_tunnel.rb +15 -0
- data/lib/vagrant-skytap/hosts/common/cap/ssh_tunnel.rb +183 -0
- data/lib/vagrant-skytap/hosts/linux/cap/ssh_tunnel.rb +15 -0
- data/lib/vagrant-skytap/hosts/windows/cap/ssh_tunnel.rb +27 -0
- data/lib/vagrant-skytap/model/forwarded_port.rb +78 -0
- data/lib/vagrant-skytap/plugin.rb +15 -0
- data/lib/vagrant-skytap/util/compile_forwarded_ports.rb +35 -0
- data/lib/vagrant-skytap/version.rb +1 -1
- data/locales/en.yml +3 -0
- data/spec/unit/environment_spec.rb +14 -2
- data/spec/unit/forwarded_port_spec.rb +45 -0
- data/spec/unit/hosts/common/cap/ssh_tunnel_spec.rb +180 -0
- data/spec/unit/prepare_collision_params_spec.rb +57 -0
- data/spec/unit/support/forwarded_ports/machines/vm1/skytap/id +1 -0
- data/spec/unit/support/forwarded_ports/machines/vm1/skytap/private_key +4 -0
- data/spec/unit/support/forwarded_ports/machines/vm1/skytap/tcp9000_tcp_9000_80.pid +1 -0
- data/spec/unit/support/forwarded_ports/machines/vm1/skytap/tcp9001_tcp_9001_81.pid +1 -0
- data/spec/unit/support/forwarded_ports/machines/vm1/virtualbox/id +1 -0
- data/spec/unit/support/forwarded_ports/machines/vm2/skytap/id +1 -0
- data/spec/unit/support/forwarded_ports/machines/vm2/skytap/tcp8080_tcp_8080_80.pid +1 -0
- data/spec/unit/support/forwarded_ports/machines/vm3/virtualbox/id +1 -0
- data/spec/unit/support/forwarded_ports/machines/vm4/skytap/id +1 -0
- data/spec/unit/support/forwarded_ports/machines/vm4/skytap/tcp8888_tcp_8888_80.pid +1 -0
- metadata +330 -2
@@ -0,0 +1,198 @@
|
|
1
|
+
# HG changeset patch
|
2
|
+
# Parent a6021cf61035f4ba44b4af13c9b2a1c17c1ea278
|
3
|
+
diff -r a6021cf61035 -r bfcc25828768 lib/vagrant-skytap/command/start_mixins.rb
|
4
|
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
5
|
+
+++ b/lib/vagrant-skytap/command/start_mixins.rb Fri Oct 23 19:10:56 2015 -0700
|
6
|
+
@@ -0,0 +1,52 @@
|
7
|
+
+# How do you access the source of another plugin?
|
8
|
+
+# It's possible that they deliberately prevent this
|
9
|
+
+#require 'plugins/commands/up/start_mixins'
|
10
|
+
+module VagrantPlugins
|
11
|
+
+ module Skytap
|
12
|
+
+ module Command
|
13
|
+
+ module StartMixins
|
14
|
+
+
|
15
|
+
+ # Would be nice to just extend this, then alias #build_start_options
|
16
|
+
+ # and add default options flag.
|
17
|
+
+ #include VagrantPlugins::CommandUp::StartMixins
|
18
|
+
+
|
19
|
+
+ # This adds the standard `start` command line flags to the given
|
20
|
+
+ # OptionParser, storing the result in the `options` dictionary.
|
21
|
+
+ #
|
22
|
+
+ # @param [OptionParser] parser
|
23
|
+
+ # @param [Hash] options
|
24
|
+
+ def build_start_options(parser, options)
|
25
|
+
+ # Setup the defaults
|
26
|
+
+ options[:provision_types] = nil
|
27
|
+
+
|
28
|
+
+ # Add the options
|
29
|
+
+ parser.on("--[no-]provision", "Enable or disable provisioning") do |p|
|
30
|
+
+ options[:provision_enabled] = p
|
31
|
+
+ options[:provision_ignore_sentinel] = true
|
32
|
+
+ end
|
33
|
+
+
|
34
|
+
+ parser.on("--provision-with x,y,z", Array,
|
35
|
+
+ "Enable only certain provisioners, by type.") do |list|
|
36
|
+
+ options[:provision_types] = list.map { |type| type.to_sym }
|
37
|
+
+ options[:provision_enabled] = true
|
38
|
+
+ options[:provision_ignore_sentinel] = true
|
39
|
+
+ end
|
40
|
+
+
|
41
|
+
+ options[:parallel] = false ### the only substantive change
|
42
|
+
+ end
|
43
|
+
+
|
44
|
+
+ # This validates the provisioner flags and raises an exception
|
45
|
+
+ # if there are invalid ones.
|
46
|
+
+ def validate_provisioner_flags!(options)
|
47
|
+
+ (options[:provision_types] || []).each do |type|
|
48
|
+
+ klass = Vagrant.plugin("2").manager.provisioners[type]
|
49
|
+
+ if !klass
|
50
|
+
+ raise Vagrant::Errors::ProvisionerFlagInvalid,
|
51
|
+
+ name: type.to_s
|
52
|
+
+ end
|
53
|
+
+ end
|
54
|
+
+ end
|
55
|
+
+ end
|
56
|
+
+ end
|
57
|
+
+ end
|
58
|
+
+end
|
59
|
+
diff -r a6021cf61035 -r bfcc25828768 lib/vagrant-skytap/command/up.rb
|
60
|
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
61
|
+
+++ b/lib/vagrant-skytap/command/up.rb Fri Oct 23 19:10:56 2015 -0700
|
62
|
+
@@ -0,0 +1,110 @@
|
63
|
+
+require 'optparse'
|
64
|
+
+require_relative 'start_mixins'
|
65
|
+
+
|
66
|
+
+module VagrantPlugins
|
67
|
+
+ module Skytap
|
68
|
+
+ module Command
|
69
|
+
+ class Up < Vagrant.plugin("2", :command)
|
70
|
+
+ include StartMixins
|
71
|
+
+
|
72
|
+
+ def self.synopsis
|
73
|
+
+ "hi mom starts and provisions the vagrant environment"
|
74
|
+
+ end
|
75
|
+
+
|
76
|
+
+ def execute
|
77
|
+
+ options = {}
|
78
|
+
+ options[:destroy_on_error] = true
|
79
|
+
+ options[:parallel] = true
|
80
|
+
+ options[:provision_ignore_sentinel] = false
|
81
|
+
+
|
82
|
+
+ opts = OptionParser.new do |o|
|
83
|
+
+ o.banner = "Usage: vagrant up [options] [name]"
|
84
|
+
+ o.separator ""
|
85
|
+
+ o.separator "Options:"
|
86
|
+
+ o.separator ""
|
87
|
+
+
|
88
|
+
+ build_start_options(o, options)
|
89
|
+
+
|
90
|
+
+ o.on("--[no-]destroy-on-error",
|
91
|
+
+ "Destroy machine if any fatal error happens (default to true)") do |destroy|
|
92
|
+
+ options[:destroy_on_error] = destroy
|
93
|
+
+ end
|
94
|
+
+
|
95
|
+
+ o.on("--[no-]parallel",
|
96
|
+
+ "Enable or disable parallelism if provider supports it") do |parallel|
|
97
|
+
+ options[:parallel] = parallel
|
98
|
+
+ end
|
99
|
+
+
|
100
|
+
+ o.on("--provider PROVIDER", String,
|
101
|
+
+ "Back the machine with a specific provider") do |provider|
|
102
|
+
+ options[:provider] = provider
|
103
|
+
+ end
|
104
|
+
+ end
|
105
|
+
+
|
106
|
+
+ # Parse the options
|
107
|
+
+ argv = parse_options(opts)
|
108
|
+
+ return if !argv
|
109
|
+
+
|
110
|
+
+ # Validate the provisioners
|
111
|
+
+ validate_provisioner_flags!(options)
|
112
|
+
+
|
113
|
+
+ # Go over each VM and bring it up
|
114
|
+
+ @logger.debug("'Up' each target VM...")
|
115
|
+
+
|
116
|
+
+ # Build up the batch job of what we'll do
|
117
|
+
+ machines = []
|
118
|
+
+ @env.batch(options[:parallel]) do |batch|
|
119
|
+
+ names = argv
|
120
|
+
+ if names.empty?
|
121
|
+
+ autostart = false
|
122
|
+
+ @env.vagrantfile.machine_names_and_options.each do |n, o|
|
123
|
+
+ autostart = true if o.key?(:autostart)
|
124
|
+
+ o[:autostart] = true if !o.key?(:autostart)
|
125
|
+
+ names << n.to_s if o[:autostart]
|
126
|
+
+ end
|
127
|
+
+
|
128
|
+
+ # If we have an autostart key but no names, it means that
|
129
|
+
+ # all machines are autostart: false and we don't start anything.
|
130
|
+
+ names = nil if autostart && names.empty?
|
131
|
+
+ end
|
132
|
+
+
|
133
|
+
+ if names
|
134
|
+
+ with_target_vms(names, provider: options[:provider]) do |machine|
|
135
|
+
+ @env.ui.info(I18n.t(
|
136
|
+
+ "vagrant.commands.up.upping",
|
137
|
+
+ name: machine.name,
|
138
|
+
+ provider: machine.provider_name))
|
139
|
+
+
|
140
|
+
+ machines << machine
|
141
|
+
+
|
142
|
+
+ batch.action(machine, :up, options)
|
143
|
+
+ end
|
144
|
+
+ end
|
145
|
+
+ end
|
146
|
+
+
|
147
|
+
+ if machines.empty?
|
148
|
+
+ @env.ui.info(I18n.t("vagrant.up_no_machines"))
|
149
|
+
+ return 0
|
150
|
+
+ end
|
151
|
+
+
|
152
|
+
+ # Output the post-up messages that we have, if any
|
153
|
+
+ machines.each do |m|
|
154
|
+
+ next if !m.config.vm.post_up_message
|
155
|
+
+ next if m.config.vm.post_up_message == ""
|
156
|
+
+
|
157
|
+
+ # Add a newline to separate things.
|
158
|
+
+ @env.ui.info("", prefix: false)
|
159
|
+
+
|
160
|
+
+ m.ui.success(I18n.t(
|
161
|
+
+ "vagrant.post_up_message",
|
162
|
+
+ name: m.name.to_s,
|
163
|
+
+ message: m.config.vm.post_up_message))
|
164
|
+
+ end
|
165
|
+
+
|
166
|
+
+ # Success, exit status 0
|
167
|
+
+ 0
|
168
|
+
+ end
|
169
|
+
+ end
|
170
|
+
+ end
|
171
|
+
+ end
|
172
|
+
+end
|
173
|
+
diff -r a6021cf61035 -r bfcc25828768 lib/vagrant-skytap/plugin.rb
|
174
|
+
--- a/lib/vagrant-skytap/plugin.rb Fri Oct 23 19:10:47 2015 -0700
|
175
|
+
+++ b/lib/vagrant-skytap/plugin.rb Fri Oct 23 19:10:56 2015 -0700
|
176
|
+
@@ -24,7 +24,7 @@
|
177
|
+
Config
|
178
|
+
end
|
179
|
+
|
180
|
+
- provider(:skytap, parallel: true) do
|
181
|
+
+ provider(:skytap, parallel: false) do
|
182
|
+
# Setup logging and i18n
|
183
|
+
setup_logging
|
184
|
+
setup_i18n
|
185
|
+
@@ -34,6 +34,13 @@
|
186
|
+
Provider
|
187
|
+
end
|
188
|
+
|
189
|
+
+ # only used for this provider, right? when you call vagrant up,
|
190
|
+
+ # the Vagrantfile tells it that skytap is the only allowable provider
|
191
|
+
+ command("up", primary: true) do
|
192
|
+
+ require_relative "command/up"
|
193
|
+
+ Command::Up
|
194
|
+
+ end
|
195
|
+
+
|
196
|
+
# This initializes the internationalization strings.
|
197
|
+
def self.setup_i18n
|
198
|
+
I18n.load_path << File.expand_path("locales/en.yml", Skytap.source_root)
|
@@ -0,0 +1,87 @@
|
|
1
|
+
# HG changeset patch
|
2
|
+
# Parent fe283b200076d7f296364e54d4426e3a9b643743
|
3
|
+
processes host cap -- more harm than good?
|
4
|
+
|
5
|
+
diff -r fe283b200076 -r ba1629d34236 lib/vagrant-skytap/hosts/common/cap/processes.rb
|
6
|
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
7
|
+
+++ b/lib/vagrant-skytap/hosts/common/cap/processes.rb Mon Jan 18 13:38:12 2016 -0800
|
8
|
+
@@ -0,0 +1,24 @@
|
9
|
+
+require 'log4r'
|
10
|
+
+
|
11
|
+
+module VagrantPlugins
|
12
|
+
+ module Skytap
|
13
|
+
+ module HostCommon
|
14
|
+
+ module Cap
|
15
|
+
+ class Processes
|
16
|
+
+ class << self
|
17
|
+
+ def create_logger
|
18
|
+
+ raise NotImplementedError
|
19
|
+
+ end
|
20
|
+
+
|
21
|
+
+ # Gets the name of the executable for the given pid.
|
22
|
+
+ #
|
23
|
+
+ # @return [String]
|
24
|
+
+ def get_comm_for_pid(pid)
|
25
|
+
+ raise NotImplementedException
|
26
|
+
+ end
|
27
|
+
+ end
|
28
|
+
+ end
|
29
|
+
+ end
|
30
|
+
+ end
|
31
|
+
+ end
|
32
|
+
+end
|
33
|
+
diff -r fe283b200076 -r ba1629d34236 lib/vagrant-skytap/hosts/darwin/cap/processes.rb
|
34
|
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
35
|
+
+++ b/lib/vagrant-skytap/hosts/darwin/cap/processes.rb Mon Jan 18 13:38:12 2016 -0800
|
36
|
+
@@ -0,0 +1,32 @@
|
37
|
+
+require "vagrant-skytap/hosts/common/cap/processes"
|
38
|
+
+require "vagrant/util/subprocess"
|
39
|
+
+
|
40
|
+
+module VagrantPlugins
|
41
|
+
+ module Skytap
|
42
|
+
+ module HostDarwin
|
43
|
+
+ module Cap
|
44
|
+
+ class Processes < VagrantPlugins::Skytap::HostCommon::Cap::Processes
|
45
|
+
+ class << self
|
46
|
+
+ def create_logger
|
47
|
+
+ Log4r::Logger.new("vagrant::hosts::darwin")
|
48
|
+
+ end
|
49
|
+
+
|
50
|
+
+ # Gets the name of the executable for the given pid.
|
51
|
+
+ #
|
52
|
+
+ # @return [String]
|
53
|
+
+ def get_comm_for_pid(env, pid)
|
54
|
+
+ logger = create_logger
|
55
|
+
+ result = Vagrant::Util::Subprocess.execute("ps", "-p", pid.to_s, "-o", "comm")
|
56
|
+
+ if result.exit_code == 0
|
57
|
+
+ result.stdout.split("\n").last
|
58
|
+
+ else
|
59
|
+
+ logger.debug(result.inspect)
|
60
|
+
+ ''
|
61
|
+
+ end
|
62
|
+
+ end
|
63
|
+
+ end
|
64
|
+
+ end
|
65
|
+
+ end
|
66
|
+
+ end
|
67
|
+
+ end
|
68
|
+
+end
|
69
|
+
diff -r fe283b200076 -r ba1629d34236 lib/vagrant-skytap/plugin.rb
|
70
|
+
--- a/lib/vagrant-skytap/plugin.rb Mon Jan 18 13:37:48 2016 -0800
|
71
|
+
+++ b/lib/vagrant-skytap/plugin.rb Mon Jan 18 13:38:12 2016 -0800
|
72
|
+
@@ -49,6 +49,15 @@
|
73
|
+
Cap::PublicAddress
|
74
|
+
end
|
75
|
+
|
76
|
+
+ %w[get_comm_for_pid].each do |cap|
|
77
|
+
+ # We're only registering this cap for OSes that
|
78
|
+
+ # we know return the correct result.
|
79
|
+
+ host_capability("darwin", cap) do
|
80
|
+
+ require_relative "hosts/darwin/cap/processes"
|
81
|
+
+ HostDarwin::Cap::Processes
|
82
|
+
+ end
|
83
|
+
+ end
|
84
|
+
+
|
85
|
+
%w[start_ssh_tunnel kill_ssh_tunnel kill_forwarded_ports].each do |cap|
|
86
|
+
host_capability("bsd", cap) do
|
87
|
+
require_relative "hosts/bsd/cap/ssh_tunnel"
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# HG changeset patch
|
2
|
+
# Parent 8bcd0f98359d1e6e85b806f457755cbcc85255e4
|
3
|
+
diff -r 8bcd0f98359d -r 22788fec55a7 lib/vagrant-skytap/action/read_state.rb
|
4
|
+
--- a/lib/vagrant-skytap/action/read_state.rb Thu Nov 19 11:24:44 2015 -0800
|
5
|
+
+++ b/lib/vagrant-skytap/action/read_state.rb Thu Nov 19 11:24:49 2015 -0800
|
6
|
+
@@ -22,14 +22,10 @@
|
7
|
+
@app.call(env)
|
8
|
+
end
|
9
|
+
|
10
|
+
+ # Assumes FetchEnvironment was called to populate env[:environment].
|
11
|
+
def read_state(machine)
|
12
|
+
- if VmProperties.read(machine.data_dir)
|
13
|
+
- if environment = env[:environment]
|
14
|
+
- environment.reload
|
15
|
+
- elsif props = API::Environment.properties(env)
|
16
|
+
- @logger.info("env[:environment] was not set!")
|
17
|
+
- end
|
18
|
+
-
|
19
|
+
+ if environment = env[:environment]
|
20
|
+
+ environment.reload
|
21
|
+
if vm = environment.try(:current_vm)
|
22
|
+
return vm.runstate.to_sym
|
23
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# HG changeset patch
|
2
|
+
# Parent 37bcd8389c3f5d6e1d618b020c7decf7949a2f25
|
3
|
+
diff -r 37bcd8389c3f -r febe6d83e803 lib/vagrant-skytap/action/prepare_nfs_settings.rb
|
4
|
+
--- a/lib/vagrant-skytap/action/prepare_nfs_settings.rb Wed Dec 02 17:37:41 2015 -0800
|
5
|
+
+++ b/lib/vagrant-skytap/action/prepare_nfs_settings.rb Wed Dec 02 17:37:46 2015 -0800
|
6
|
+
@@ -15,7 +15,7 @@
|
7
|
+
|
8
|
+
if using_nfs?
|
9
|
+
env[:nfs_host_ip] = read_host_ip
|
10
|
+
- env[:nfs_machine_ip] = read_machine_ip
|
11
|
+
+ env[:nfs_machine_ip] = machine.provider.capability(:public_address)
|
12
|
+
end
|
13
|
+
|
14
|
+
@app.call(env)
|
15
|
+
@@ -35,10 +35,6 @@
|
16
|
+
@logger.debug "read_host_ip returning #{ret}"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
-
|
20
|
+
- def read_machine_ip
|
21
|
+
- machine.ssh_info[:host]
|
22
|
+
- end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
gem-pre-version
|
2
|
+
local-configs-ignore
|
3
|
+
debug-changes
|
4
|
+
acceptance-test-runner
|
5
|
+
gems-old
|
6
|
+
vagrantfile
|
7
|
+
vagrantfile-for-acceptance-tests
|
8
|
+
CR-ABOVE-THIS-LINE
|
9
|
+
CR-BELOW-THIS-LINE
|
10
|
+
COMPLETED-ABOVE-THIS-LINE
|
11
|
+
COMPLETED-BELOW-THIS-LINE
|
12
|
+
WIP-ABOVE-THIS-LINE
|
13
|
+
eng-10256
|
14
|
+
eng-10256-cr
|
15
|
+
foo
|
16
|
+
bar
|
17
|
+
guestport-madness
|
18
|
+
port-forwarding-processes
|
19
|
+
eng-13040
|
20
|
+
eng-12720
|
21
|
+
eng-10256-ubuntu-testing
|
22
|
+
eng-12843
|
23
|
+
test-vagrantfile-vm1
|
24
|
+
eng-12235-override-refactor
|
25
|
+
eng-12232-command-spec
|
26
|
+
eng-12235
|
27
|
+
frickin-vagrant-spec
|
28
|
+
eng-12249
|
29
|
+
cache-api-client-in-up
|
30
|
+
eng-12301
|
31
|
+
vagrantfiles-to-forget-what-they-are-for
|
32
|
+
eng-12240
|
33
|
+
vagrantfile-for-nick
|
34
|
+
refactor-to-use-public_address-cap
|
35
|
+
eng-10269-test-stuff
|
36
|
+
demo-rails-app
|
37
|
+
read-state
|
38
|
+
eng-11616
|
39
|
+
eng-11616-2
|
40
|
+
eng-11616-actual
|
41
|
+
eng-10269-wtf
|
42
|
+
parallelization-maybe
|
43
|
+
eng-10369
|
44
|
+
vm-vanished
|
45
|
+
eng-10369-tmp
|
46
|
+
eng-11625a
|
47
|
+
eng-11711
|
48
|
+
network-unreachable
|
49
|
+
eng-11442
|
50
|
+
WIP-BELOW-THIS-LINE
|
51
|
+
new-boxfile
|
52
|
+
ansible-1
|
53
|
+
misc
|
54
|
+
vagrant-spec-mock-api
|
55
|
+
eng-10919
|
56
|
+
env-source
|
57
|
+
eng-11177-fix-actions-requires
|
58
|
+
dead-code-in-actions
|
59
|
+
eng-10166-halt-spec
|
60
|
+
vagrant-vmware-plugin
|
61
|
+
test-move-env-data
|
62
|
+
googles-specs
|
@@ -0,0 +1,14 @@
|
|
1
|
+
813456f18a2d7810c0785efa925e2516a7fa5729:gem-pre-version
|
2
|
+
7f14d802de4291b2efdc17b40fd0fe9c189e274d:local-configs-ignore
|
3
|
+
f58d23763657d7390d29235fd709fc61ecc76490:debug-changes
|
4
|
+
17a12e519015a5986884ee2bbeead0f7b3135ae7:acceptance-test-runner
|
5
|
+
d1cb8fab445ff9d4913417f6cec1f399c8edda79:gems-old
|
6
|
+
44e88c2d194ecc78aa8efdb55bea28d90bcc9147:vagrantfile
|
7
|
+
6e203277c01d9617c0e124da8d2641f5ed0bfec2:vagrantfile-for-acceptance-tests
|
8
|
+
5e5eb3471fc9f6c38f24b4f813a981063543f221:CR-ABOVE-THIS-LINE
|
9
|
+
0237e8774c138da308c648254f00e3e1b69c3367:CR-BELOW-THIS-LINE
|
10
|
+
ad1ff25e401370c9d1d974aac2d5795df27ca24f:COMPLETED-ABOVE-THIS-LINE
|
11
|
+
40be46504011dabcf4bd458d9ecad34c48dcc8e0:COMPLETED-BELOW-THIS-LINE
|
12
|
+
b669f28f24c6872c9a436d1673eea9be62f1f6b4:WIP-ABOVE-THIS-LINE
|
13
|
+
c4f5983e2c63e1e0ca7b515308b5683f8d4c0967:eng-10256
|
14
|
+
82e4386bb899141c5b7712207b63e01b1a765c6e:eng-10256-cr
|
@@ -0,0 +1,231 @@
|
|
1
|
+
# HG changeset patch
|
2
|
+
# Parent b53e5fb4613bca1379e20e6d91ee14addfca153a
|
3
|
+
tests for separating environment data
|
4
|
+
|
5
|
+
diff --git a/lib/vagrant-skytap/action/create_environment.rb b/lib/vagrant-skytap/action/create_environment.rb
|
6
|
+
--- a/lib/vagrant-skytap/action/create_environment.rb
|
7
|
+
+++ b/lib/vagrant-skytap/action/create_environment.rb
|
8
|
+
@@ -28,7 +28,8 @@
|
9
|
+
def call(env)
|
10
|
+
environment = API::Environment.create!(env, template_url)
|
11
|
+
env[:environment] = environment
|
12
|
+
- environment.global_properties.write('url' => environment.url)
|
13
|
+
+ write_environment_url(environment.url)
|
14
|
+
+ #environment.global_properties.write('url' => environment.url)
|
15
|
+
environment.wait_until_ready
|
16
|
+
|
17
|
+
#TODO:NLA What's the right way to get this set? And where? Does it need to be set at all?
|
18
|
+
@@ -42,6 +43,10 @@
|
19
|
+
def template_url
|
20
|
+
env[:machine].provider_config.template_url
|
21
|
+
end
|
22
|
+
+
|
23
|
+
+ def write_environment_url(url)
|
24
|
+
+ env[:environment].global_properties.write('url' => url)
|
25
|
+
+ end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
|
30
|
+
--- a/spec/spec_helper.rb
|
31
|
+
+++ b/spec/spec_helper.rb
|
32
|
+
@@ -1,1 +1,7 @@
|
33
|
+
-
|
34
|
+
+require "unit/support/dummy_communicator"
|
35
|
+
+require "unit/support/dummy_provider"
|
36
|
+
+require "unit/support/shared/base_context"
|
37
|
+
+require "unit/support/shared/action_synced_folders_context"
|
38
|
+
+require "unit/support/shared/capability_helpers_context"
|
39
|
+
+require "unit/support/shared/plugin_command_context"
|
40
|
+
+require "unit/support/shared/virtualbox_context"
|
41
|
+
diff --git a/spec/support/isolated_environment.rb b/spec/support/isolated_environment.rb
|
42
|
+
new file mode 100644
|
43
|
+
--- /dev/null
|
44
|
+
+++ b/spec/support/isolated_environment.rb
|
45
|
+
@@ -0,0 +1,45 @@
|
46
|
+
+require "fileutils"
|
47
|
+
+require "pathname"
|
48
|
+
+require "tmpdir"
|
49
|
+
+
|
50
|
+
+require "log4r"
|
51
|
+
+
|
52
|
+
+# This class manages an isolated environment for Vagrant to
|
53
|
+
+# run in. It creates a temporary directory to act as the
|
54
|
+
+# working directory as well as sets a custom home directory.
|
55
|
+
+#
|
56
|
+
+# This class also provides various helpers to create Vagrantfiles,
|
57
|
+
+# boxes, etc.
|
58
|
+
+class IsolatedEnvironment
|
59
|
+
+ attr_reader :homedir
|
60
|
+
+ attr_reader :workdir
|
61
|
+
+
|
62
|
+
+ # Initializes an isolated environment. You can pass in some
|
63
|
+
+ # options here to configure runing custom applications in place
|
64
|
+
+ # of others as well as specifying environmental variables.
|
65
|
+
+ #
|
66
|
+
+ # @param [Hash] apps A mapping of application name (such as "vagrant")
|
67
|
+
+ # to an alternate full path to the binary to run.
|
68
|
+
+ # @param [Hash] env Additional environmental variables to inject
|
69
|
+
+ # into the execution environments.
|
70
|
+
+ def initialize
|
71
|
+
+ @logger = Log4r::Logger.new("test::isolated_environment")
|
72
|
+
+
|
73
|
+
+ # Create a temporary directory for our work
|
74
|
+
+ @tempdir = Dir.mktmpdir("vagrant")
|
75
|
+
+ @logger.info("Initialize isolated environment: #{@tempdir}")
|
76
|
+
+
|
77
|
+
+ # Setup the home and working directories
|
78
|
+
+ @homedir = Pathname.new(File.join(@tempdir, "home"))
|
79
|
+
+ @workdir = Pathname.new(File.join(@tempdir, "work"))
|
80
|
+
+
|
81
|
+
+ @homedir.mkdir
|
82
|
+
+ @workdir.mkdir
|
83
|
+
+ end
|
84
|
+
+
|
85
|
+
+ # This closes the environment by cleaning it up.
|
86
|
+
+ def close
|
87
|
+
+ @logger.info("Removing isolated environment: #{@tempdir}")
|
88
|
+
+ FileUtils.rm_rf(@tempdir)
|
89
|
+
+ end
|
90
|
+
+end
|
91
|
+
diff --git a/spec/vagrant-skytap/config_spec.rb b/spec/unit/config_spec.rb
|
92
|
+
rename from spec/vagrant-skytap/config_spec.rb
|
93
|
+
rename to spec/unit/config_spec.rb
|
94
|
+
diff --git a/spec/unit/create_environment_spec.rb b/spec/unit/create_environment_spec.rb
|
95
|
+
new file mode 100644
|
96
|
+
--- /dev/null
|
97
|
+
+++ b/spec/unit/create_environment_spec.rb
|
98
|
+
@@ -0,0 +1,81 @@
|
99
|
+
+require 'spec_helper'
|
100
|
+
+require 'vagrant-skytap/action/create_environment'
|
101
|
+
+
|
102
|
+
+describe VagrantPlugins::Skytap::Action::CreateEnvironment do
|
103
|
+
+ include_context "unit"
|
104
|
+
+
|
105
|
+
+ let(:iso_env) do
|
106
|
+
+ # We have to create a Vagrantfile so there is a root path
|
107
|
+
+ env = isolated_environment
|
108
|
+
+ env.vagrantfile("")
|
109
|
+
+ env.create_vagrant_env
|
110
|
+
+ end
|
111
|
+
+
|
112
|
+
+ #let(:machine) { iso_env.machine(iso_env.machine_names[0], :dummy) }
|
113
|
+
+ let(:machine) do
|
114
|
+
+ iso_env.machine(iso_env.machine_names[0], :dummy).tap do |m|
|
115
|
+
+ m.provider.stub(driver: driver)
|
116
|
+
+ end
|
117
|
+
+ end
|
118
|
+
+
|
119
|
+
+ # let(:app) { nil }
|
120
|
+
+ # let(:env) { {} }
|
121
|
+
+ # subject(:action) { described_class.new(app, env) }
|
122
|
+
+ let(:env) {{ machine: machine }}
|
123
|
+
+ let(:app) { lambda { |*args| }}
|
124
|
+
+ let(:driver) { double("driver") }
|
125
|
+
+ let(:host) { double("host") }
|
126
|
+
+
|
127
|
+
+ subject { described_class.new(app, env) }
|
128
|
+
+
|
129
|
+
+ before do
|
130
|
+
+ env[:test] = true
|
131
|
+
+ allow(machine.env).to receive(:host) { host }
|
132
|
+
+ allow(host).to receive(:capability).with(:nfs_installed) { true }
|
133
|
+
+ end
|
134
|
+
+
|
135
|
+
+
|
136
|
+
+ it "calls the next action in the chain" do
|
137
|
+
+ driver.stub(read_network_interfaces: {2 => {type: :hostonly, hostonly: "vmnet2"}})
|
138
|
+
+ driver.stub(read_host_only_interfaces: [{name: "vmnet2", ip: "1.2.3.4"}])
|
139
|
+
+ allow(driver).to receive(:read_guest_ip).with(1).and_return("2.3.4.5")
|
140
|
+
+
|
141
|
+
+ called = false
|
142
|
+
+ app = lambda { |*args| called = true }
|
143
|
+
+
|
144
|
+
+ action = described_class.new(app, env)
|
145
|
+
+ action.call(env)
|
146
|
+
+
|
147
|
+
+ expect(called).to eq(true)
|
148
|
+
+ end
|
149
|
+
+
|
150
|
+
+ # describe '#template_url' do
|
151
|
+
+ # subject(:args) { action.template_url }
|
152
|
+
+ #
|
153
|
+
+ # context 'with no ssh options' do
|
154
|
+
+ # let(:options) { [] }
|
155
|
+
+ #
|
156
|
+
+ # it { should eql [] }
|
157
|
+
+ # end
|
158
|
+
+ #
|
159
|
+
+ # context 'with one option' do
|
160
|
+
+ # let(:options) { ['StrictHostKeyChecking=no'] }
|
161
|
+
+ # it { should eql ["-o 'StrictHostKeyChecking=no'"] }
|
162
|
+
+ # end
|
163
|
+
+ #
|
164
|
+
+ # context 'with multiple options' do
|
165
|
+
+ # let(:options) { ['SHKC=no', 'Port=222'] }
|
166
|
+
+ # it { should eql ["-o 'SHKC=no'", "-o 'Port=222'"] }
|
167
|
+
+ # end
|
168
|
+
+ # end
|
169
|
+
+
|
170
|
+
+ describe '#write_environment_url' do
|
171
|
+
+ subject(:args) { 'http://foo/bar' }
|
172
|
+
+
|
173
|
+
+ context 'whatever' do
|
174
|
+
+ #let(:options) { [] }
|
175
|
+
+
|
176
|
+
+ it { should eql 'http://foo/bar' }
|
177
|
+
+ end
|
178
|
+
+ end
|
179
|
+
+end
|
180
|
+
diff --git a/spec/unit/environment_spec.rb b/spec/unit/environment_spec.rb
|
181
|
+
new file mode 100644
|
182
|
+
--- /dev/null
|
183
|
+
+++ b/spec/unit/environment_spec.rb
|
184
|
+
@@ -0,0 +1,23 @@
|
185
|
+
+require 'vagrant-skytap/api/environment'
|
186
|
+
+
|
187
|
+
+describe VagrantPlugins::Skytap::API::Environment do
|
188
|
+
+ let(:attrs) { {} }
|
189
|
+
+ let(:env) { {} }
|
190
|
+
+ let(:instance) { described_class.new(attrs, env) }
|
191
|
+
+
|
192
|
+
+ describe "#busy?" do
|
193
|
+
+ context "it is busy" do
|
194
|
+
+ let(:runstate) { 'busy' }
|
195
|
+
+
|
196
|
+
+ #instance.busy?.should be_true
|
197
|
+
+ end
|
198
|
+
+
|
199
|
+
+
|
200
|
+
+# context "it is stopped" do
|
201
|
+
+# let(:runstate) { 'stopped' }
|
202
|
+
+#
|
203
|
+
+# instance.busy?.should be_false
|
204
|
+
+# end
|
205
|
+
+
|
206
|
+
+ end
|
207
|
+
+end
|
208
|
+
diff --git a/spec/vagrant-skytap/unit/support/dummy_communicator.rb b/spec/unit/support/dummy_communicator.rb
|
209
|
+
rename from spec/vagrant-skytap/unit/support/dummy_communicator.rb
|
210
|
+
rename to spec/unit/support/dummy_communicator.rb
|
211
|
+
diff --git a/spec/vagrant-skytap/unit/support/dummy_provider.rb b/spec/unit/support/dummy_provider.rb
|
212
|
+
rename from spec/vagrant-skytap/unit/support/dummy_provider.rb
|
213
|
+
rename to spec/unit/support/dummy_provider.rb
|
214
|
+
diff --git a/spec/vagrant-skytap/unit/support/isolated_environment.rb b/spec/unit/support/isolated_environment.rb
|
215
|
+
rename from spec/vagrant-skytap/unit/support/isolated_environment.rb
|
216
|
+
rename to spec/unit/support/isolated_environment.rb
|
217
|
+
diff --git a/spec/vagrant-skytap/unit/support/shared/action_synced_folders_context.rb b/spec/unit/support/shared/action_synced_folders_context.rb
|
218
|
+
rename from spec/vagrant-skytap/unit/support/shared/action_synced_folders_context.rb
|
219
|
+
rename to spec/unit/support/shared/action_synced_folders_context.rb
|
220
|
+
diff --git a/spec/vagrant-skytap/unit/support/shared/base_context.rb b/spec/unit/support/shared/base_context.rb
|
221
|
+
rename from spec/vagrant-skytap/unit/support/shared/base_context.rb
|
222
|
+
rename to spec/unit/support/shared/base_context.rb
|
223
|
+
diff --git a/spec/vagrant-skytap/unit/support/shared/capability_helpers_context.rb b/spec/unit/support/shared/capability_helpers_context.rb
|
224
|
+
rename from spec/vagrant-skytap/unit/support/shared/capability_helpers_context.rb
|
225
|
+
rename to spec/unit/support/shared/capability_helpers_context.rb
|
226
|
+
diff --git a/spec/vagrant-skytap/unit/support/shared/plugin_command_context.rb b/spec/unit/support/shared/plugin_command_context.rb
|
227
|
+
rename from spec/vagrant-skytap/unit/support/shared/plugin_command_context.rb
|
228
|
+
rename to spec/unit/support/shared/plugin_command_context.rb
|
229
|
+
diff --git a/spec/vagrant-skytap/unit/support/shared/virtualbox_context.rb b/spec/unit/support/shared/virtualbox_context.rb
|
230
|
+
rename from spec/vagrant-skytap/unit/support/shared/virtualbox_context.rb
|
231
|
+
rename to spec/unit/support/shared/virtualbox_context.rb
|