Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #229 from OSLL/7167_libvirt_uuid_by_domain_name
7167 libvirt uuid by domain name
- Loading branch information
Showing
3 changed files
with
45 additions
and
3 deletions.
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
7 changes: 7 additions & 0 deletions
7
spec/test_machine_configurations/7167_libvirt_uuid_by_domain_name.json
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,7 @@ | ||
{ | ||
"cookbook_path": "../recipes/cookbooks/", | ||
"node0": { | ||
"hostname": "node0", | ||
"box": "ubuntu_trusty_libvirt" | ||
} | ||
} |
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,26 @@ | ||
require_relative '../../core/clone' | ||
require_relative '../../core/helper' | ||
|
||
describe nil do | ||
|
||
before :all do | ||
$out = Out.new | ||
$session = Session.new | ||
end | ||
|
||
it 'node exists and method will not throws error' do | ||
lambda {get_libvirt_uuid_by_domain_name("#{ENV['config_name']}_#{ENV['node_name']}")}.should_not raise_error | ||
end | ||
|
||
it 'node does not exist and method will throws error' do | ||
lambda {get_libvirt_uuid_by_domain_name('WRONG')} | ||
.should raise_error 'WRONG: uuid for domain is not found' | ||
end | ||
|
||
it 'method returns existing uuid' do | ||
uuid = get_libvirt_uuid_by_domain_name("#{ENV['config_name']}_#{ENV['node_name']}") | ||
output = execute_bash('virsh -q list --uuid --all', true) | ||
output.should include uuid | ||
end | ||
|
||
end |