vmfloaty 1.2.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +7 -9
- data/lib/vmfloaty/abs.rb +50 -51
- data/lib/vmfloaty/http.rb +2 -6
- data/lib/vmfloaty/logger.rb +13 -10
- data/lib/vmfloaty/nonstandard_pooler.rb +3 -2
- data/lib/vmfloaty/pooler.rb +19 -24
- data/lib/vmfloaty/service.rb +3 -3
- data/lib/vmfloaty/utils.rb +68 -64
- data/lib/vmfloaty/version.rb +1 -2
- data/lib/vmfloaty.rb +52 -57
- data/spec/spec_helper.rb +30 -5
- data/spec/vmfloaty/abs/auth_spec.rb +26 -17
- data/spec/vmfloaty/abs_spec.rb +52 -43
- data/spec/vmfloaty/auth_spec.rb +23 -13
- data/spec/vmfloaty/nonstandard_pooler_spec.rb +32 -31
- data/spec/vmfloaty/pooler_spec.rb +29 -26
- data/spec/vmfloaty/service_spec.rb +10 -10
- data/spec/vmfloaty/ssh_spec.rb +3 -3
- data/spec/vmfloaty/utils_spec.rb +178 -161
- metadata +13 -21
@@ -16,7 +16,7 @@ describe Service do
|
|
16
16
|
it 'prompts the user for their password and retrieves a token' do
|
17
17
|
config = { 'user' => 'first.last', 'url' => 'http://default.url' }
|
18
18
|
service = Service.new(MockOptions.new, config)
|
19
|
-
allow(
|
19
|
+
allow($stdout).to receive(:puts).with('Enter your http://default.url service password:')
|
20
20
|
allow(Commander::UI).to(receive(:password)
|
21
21
|
.with('Enter your http://default.url service password:', '*')
|
22
22
|
.and_return('hunter2'))
|
@@ -29,9 +29,9 @@ describe Service do
|
|
29
29
|
it 'prompts the user for their username and password if the username is unknown' do
|
30
30
|
config = { 'url' => 'http://default.url' }
|
31
31
|
service = Service.new(MockOptions.new({}), config)
|
32
|
-
allow(
|
33
|
-
allow(
|
34
|
-
allow(
|
32
|
+
allow($stdout).to receive(:puts).with 'Enter your http://default.url service username:'
|
33
|
+
allow($stdout).to receive(:puts).with "\n"
|
34
|
+
allow($stdin).to receive(:gets).and_return('first.last')
|
35
35
|
allow(Commander::UI).to(receive(:password)
|
36
36
|
.with('Enter your http://default.url service password:', '*')
|
37
37
|
.and_return('hunter2'))
|
@@ -59,16 +59,16 @@ describe Service do
|
|
59
59
|
it 'reports the status of a token' do
|
60
60
|
config = {
|
61
61
|
'user' => 'first.last',
|
62
|
-
'url'
|
62
|
+
'url' => 'http://default.url'
|
63
63
|
}
|
64
64
|
options = MockOptions.new('token' => 'token-value')
|
65
65
|
service = Service.new(options, config)
|
66
66
|
status = {
|
67
|
-
'ok'
|
68
|
-
'user'
|
69
|
-
'created'
|
70
|
-
'last_accessed'
|
71
|
-
'reserved_hosts' => []
|
67
|
+
'ok' => true,
|
68
|
+
'user' => config['user'],
|
69
|
+
'created' => '2017-09-22 02:04:18 +0000',
|
70
|
+
'last_accessed' => '2017-09-22 02:04:28 +0000',
|
71
|
+
'reserved_hosts' => []
|
72
72
|
}
|
73
73
|
allow(Auth).to(receive(:token_status)
|
74
74
|
.with(nil, config['url'], 'token-value')
|
data/spec/vmfloaty/ssh_spec.rb
CHANGED
@@ -8,14 +8,14 @@ class ServiceStub
|
|
8
8
|
if os_types.keys[0] == 'abs_host_string'
|
9
9
|
return {
|
10
10
|
os_types.keys[0] => { 'hostname' => ['abs-hostname.delivery.puppetlabs.net'] },
|
11
|
-
'ok'
|
11
|
+
'ok' => true
|
12
12
|
}
|
13
13
|
end
|
14
14
|
|
15
15
|
{
|
16
16
|
os_types.keys[0] => { 'hostname' => 'vmpooler-hostname' },
|
17
|
-
'domain'
|
18
|
-
'ok'
|
17
|
+
'domain' => 'delivery.puppetlabs.net',
|
18
|
+
'ok' => true
|
19
19
|
}
|
20
20
|
end
|
21
21
|
|