Skip to content

Commit

Permalink
Fix up OmniOS tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Thom May committed Jun 23, 2015
1 parent d696316 commit aebec52
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .kitchen.yml
Expand Up @@ -17,10 +17,10 @@ platforms:

- name: centos-6.5
- name: centos-5.10
- name: omnios-r151006c
- name: omnios-r151014
driver:
box: omnios-r151006c
box_url: http://omnios.omniti.com/media/OmniOS_Text_r151006c.iso
box: omnios-r151014
box_url: http://omnios.omniti.com/media/omnios-r151014.box
run_list:
- recipe[fake::omnios]

Expand Down
5 changes: 5 additions & 0 deletions TESTING.md
Expand Up @@ -11,6 +11,11 @@ Install the berkshelf plugin for vagrant, and berkshelf to your local Ruby envir
vagrant plugin install vagrant-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.

bundle install
Expand Down
2 changes: 1 addition & 1 deletion test/integration/default/serverspec/default_spec.rb
Expand Up @@ -27,7 +27,7 @@
end

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 /) }
end
end
Expand Down
23 changes: 23 additions & 0 deletions test/integration/helpers/serverspec/spec_helper.rb
Expand Up @@ -2,3 +2,26 @@

set :backend, :exec
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

0 comments on commit aebec52

Please sign in to comment.