diff options
-rwxr-xr-x | spec/functional/assets/chefinittest | 10 | ||||
-rw-r--r-- | spec/functional/resource/bff_spec.rb | 6 |
2 files changed, 9 insertions, 7 deletions
diff --git a/spec/functional/assets/chefinittest b/spec/functional/assets/chefinittest index 79e064cd5f..b67abbfa43 100755 --- a/spec/functional/assets/chefinittest +++ b/spec/functional/assets/chefinittest @@ -1,15 +1,17 @@ #!/bin/ksh +TMPDIR="${TMPDIR:-/tmp}" + function create_chef_txt { - touch /tmp/chefinittest.txt + touch $TMPDIR/chefinittest.txt } function delete_chef_txt { - rm /tmp/chefinittest.txt + rm $TMPDIR/chefinittest.txt } function rename_chef_txt { - mv /tmp/chefinittest.txt /tmp/$1 + mv $TMPDIR/chefinittest.txt $TMPDIR/$1 } case "$1" in @@ -20,7 +22,7 @@ stop ) delete_chef_txt ;; status ) - [ -f /tmp/chefinittest.txt ] || [ -f /tmp/chefinittest_reload.txt ] || [ -f /tmp/chefinittest_restart.txt ] + [ -f $TMPDIR/chefinittest.txt ] || [ -f $TMPDIR/chefinittest_reload.txt ] || [ -f $TMPDIR/chefinittest_restart.txt ] ;; reload ) rename_chef_txt "chefinittest_reload.txt" diff --git a/spec/functional/resource/bff_spec.rb b/spec/functional/resource/bff_spec.rb index e7f7540e5a..0b45e097af 100644 --- a/spec/functional/resource/bff_spec.rb +++ b/spec/functional/resource/bff_spec.rb @@ -1,6 +1,6 @@ # # Author:: Prabhu Das (<prabhu.das@clogeny.com>) -# Copyright:: Copyright 2013-2016, Chef Software Inc. +# Copyright:: Copyright 2013-2017, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -62,7 +62,7 @@ describe Chef::Resource::BffPackage, :requires_root, :external => ohai[:platform context "package install action with options" do it "should install a package" do - new_resource.options("-e/tmp/installp.log") + new_resource.options("-e#{Dir.tmpdir}/installp.log") new_resource.run_action(:install) bff_pkg_should_be_installed(new_resource) end @@ -108,7 +108,7 @@ describe Chef::Resource::BffPackage, :requires_root, :external => ohai[:platform end it "should remove an installed package" do - new_resource.options("-e/tmp/installp.log") + new_resource.options("-e#{Dir.tmpdir}/installp.log") new_resource.run_action(:remove) bff_pkg_should_be_removed(new_resource) end |