Fix up OmniOS tests
This commit is contained in:
parent
d696316f71
commit
aebec52404
@ -17,10 +17,10 @@ platforms:
|
|||||||
|
|
||||||
- name: centos-6.5
|
- name: centos-6.5
|
||||||
- name: centos-5.10
|
- name: centos-5.10
|
||||||
- name: omnios-r151006c
|
- name: omnios-r151014
|
||||||
driver:
|
driver:
|
||||||
box: omnios-r151006c
|
box: omnios-r151014
|
||||||
box_url: http://omnios.omniti.com/media/OmniOS_Text_r151006c.iso
|
box_url: http://omnios.omniti.com/media/omnios-r151014.box
|
||||||
run_list:
|
run_list:
|
||||||
- recipe[fake::omnios]
|
- recipe[fake::omnios]
|
||||||
|
|
||||||
|
@ -11,6 +11,11 @@ Install the berkshelf plugin for vagrant, and berkshelf to your local Ruby envir
|
|||||||
vagrant plugin install vagrant-berkshelf
|
vagrant plugin install vagrant-berkshelf
|
||||||
gem install berkshelf
|
gem install berkshelf
|
||||||
|
|
||||||
|
To test the OmniOS platform, you need to install the omnios vagrant
|
||||||
|
plugin
|
||||||
|
|
||||||
|
vagrant plugin install vagrant-guest-omnios
|
||||||
|
|
||||||
Install Test Kitchen and its Vagrant driver.
|
Install Test Kitchen and its Vagrant driver.
|
||||||
|
|
||||||
bundle install
|
bundle install
|
||||||
|
@ -27,7 +27,7 @@ describe 'postfix::default' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
context 'configures' do
|
context 'configures' do
|
||||||
describe file('/etc/postfix/main.cf') do
|
describe file("#{postfix_conf_path}/main.cf") do
|
||||||
its(:content) { should match(/^# Generated by Chef for /) }
|
its(:content) { should match(/^# Generated by Chef for /) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -2,3 +2,26 @@ require 'serverspec'
|
|||||||
|
|
||||||
set :backend, :exec
|
set :backend, :exec
|
||||||
set :path, '/sbin:/usr/local/sbin:$PATH'
|
set :path, '/sbin:/usr/local/sbin:$PATH'
|
||||||
|
|
||||||
|
def get_family
|
||||||
|
fam = 'solaris2'
|
||||||
|
return fam unless File.exist? '/etc/release'
|
||||||
|
File.open("/etc/release") do |file|
|
||||||
|
while line = file.gets
|
||||||
|
case line
|
||||||
|
when /^\s*(OmniOS)/
|
||||||
|
fam = 'omnios'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
fam
|
||||||
|
end
|
||||||
|
|
||||||
|
def postfix_conf_path
|
||||||
|
if os[:family] == 'solaris' && get_family == 'omnios'
|
||||||
|
'/opt/omni/etc/postfix/'
|
||||||
|
else
|
||||||
|
'/etc/postfix'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user