File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,5 +4,6 @@ fixtures:
44 apt :
55 repo : " https://github.com/puppetlabs/puppetlabs-apt.git"
66 ref : " 1.8.0"
7+ inifile : " https://github.com/puppetlabs/puppetlabs-inifile"
78 symlinks :
8- one : " ../../../ "
9+ one : " #{source_dir} "
Original file line number Diff line number Diff line change 5252 $sched_log_debug_level = $one::sched_log_debug_level,
5353 $kvm_driver_emulator = $one::kvm_driver_emulator,
5454 $kvm_driver_nic_attrs = $one::kvm_driver_nic_attrs,
55- ) {
55+ ) {
5656
5757 if ! member([' YES' , ' NO' ], $oned_vm_submit_on_hold ) {
5858 fail(" oned_vm_submit_on_hold must be one of 'YES' or 'NO'. Actual value: ${oned_vm_submit_on_hold} " )
123123 source => $hook_scripts_path ,
124124 }
125125
126- file { '/etc/one/vmm_exec/vmm_exec_kvm.conf' :
127- ensure => file ,
128- owner => ' root' ,
129- mode => ' 0640' ,
130- content => template (' one/vmm_exec_kvm.conf.erb' ),
126+ if $kvm_driver_emulator != ' undef' {
127+ ini_setting { 'set_kvm_driver_emulator' :
128+ ensure => present ,
129+ path => ' /etc/one/vmm_exec/vmm_exec_kvm.conf' ,
130+ setting => ' EMULATOR' ,
131+ value => $kvm_driver_emulator ,
132+ }
133+ }
134+
135+ if $kvm_driver_nic_attrs != ' undef' {
136+ ini_setting { 'set_kvm_driver_nic' :
137+ ensure => present ,
138+ path => ' /etc/one/vmm_exec/vmm_exec_kvm.conf' ,
139+ setting => ' NIC' ,
140+ value => $kvm_driver_nic_attrs ,
141+ }
131142 }
132143
133144 if ($backend == ' mysql' ) {
Original file line number Diff line number Diff line change 2424 ],
2525 "dependencies" : [
2626 { "name" : " puppetlabs/stdlib" , "version_requirement" : " > 2.2.0" },
27- { "name" : " puppetlabs/apt" , "version_requirement" : " < 2.0.0" }
27+ { "name" : " puppetlabs/apt" , "version_requirement" : " < 2.0.0" },
28+ { "name" : " puppetlabs/inifile" , "version_requirement" : " < 1.4.0" }
2829 ]
2930}
Original file line number Diff line number Diff line change 88 let ( :facts ) { f }
99 let ( :hiera_config ) { hiera_config }
1010 let ( :pre_condition ) { 'include one' }
11+
1112 context 'general' do
1213 it { should contain_class ( 'one::oned::config' ) }
1314 it { should contain_file ( '/etc/one/oned.conf' ) \
2627 }
2728 it { should contain_file ( '/usr/share/one' ) . with_ensure ( 'directory' ) }
2829 end
30+
2931 context 'with mysql backend' do
3032 let ( :params ) { {
3133 :backend => 'mysql' ,
3537 it { should contain_file ( '/srv/backup' ) }
3638 it { should contain_file ( '/var/lib/one/bin/one_db_backup.sh' ) }
3739 it { should contain_cron ( 'one_db_backup' ) }
40+ end
3841
42+ context 'without kvm driver emulator settings' do
43+ it { should_not contain_ini_setting ( 'set_kvm_driver_emulator' ) }
44+ end
45+
46+ context 'with kvm driver emulator settings' do
47+ let ( :params ) { {
48+ :kvm_driver_emulator => '/usr/bin/foobar/kvm-bogus'
49+ } }
50+ it { should contain_ini_setting ( 'set_kvm_driver_emulator' ) . with_value ( '/usr/bin/foobar/kvm-bogus' ) }
51+ end
52+
53+ context 'without kvm driver nic settings' do
54+ it { should_not contain_ini_setting ( 'set_kvm_driver_nic' ) }
55+ end
56+
57+ context 'with kvm driver nic settings' do
58+ let ( :params ) { {
59+ :kvm_driver_nic_attrs => '[ filter="clean-traffic", model="bogus" ]'
60+ } }
61+ it { should contain_ini_setting ( 'set_kvm_driver_nic' ) . with_value ( '[ filter="clean-traffic", model="bogus" ]' ) }
3962 end
4063 end
4164 end
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments