diff --git a/test/integration/cookbooks/test/recipes/default.rb b/test/integration/cookbooks/test/recipes/default.rb index 1e2cff84..917ecdf6 100644 --- a/test/integration/cookbooks/test/recipes/default.rb +++ b/test/integration/cookbooks/test/recipes/default.rb @@ -9,38 +9,7 @@ # Finally (for now), it actually executes the all tests with # the local execution backend -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 - -link '/tmp/symlink'do - to '/tmp/file' - owner 'root' - group gid - mode '0777' -end - -execute 'create pipe/fifo' do - command 'mkfifo /tmp/pipe' - not_if 'test -e /tmp/pipe' -end - -execute 'create block_device' do - command "mknod /tmp/block_device b 7 7 && chmod 0666 /tmp/block_device && chown root:#{gid} /tmp/block_device" - not_if 'test -e /tmp/block_device' -end +include_recipe('test::prep_files') # prepare ssh for backend execute 'create ssh key' do @@ -78,7 +47,7 @@ # execute tests execute 'bundle install' do - command '/opt/chef/embedded/bin/bundle install' + command '/opt/chef/embedded/bin/bundle install --without integration tools' cwd '/tmp/kitchen/data' end diff --git a/test/integration/cookbooks/test/recipes/prep_files.rb b/test/integration/cookbooks/test/recipes/prep_files.rb new file mode 100644 index 00000000..dd740233 --- /dev/null +++ b/test/integration/cookbooks/test/recipes/prep_files.rb @@ -0,0 +1,40 @@ +# encoding: utf-8 +# author: Dominik Richter +# author: Christoph Hartmann +# +# Helper recipe to create create a few files in the operating +# systems, which the runner will test against. + +gid = 'root' +gid = 'wheel' if node['platform_family'] == 'freebsd' +gid = 'system' if node['platform_family'] == 'aix' + +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 + +link '/tmp/symlink'do + to '/tmp/file' + owner 'root' + group gid + mode '0777' +end + +execute 'create pipe/fifo' do + command 'mkfifo /tmp/pipe' + not_if 'test -e /tmp/pipe' +end + +execute 'create block_device' do + command "mknod /tmp/block_device b 7 7 && chmod 0666 /tmp/block_device && chown root:#{gid} /tmp/block_device" + not_if 'test -e /tmp/block_device' +end