-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- used to set VM Options advanced configurations usage: ``` cloud_properties: vmx_options: sched.mem.maxmemctl: "1330" ``` [#148036961](https://www.pivotaltracker.com/story/show/148036961) Signed-off-by: Chris Dutra <[email protected]>
- Loading branch information
Shoabe Shariff
authored and
Chris Dutra
committed
Jul 6, 2017
1 parent
b893fed
commit c73c05a
Showing
4 changed files
with
116 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
require 'integration/spec_helper' | ||
|
||
describe 'vmx_options' do | ||
let(:vmx_option_key) { 'some_key' } | ||
|
||
let(:network_spec) do | ||
{ | ||
'static' => { | ||
'ip' => "169.254.#{rand(1..254)}.#{rand(4..254)}", | ||
'netmask' => '255.255.254.0', | ||
'cloud_properties' => {'name' => @vlan}, | ||
'default' => ['dns', 'gateway'], | ||
'dns' => ['169.254.1.2'], | ||
'gateway' => '169.254.1.3' | ||
} | ||
} | ||
end | ||
|
||
context 'when vmx_options are provided as a Hash' do | ||
let(:vm_type) do | ||
{ | ||
'ram' => 512, | ||
'disk' => 2048, | ||
'cpu' => 1, | ||
'vmx_options' => { | ||
vmx_option_key => 'some_value' | ||
} | ||
} | ||
end | ||
|
||
it 'can set the defined vmx_options as configuration properties' do | ||
begin | ||
vm_id = @cpi.create_vm( | ||
'agent-007', | ||
@stemcell_id, | ||
vm_type, | ||
network_spec | ||
) | ||
vm = @cpi.vm_provider.find(vm_id) | ||
|
||
found_vmx_option = vm.mob.config.extra_config.find {|c| c.key == vmx_option_key} | ||
expect(found_vmx_option).not_to be_nil | ||
expect(found_vmx_option.value).to eq('some_value') | ||
ensure | ||
delete_vm(@cpi, vm_id) | ||
end | ||
end | ||
end | ||
|
||
context 'when vmx_options are NOT a Hash' do | ||
let(:vm_type) do | ||
{ | ||
'ram' => 512, | ||
'disk' => 2048, | ||
'cpu' => 1, | ||
'vmx_options' => [ | ||
vmx_option_key => 'some_value' | ||
] | ||
} | ||
end | ||
|
||
it 'can set the defined vmx_options as configuration properties' do | ||
expect { | ||
vm_id = @cpi.create_vm( | ||
'agent-007', | ||
@stemcell_id, | ||
vm_type, | ||
network_spec | ||
) | ||
}.to raise_error(/Unable to parse vmx options/) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters