bugfix: run integration tests on windows

This commit is contained in:
Christoph Hartmann 2015-11-17 22:14:05 +01:00
parent 98d27dda02
commit 8a85e68695
3 changed files with 48 additions and 22 deletions

View file

@ -4,18 +4,22 @@
#
# prepares a sample file for verification
gid = 'root'
gid = 'wheel' if node['platform_family'] == 'freebsd'
if node['platform_family'] != 'windows'
file '/tmp/file' do
mode '0765'
owner 'root'
group gid
content 'hello world'
end
gid = 'root'
gid = 'wheel' if node['platform_family'] == 'freebsd'
file '/tmp/file' do
mode '0765'
owner 'root'
group gid
content 'hello world'
end
directory '/tmp/folder' do
mode '0567'
owner 'root'
group gid
end
directory '/tmp/folder' do
mode '0567'
owner 'root'
group gid
end

View file

@ -9,10 +9,14 @@ elsif ['debian'].include?(os[:family])
# Debian
unavailable_service = 'clamav'
available_service = 'ssh'
else
elsif ['ubuntu'].include?(os[:family])
# Ubuntu
unavailable_service = 'sshd'
available_service = 'ssh'
elsif ['windows'].include?(os[:family])
# Ubuntu
unavailable_service = 'sshd'
available_service = 'dhcp'
end
describe service(unavailable_service) do

View file

@ -28,17 +28,35 @@ elsif ['freebsd'].include?(os[:family])
shell: '/bin/csh',
}
elsif ['windows'].include?(os[:family])
userinfo = {
name: 'Administrator',
group: nil,
uid: nil,
gid: nil,
groups: nil,
home: nil,
shell: nil,
}
else
userinfo = {}
end
describe user(userinfo[:name]) do
it { should exist }
it { should belong_to_group userinfo[:group] }
its('uid') { should eq userinfo[:uid] }
its('gid') { should eq userinfo[:gid] }
its('group') { should eq userinfo[:group] }
its('groups') { should eq userinfo[:groups] }
its('home') { should eq userinfo[:home] }
its('shell') { should eq userinfo[:shell] }
if !os.windows?
describe user(userinfo[:name]) do
it { should exist }
it { should belong_to_group userinfo[:group] }
its('uid') { should eq userinfo[:uid] }
its('gid') { should eq userinfo[:gid] }
its('group') { should eq userinfo[:group] }
its('groups') { should eq userinfo[:groups] }
its('home') { should eq userinfo[:home] }
its('shell') { should eq userinfo[:shell] }
end
else
describe user(userinfo[:name]) do
it { should exist }
end
end