vagrant-skytap 0.2.0 → 0.2.1
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.
- checksums.yaml +4 -4
- data/.byebug_history +183 -183
- data/CHANGELOG.md +4 -0
- data/README.md +4 -0
- data/lib/vagrant-skytap/action.rb +13 -0
- data/lib/vagrant-skytap/version.rb +1 -1
- data/spec/unit/base.rb +3 -2
- data/spec/unit/environment_spec.rb +10 -8
- data/spec/unit/publish_set_spec.rb +5 -4
- data/spec/unit/setup_helper_spec.rb +7 -5
- data/spec/unit/{skeletons → support/api_responses}/empty_environment.json +0 -0
- data/spec/unit/{skeletons → support/api_responses}/empty_publish_set.json +0 -0
- data/spec/unit/{skeletons → support/api_responses}/network1.json +0 -0
- data/spec/unit/{skeletons → support/api_responses}/vm1.json +0 -0
- data/spec/unit/{skeletons → support/api_responses}/vpn1.json +0 -0
- data/spec/unit/{skeletons → support/api_responses}/vpn_attachment1.json +0 -0
- data/spec/unit/support/shared/rest_api_context.rb +14 -0
- data/spec/unit/support/shared/skytap_context.rb +3 -1
- data/spec/unit/vm_spec.rb +6 -4
- metadata +9 -9
- data/Vagrantfile.rej +0 -83
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ee9cca3ef03d038cdb2470d8311a73a4d8b2abd6
|
|
4
|
+
data.tar.gz: 8d8a3248ef15261b24731511665da4ae73ea90b4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e8cfb11207527c5d94ce6b50b1c5735b24f2080b6565d6977173bdfa9317072b6173b2b42f672fbfe080f2fd2d331b68e59de0b523c82085253fb2b752a967fb
|
|
7
|
+
data.tar.gz: 88af9755df93f2e2a1514bc86b1c3600561aa25e0dff8adf2695563b7ecf23c82463d03a976783aca0a09e7c3565c5d7209913194d28710ea7ec3ada34307ce9
|
data/.byebug_history
CHANGED
|
@@ -1,256 +1,256 @@
|
|
|
1
1
|
c
|
|
2
|
-
s
|
|
3
|
-
n
|
|
4
|
-
args
|
|
5
|
-
message
|
|
6
|
-
finish
|
|
7
|
-
object
|
|
8
|
-
s
|
|
9
|
-
args
|
|
10
|
-
self
|
|
11
|
-
@method_name
|
|
12
|
-
method_name
|
|
13
2
|
$!
|
|
14
|
-
s
|
|
15
|
-
machine
|
|
16
|
-
fp
|
|
17
|
-
c 58
|
|
18
|
-
c
|
|
19
|
-
expect(map.values.first).to be_a(Pathname)
|
|
20
3
|
c
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
c
|
|
29
|
-
self
|
|
30
|
-
c
|
|
31
|
-
id
|
|
32
|
-
(guest_port == 22 && host_port == 2222)
|
|
33
|
-
self
|
|
34
|
-
c
|
|
35
|
-
up
|
|
36
|
-
c
|
|
37
|
-
display options
|
|
4
|
+
@env[:initial_states]
|
|
5
|
+
vm_ids
|
|
6
|
+
n
|
|
7
|
+
q
|
|
8
|
+
env[:initial_states]
|
|
9
|
+
vm_ids
|
|
10
|
+
n
|
|
38
11
|
c
|
|
39
|
-
|
|
12
|
+
environment.current_vm.id
|
|
13
|
+
env[:machine].id
|
|
14
|
+
environment.current_vm
|
|
15
|
+
vm_ids = env[:machines].try(:collect, &:id)
|
|
16
|
+
env[:vm_ids]
|
|
17
|
+
env[:first_machine]
|
|
18
|
+
env[:initial_states]
|
|
19
|
+
env.keys
|
|
20
|
+
env
|
|
21
|
+
env.keys
|
|
40
22
|
c
|
|
41
|
-
|
|
42
|
-
options
|
|
23
|
+
initial_states
|
|
43
24
|
c
|
|
44
|
-
|
|
25
|
+
machine
|
|
45
26
|
c
|
|
46
|
-
|
|
47
|
-
@env[:forwarded_ports].last
|
|
48
|
-
@env[:forwarded_ports]
|
|
49
|
-
fp.internal_ssh_port?
|
|
27
|
+
machine
|
|
50
28
|
c
|
|
51
|
-
|
|
29
|
+
n
|
|
52
30
|
c
|
|
53
|
-
|
|
31
|
+
finish
|
|
32
|
+
n
|
|
54
33
|
c
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
34
|
+
n
|
|
35
|
+
machine.name
|
|
36
|
+
c 89
|
|
58
37
|
c
|
|
59
|
-
|
|
60
|
-
env[:port_collision_extra_in_use]
|
|
61
|
-
ports
|
|
38
|
+
names
|
|
62
39
|
c
|
|
63
|
-
|
|
40
|
+
n
|
|
64
41
|
c
|
|
65
|
-
|
|
42
|
+
display name
|
|
66
43
|
c
|
|
67
|
-
|
|
68
|
-
env[:machine].ssh_info
|
|
69
|
-
env[:machine].name
|
|
44
|
+
name
|
|
70
45
|
c
|
|
71
|
-
|
|
72
|
-
|
|
46
|
+
@env.default_provider
|
|
47
|
+
finish
|
|
48
|
+
s
|
|
49
|
+
@env
|
|
50
|
+
@sub_args
|
|
51
|
+
n
|
|
52
|
+
finish
|
|
53
|
+
Skytap::Command::Up
|
|
73
54
|
n
|
|
74
55
|
c
|
|
75
|
-
env[:port_collision_extra_in_use]
|
|
76
|
-
c
|
|
77
|
-
env[:host].capability(:read_forwarded_ports, env[:machine])
|
|
78
|
-
c
|
|
79
|
-
b 21
|
|
80
56
|
n
|
|
57
|
+
display opts
|
|
58
|
+
display name
|
|
81
59
|
c
|
|
82
|
-
|
|
83
|
-
search_paths
|
|
60
|
+
name
|
|
84
61
|
n
|
|
85
|
-
|
|
86
|
-
args
|
|
62
|
+
name
|
|
87
63
|
n
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
c
|
|
95
|
-
ap resp
|
|
96
|
-
c
|
|
97
|
-
ap JSON.load(resp.body)
|
|
98
|
-
resp.body
|
|
99
|
-
ap resp
|
|
100
|
-
c
|
|
101
|
-
$!
|
|
64
|
+
@ui.machine("metadata", "provider", provider_name)
|
|
65
|
+
n
|
|
66
|
+
finish
|
|
67
|
+
result
|
|
68
|
+
n
|
|
69
|
+
name
|
|
102
70
|
n
|
|
103
71
|
c
|
|
104
|
-
|
|
72
|
+
env[:machines].collect(&:name)
|
|
73
|
+
env[:machines]
|
|
74
|
+
machines
|
|
75
|
+
machines.keys
|
|
76
|
+
vm.from_template?
|
|
77
|
+
vm.configuration_url
|
|
78
|
+
vm.configuration_id
|
|
79
|
+
vm.id
|
|
80
|
+
vm
|
|
81
|
+
puts h
|
|
82
|
+
h[:foo]
|
|
83
|
+
puts h[:boo]
|
|
84
|
+
puts h
|
|
85
|
+
h[:boo] << 2
|
|
86
|
+
puts h
|
|
87
|
+
h
|
|
88
|
+
h=Hash.new{|h, k| h[k] = []}
|
|
89
|
+
new_machines.first.name
|
|
90
|
+
machine.name
|
|
91
|
+
vm.template_url
|
|
92
|
+
vm.configuration_url
|
|
93
|
+
vm.name
|
|
94
|
+
vm = API::Vm.fetch(env, vm_url)
|
|
95
|
+
vm_url
|
|
96
|
+
vm.attrs
|
|
97
|
+
vm = API::Vm.fetch(vm_url, env)
|
|
98
|
+
vm = API::Vm.fetch(vm_url)
|
|
99
|
+
vm = Vm.fetch(vm_url)
|
|
100
|
+
vm_url = new_machines.first.provider_config.vm_url
|
|
101
|
+
vm_url = machine.provider_config.vm_url
|
|
102
|
+
env[:environment]
|
|
103
|
+
active_machines
|
|
104
|
+
new_machines
|
|
105
|
+
c
|
|
106
|
+
machines.first.provider_name
|
|
107
|
+
machines.first.provider.name
|
|
108
|
+
machines.first.provider.id
|
|
109
|
+
machines.first.provider.to_s
|
|
110
|
+
machines.first.provider
|
|
111
|
+
machines
|
|
112
|
+
@env.machines
|
|
105
113
|
$!
|
|
106
|
-
s
|
|
107
|
-
ap resp
|
|
108
|
-
args
|
|
109
|
-
up
|
|
110
|
-
url
|
|
111
|
-
c
|
|
112
|
-
ap body['vms']
|
|
113
|
-
ap body.keys
|
|
114
|
-
ap body
|
|
115
|
-
body=JSON.load(resp.body)
|
|
116
114
|
n
|
|
117
|
-
|
|
115
|
+
q
|
|
116
|
+
env[:environment].url
|
|
117
|
+
env[:environment]
|
|
118
|
+
active_machines
|
|
119
|
+
new_machines
|
|
118
120
|
c
|
|
119
|
-
finish
|
|
120
121
|
n
|
|
121
122
|
c
|
|
122
|
-
|
|
123
|
-
|
|
123
|
+
Hash[@env.active_machines].values.first
|
|
124
|
+
Hash[@env.active_machines].values
|
|
125
|
+
Hash[@env.active_machines].first
|
|
126
|
+
Hash[@env.active_machines]
|
|
127
|
+
@env.active_machines.to_h
|
|
128
|
+
@env.active_machines.first.last
|
|
129
|
+
@env.active_machines
|
|
130
|
+
@env
|
|
131
|
+
env
|
|
132
|
+
machines.first.provider.name
|
|
133
|
+
machines.first.provider
|
|
134
|
+
c
|
|
124
135
|
n
|
|
125
136
|
finish
|
|
126
|
-
$!
|
|
127
137
|
n
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
ap vm.attrs
|
|
131
|
-
ap vm
|
|
132
|
-
args
|
|
133
|
-
n
|
|
134
|
-
vm_ids
|
|
135
|
-
n
|
|
136
|
-
finish
|
|
137
|
-
vm.region
|
|
138
|
+
machines
|
|
139
|
+
$!
|
|
138
140
|
finish
|
|
141
|
+
result
|
|
139
142
|
n
|
|
140
|
-
|
|
141
|
-
finish
|
|
143
|
+
entry
|
|
142
144
|
n
|
|
143
|
-
|
|
145
|
+
result
|
|
146
|
+
$!
|
|
144
147
|
finish
|
|
148
|
+
options
|
|
145
149
|
s
|
|
146
|
-
|
|
150
|
+
names
|
|
151
|
+
n
|
|
147
152
|
c
|
|
148
|
-
|
|
153
|
+
n
|
|
149
154
|
c
|
|
150
|
-
ap attrs
|
|
151
|
-
attrs
|
|
152
|
-
attributes
|
|
153
155
|
n
|
|
154
|
-
s
|
|
155
156
|
c
|
|
156
|
-
|
|
157
|
+
q
|
|
157
158
|
c
|
|
158
|
-
|
|
159
|
+
skytap_environment.class
|
|
159
160
|
c
|
|
160
|
-
|
|
161
|
+
q
|
|
161
162
|
c
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
'w33' =~ /(\w+/
|
|
165
|
-
$1
|
|
166
|
-
'w33' =~ /\w+/
|
|
167
|
-
$2
|
|
168
|
-
$1
|
|
169
|
-
/\w+/ =~ 'w33'
|
|
170
|
-
$2
|
|
171
|
-
$1
|
|
163
|
+
API::Environment.properties(nil)
|
|
164
|
+
API::Environment.properties
|
|
172
165
|
n
|
|
173
|
-
pidfile
|
|
174
166
|
c
|
|
175
|
-
|
|
167
|
+
s
|
|
168
|
+
API::Environment.properties
|
|
169
|
+
n
|
|
176
170
|
c
|
|
177
|
-
|
|
178
|
-
|
|
171
|
+
props
|
|
172
|
+
n
|
|
173
|
+
env[:environment]
|
|
179
174
|
c
|
|
180
|
-
env
|
|
181
|
-
env.host
|
|
182
|
-
env
|
|
175
|
+
API::Environment.properties(env)
|
|
183
176
|
c
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
Object.const_get("HostDarwin")
|
|
187
|
-
Object.const_get("Foo")
|
|
177
|
+
API::Environment.properties(env)
|
|
178
|
+
n
|
|
188
179
|
c
|
|
189
|
-
|
|
190
|
-
result.exit_code == 0
|
|
191
|
-
result.exit_code
|
|
192
|
-
result = Vagrant::Util::Subprocess.execute("ps", "-p", pid.to_s, "-o", "comm")
|
|
180
|
+
n
|
|
193
181
|
c
|
|
182
|
+
env[:environment]
|
|
194
183
|
n
|
|
195
|
-
|
|
184
|
+
c
|
|
185
|
+
{'url' => 'foo'}
|
|
186
|
+
{'url':'foo'}
|
|
187
|
+
API::Environment.properties(env)
|
|
196
188
|
n
|
|
197
|
-
|
|
189
|
+
ap env.keys
|
|
190
|
+
ap env
|
|
198
191
|
c
|
|
199
|
-
|
|
192
|
+
cc
|
|
200
193
|
c
|
|
201
|
-
|
|
194
|
+
machine2
|
|
195
|
+
n
|
|
196
|
+
machine1
|
|
197
|
+
c
|
|
198
|
+
display names
|
|
199
|
+
c
|
|
200
|
+
display names
|
|
202
201
|
c
|
|
203
202
|
n
|
|
204
|
-
|
|
203
|
+
s
|
|
205
204
|
n
|
|
205
|
+
machine
|
|
206
206
|
c
|
|
207
|
-
|
|
208
|
-
finish
|
|
209
|
-
$!
|
|
210
|
-
n
|
|
211
|
-
pid
|
|
207
|
+
display names
|
|
212
208
|
c
|
|
213
|
-
|
|
214
|
-
pid
|
|
209
|
+
machines.count
|
|
215
210
|
c
|
|
216
|
-
|
|
211
|
+
b 101
|
|
212
|
+
display names
|
|
213
|
+
c
|
|
214
|
+
names
|
|
215
|
+
c
|
|
216
|
+
environment
|
|
217
217
|
n
|
|
218
218
|
c
|
|
219
|
+
display names
|
|
220
|
+
c
|
|
221
|
+
puts i
|
|
222
|
+
c
|
|
223
|
+
b 101
|
|
224
|
+
puts i
|
|
225
|
+
i
|
|
226
|
+
c 101
|
|
219
227
|
n
|
|
220
|
-
|
|
221
|
-
|
|
228
|
+
c
|
|
229
|
+
display names
|
|
230
|
+
c
|
|
231
|
+
display names
|
|
232
|
+
c
|
|
233
|
+
c 96
|
|
222
234
|
n
|
|
223
|
-
|
|
235
|
+
c 86
|
|
224
236
|
n
|
|
237
|
+
names
|
|
225
238
|
c
|
|
226
|
-
|
|
227
|
-
puts $1.backtrace
|
|
228
|
-
$!
|
|
229
|
-
n
|
|
239
|
+
names
|
|
230
240
|
c
|
|
231
|
-
|
|
232
|
-
File.read('foo')
|
|
233
|
-
finish
|
|
234
|
-
args
|
|
235
|
-
finish
|
|
236
|
-
$!
|
|
237
|
-
s
|
|
238
|
-
pidfile
|
|
239
|
-
n
|
|
241
|
+
names
|
|
240
242
|
c
|
|
241
|
-
|
|
242
|
-
Pathname
|
|
243
|
-
Path
|
|
243
|
+
names
|
|
244
244
|
c
|
|
245
|
+
b 96
|
|
246
|
+
b
|
|
247
|
+
names
|
|
248
|
+
finish
|
|
245
249
|
$!
|
|
246
250
|
n
|
|
247
251
|
c
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
forwarded_port
|
|
252
|
+
n
|
|
253
|
+
folders.count
|
|
251
254
|
c
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
VagrantPlugins::Skytap::API
|
|
255
|
-
VagrantPlugins::Skytap::sdf
|
|
256
|
-
VagrantPlugins::Skytap
|
|
255
|
+
folders.first
|
|
256
|
+
folders.count
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -111,7 +111,9 @@ Notes:
|
|
|
111
111
|
* When the first VM is created, a Skytap environment will be created; when all VMs are deleted, the containing environment will also be deleted.
|
|
112
112
|
* The timeout for graceful shutdown is currently set to 5 minutes.
|
|
113
113
|
* Changes to hardware settings of an existing VM will take effect when the VM is being powered on; that is, when doing `vagrant reload`, or `vagrant up` when the machine is halted.
|
|
114
|
+
* The `--install-provider` option for `vagrant up` is unsupported. The provider will be installed, but it will be necessary to run `vagrant up` again.
|
|
114
115
|
|
|
116
|
+
will install the provider only. It will be necess
|
|
115
117
|
|
|
116
118
|
## Additional Supported Actions
|
|
117
119
|
|
|
@@ -207,3 +209,5 @@ To enable logging while troubleshooting, see [https://docs.vagrantup.com/v2/othe
|
|
|
207
209
|
* Port forwarding is currently unsupported on Windows.
|
|
208
210
|
* Although several Skytap public library VMs include credentials for the `root` login, its use is not recommended.
|
|
209
211
|
* Once a VM has been created, it is not possible to change its connection method (i.e., connect using a different VPN). This is the case whether the VPN is specified in the Vagrantfile with the `vpn_url` setting, or selected interactively.
|
|
212
|
+
* Installing the Skytap provider using the `--install-provider` flag is not supported.
|
|
213
|
+
* The `vagrant port` command is currently not supported.
|
|
@@ -184,6 +184,19 @@ module VagrantPlugins
|
|
|
184
184
|
end
|
|
185
185
|
end
|
|
186
186
|
|
|
187
|
+
# This is the action that the default "vagrant up" invokes.
|
|
188
|
+
# Since we don't call action_up, this will only be called
|
|
189
|
+
# if the user attempts to install the Skytap provider using
|
|
190
|
+
# the --install-provider flag.
|
|
191
|
+
def self.action_up
|
|
192
|
+
Vagrant::Action::Builder.new.tap do |b|
|
|
193
|
+
b.use Message, "You are seeing this message because the Skytap "\
|
|
194
|
+
"provider currently does not fully support the --install-provider "\
|
|
195
|
+
"flag. The provider has been installed successfully. Please run " \
|
|
196
|
+
"'vagrant up' again to continue."
|
|
197
|
+
end
|
|
198
|
+
end
|
|
199
|
+
|
|
187
200
|
# The Skytap provider has a modified "vagrant up" command which
|
|
188
201
|
# takes advantage of parallel runstate operations on Skytap
|
|
189
202
|
# environments. The create and update_hardware actions are
|
data/spec/unit/base.rb
CHANGED
|
@@ -11,6 +11,8 @@ require "webmock/rspec"
|
|
|
11
11
|
require "vagrant"
|
|
12
12
|
require "vagrant/util/platform"
|
|
13
13
|
|
|
14
|
+
require "vagrant-skytap"
|
|
15
|
+
|
|
14
16
|
# Add the test directory to the load path
|
|
15
17
|
$:.unshift File.expand_path("../../", __FILE__)
|
|
16
18
|
|
|
@@ -22,8 +24,7 @@ require "unit/support/shared/action_synced_folders_context"
|
|
|
22
24
|
require "unit/support/shared/capability_helpers_context"
|
|
23
25
|
require "unit/support/shared/plugin_command_context"
|
|
24
26
|
require "unit/support/shared/skytap_context"
|
|
25
|
-
|
|
26
|
-
require "vagrant-skytap"
|
|
27
|
+
require "unit/support/shared/rest_api_context"
|
|
27
28
|
|
|
28
29
|
# Do not buffer output
|
|
29
30
|
$stdout.sync = true
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
require_relative 'base'
|
|
2
|
-
require "vagrant-skytap/api/environment"
|
|
3
|
-
require "vagrant-skytap/api/vm"
|
|
4
2
|
|
|
5
3
|
describe VagrantPlugins::Skytap::API::Environment do
|
|
6
4
|
include_context "unit"
|
|
5
|
+
include_context "rest_api"
|
|
7
6
|
Errors = VagrantPlugins::Skytap::Errors
|
|
8
7
|
|
|
9
|
-
let(:
|
|
8
|
+
let(:json_path) { File.join(File.expand_path('..', __FILE__), 'support', 'api_responses') }
|
|
9
|
+
let(:vm1_attrs) { read_json(json_path, 'vm1.json') }
|
|
10
10
|
let(:vm2_attrs) { vm1_attrs.merge("id" => "6981851", "name" => "VM2") }
|
|
11
|
-
let(:config_vm_attrs)
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
let(:
|
|
15
|
-
let(:
|
|
11
|
+
let(:config_vm_attrs) do
|
|
12
|
+
vm1_attrs.merge("configuration_url" => "https://example.com/configurations/5570024", "template_url" => nil)
|
|
13
|
+
end
|
|
14
|
+
let(:network1_attrs) { read_json(json_path, 'network1.json') }
|
|
15
|
+
let(:vpn_attachment1_attrs) { read_json(json_path, 'vpn_attachment1.json') }
|
|
16
|
+
let(:empty_environment_attrs) { read_json(json_path, 'empty_environment.json') }
|
|
17
|
+
let(:empty_publish_set_attrs) { read_json(json_path, 'empty_publish_set.json') }
|
|
16
18
|
|
|
17
19
|
let(:attrs_one_vm) do
|
|
18
20
|
empty_environment_attrs.dup.tap do |ret|
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
require_relative 'base'
|
|
2
|
-
require "vagrant-skytap/api/publish_set"
|
|
3
2
|
|
|
4
3
|
describe VagrantPlugins::Skytap::API::PublishSet do
|
|
5
4
|
include_context "unit"
|
|
5
|
+
include_context "rest_api"
|
|
6
6
|
|
|
7
|
-
let(:
|
|
7
|
+
let(:json_path) { File.join(File.expand_path('..', __FILE__), 'support', 'api_responses') }
|
|
8
|
+
let(:vm1_attrs) { read_json(json_path, 'vm1.json') }
|
|
8
9
|
let(:vm2_attrs) { vm1_attrs.merge("id" => "6981851", "name" => "VM2") }
|
|
9
|
-
let(:empty_environment_attrs) {
|
|
10
|
-
let(:empty_publish_set_attrs) {
|
|
10
|
+
let(:empty_environment_attrs) { read_json(json_path, 'empty_environment.json')}
|
|
11
|
+
let(:empty_publish_set_attrs) { read_json(json_path, 'empty_publish_set.json')}
|
|
11
12
|
|
|
12
13
|
let(:env_attrs) do
|
|
13
14
|
empty_environment_attrs.dup.tap do |ret|
|
|
@@ -6,14 +6,16 @@ require "vagrant-skytap/api/vpn_attachment"
|
|
|
6
6
|
|
|
7
7
|
describe VagrantPlugins::Skytap::SetupHelper do
|
|
8
8
|
include_context "unit"
|
|
9
|
+
include_context "rest_api"
|
|
9
10
|
|
|
10
11
|
let(:instance) { described_class.new }
|
|
12
|
+
let(:json_path) { File.join(File.expand_path('..', __FILE__), 'support', 'api_responses') }
|
|
11
13
|
|
|
12
|
-
let(:vm1_attrs) {
|
|
13
|
-
let(:network1_attrs) {
|
|
14
|
-
let(:vpn1_attrs) {
|
|
15
|
-
let(:vpn_attachment1_attrs) {
|
|
16
|
-
let(:empty_environment_attrs) {
|
|
14
|
+
let(:vm1_attrs) { read_json(json_path, 'vm1.json') }
|
|
15
|
+
let(:network1_attrs) { read_json(json_path, 'network1.json') }
|
|
16
|
+
let(:vpn1_attrs) { read_json(json_path, 'vpn1.json') }
|
|
17
|
+
let(:vpn_attachment1_attrs) { read_json(json_path, 'vpn_attachment1.json') }
|
|
18
|
+
let(:empty_environment_attrs) { read_json(json_path, 'empty_environment.json')}
|
|
17
19
|
|
|
18
20
|
|
|
19
21
|
let(:network_attrs) do
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
require "vagrant-skytap/api/credentials"
|
|
2
|
+
require "vagrant-skytap/api/environment"
|
|
3
|
+
require "vagrant-skytap/api/interface"
|
|
4
|
+
require "vagrant-skytap/api/network"
|
|
5
|
+
require "vagrant-skytap/api/public_ip"
|
|
6
|
+
require "vagrant-skytap/api/published_service"
|
|
7
|
+
require "vagrant-skytap/api/resource"
|
|
8
|
+
require "vagrant-skytap/api/vm"
|
|
9
|
+
require "vagrant-skytap/api/vpn_attachment"
|
|
10
|
+
require "vagrant-skytap/api/vpn"
|
|
11
|
+
|
|
12
|
+
shared_context "rest_api" do
|
|
13
|
+
include_context "skytap"
|
|
14
|
+
end
|
data/spec/unit/vm_spec.rb
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
require_relative 'base'
|
|
2
|
-
require "vagrant-skytap/api/vm"
|
|
3
2
|
|
|
4
3
|
describe VagrantPlugins::Skytap::API::Vm do
|
|
5
4
|
include_context "unit"
|
|
5
|
+
include_context "rest_api"
|
|
6
6
|
|
|
7
|
-
let(:
|
|
7
|
+
let(:json_path) { File.join(File.expand_path('..', __FILE__), 'support', 'api_responses') }
|
|
8
|
+
|
|
9
|
+
let(:vm1_attrs) { read_json(json_path, 'vm1.json') }
|
|
8
10
|
let(:vm2_attrs) { vm1_attrs.merge("id" => "6981851", "name" => "VM2") }
|
|
9
|
-
let(:network1_attrs) {
|
|
10
|
-
let(:empty_environment_attrs) {
|
|
11
|
+
let(:network1_attrs) { read_json(json_path, 'network1.json') }
|
|
12
|
+
let(:empty_environment_attrs) { read_json(json_path, 'empty_environment.json') }
|
|
11
13
|
|
|
12
14
|
let(:iso_env) do
|
|
13
15
|
# We have to create a Vagrantfile so there is a root path
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: vagrant-skytap
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nick Astete
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-01-
|
|
11
|
+
date: 2016-01-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: json_pure
|
|
@@ -525,12 +525,12 @@ files:
|
|
|
525
525
|
- spec/unit/prepare_collision_params_spec.rb
|
|
526
526
|
- spec/unit/publish_set_spec.rb
|
|
527
527
|
- spec/unit/setup_helper_spec.rb
|
|
528
|
-
- spec/unit/
|
|
529
|
-
- spec/unit/
|
|
530
|
-
- spec/unit/
|
|
531
|
-
- spec/unit/
|
|
532
|
-
- spec/unit/
|
|
533
|
-
- spec/unit/
|
|
528
|
+
- spec/unit/support/api_responses/empty_environment.json
|
|
529
|
+
- spec/unit/support/api_responses/empty_publish_set.json
|
|
530
|
+
- spec/unit/support/api_responses/network1.json
|
|
531
|
+
- spec/unit/support/api_responses/vm1.json
|
|
532
|
+
- spec/unit/support/api_responses/vpn1.json
|
|
533
|
+
- spec/unit/support/api_responses/vpn_attachment1.json
|
|
534
534
|
- spec/unit/support/dummy_communicator.rb
|
|
535
535
|
- spec/unit/support/dummy_provider.rb
|
|
536
536
|
- spec/unit/support/forwarded_ports/machines/vm1/skytap/id
|
|
@@ -548,6 +548,7 @@ files:
|
|
|
548
548
|
- spec/unit/support/shared/base_context.rb
|
|
549
549
|
- spec/unit/support/shared/capability_helpers_context.rb
|
|
550
550
|
- spec/unit/support/shared/plugin_command_context.rb
|
|
551
|
+
- spec/unit/support/shared/rest_api_context.rb
|
|
551
552
|
- spec/unit/support/shared/skytap_context.rb
|
|
552
553
|
- spec/unit/vm_spec.rb
|
|
553
554
|
- tasks/acceptance.rake
|
|
@@ -555,7 +556,6 @@ files:
|
|
|
555
556
|
- tasks/test.rake
|
|
556
557
|
- vagrant-skytap.gemspec
|
|
557
558
|
- vagrant-spec.config.rb
|
|
558
|
-
- Vagrantfile.rej
|
|
559
559
|
- .byebug_history
|
|
560
560
|
- .gitignore
|
|
561
561
|
- .hgignore
|
data/Vagrantfile.rej
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
--- Vagrantfile
|
|
2
|
-
+++ Vagrantfile
|
|
3
|
-
@@ -85,6 +85,16 @@
|
|
4
|
-
environment_vm2: {
|
|
5
|
-
vm_url: "https://cloud.skytap.com/vms/8283794"
|
|
6
|
-
},
|
|
7
|
-
+ test_vagrant_customer_template_vm_1: {
|
|
8
|
-
+ vm_url: "https://test.skytap.com/vms/6863190",
|
|
9
|
-
+ username: "autoadmin",
|
|
10
|
-
+ password: "autoadmin",
|
|
11
|
-
+ },
|
|
12
|
-
+ test_vagrant_customer_env_vm_1: {
|
|
13
|
-
+ vm_url: "https://test.skytap.com/vms/7088324",
|
|
14
|
-
+ username: "autoadmin",
|
|
15
|
-
+ password: "autoadmin",
|
|
16
|
-
+ },
|
|
17
|
-
}.tap do |ret|
|
|
18
|
-
ret.each do |key, vm|
|
|
19
|
-
vm[:username] ||= "skytap"
|
|
20
|
-
@@ -97,7 +107,7 @@
|
|
21
|
-
settings_key = :etrue_prod
|
|
22
|
-
vm1_key = :golden
|
|
23
|
-
vm2_key = :windows_winrm_configured
|
|
24
|
-
-vm3_key = :ubuntu2
|
|
25
|
-
+vm3_key = :golden
|
|
26
|
-
#############################
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
@@ -120,7 +130,7 @@
|
|
30
|
-
#end
|
|
31
|
-
|
|
32
|
-
config.vm.define "vm1" do |box|
|
|
33
|
-
- #box.vm.hostname = "vm1"
|
|
34
|
-
+ box.vm.hostname = "vm1"
|
|
35
|
-
box.vm.provider :skytap do |box|
|
|
36
|
-
box.vm_url = vms[vm1_key][:vm_url]
|
|
37
|
-
#box.cpus = 1
|
|
38
|
-
@@ -132,10 +142,10 @@
|
|
39
|
-
#box.vm.synced_folder ".", "/vagrant-skytap", type: :nfs, mount_options: ['actimeo=1']
|
|
40
|
-
#box.vm.provision "shell", path: "provisioning/trivial.sh"
|
|
41
|
-
box.vm.provision "shell", path: "provisioning/apache.sh"
|
|
42
|
-
- box.vm.provision "shell", path: "provisioning/vagrant.sh"
|
|
43
|
-
+ #box.vm.provision "shell", path: "provisioning/vagrant.sh"
|
|
44
|
-
|
|
45
|
-
- box.vm.network :forwarded_port, guest: 80, host: 9000
|
|
46
|
-
- #box.vm.network :forwarded_port, guest: 21, host: 9001
|
|
47
|
-
+ box.vm.network :forwarded_port, guest: 80, host: 9000, auto_correct: true
|
|
48
|
-
+ box.vm.network :forwarded_port, guest: 21, host: 9001, auto_correct: true
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
# config.vm.define "vm2" do |box|
|
|
52
|
-
@@ -149,17 +159,20 @@
|
|
53
|
-
# box.vm.synced_folder "vm2", "/synced", type: :nfs
|
|
54
|
-
# end
|
|
55
|
-
#
|
|
56
|
-
-# config.vm.define "vm3" do |box|
|
|
57
|
-
-# box.vm.hostname = "vm3"
|
|
58
|
-
-# box.vm.provider :skytap do |box|
|
|
59
|
-
-# box.vm_url = vms[vm3_key][:vm_url]
|
|
60
|
-
-# end
|
|
61
|
-
-# box.ssh.username = vms[vm3_key][:username]
|
|
62
|
-
-# box.ssh.password = vms[vm3_key][:password]
|
|
63
|
-
-# box.vm.communicator = vms[vm3_key][:communicator]
|
|
64
|
-
-# box.vm.synced_folder "vm3", "/synced", type: :nfs
|
|
65
|
-
-# box.vm.provision "shell", path: "provisioning/trivial.sh"
|
|
66
|
-
-# end
|
|
67
|
-
+ config.vm.define "vm3" do |box|
|
|
68
|
-
+ #box.vm.hostname = "vm3"
|
|
69
|
-
+ box.vm.provider :skytap do |box|
|
|
70
|
-
+ box.vm_url = vms[vm3_key][:vm_url]
|
|
71
|
-
+ end
|
|
72
|
-
+ box.ssh.username = vms[vm3_key][:username]
|
|
73
|
-
+ box.ssh.password = vms[vm3_key][:password]
|
|
74
|
-
+ box.vm.communicator = vms[vm3_key][:communicator]
|
|
75
|
-
+ #box.vm.synced_folder "vm3", "/synced", type: :nfs
|
|
76
|
-
+ box.vm.provision "shell", path: "provisioning/apache.sh"
|
|
77
|
-
+
|
|
78
|
-
+ box.vm.network :forwarded_port, guest: 80, host: 9000, auto_correct: true
|
|
79
|
-
+ box.vm.network :forwarded_port, guest: 21, host: 9001, auto_correct: true
|
|
80
|
-
+ end
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
#ubuntu.vm.synced_folder "vm1", "/home/skytap/app", type: :nfs, :mount_options => ['actimeo=1']
|