summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2018-01-17 13:51:36 -0800
committerGitHub <noreply@github.com>2018-01-17 13:51:36 -0800
commit36041e110eb21fe1f930f7f2ca1a962dab985746 (patch)
tree562b1dfaffb5d5e597d193ea7e389cf5ae4ecdde
parente32be48e2ddd4bef2bad482687264f7cd8567b68 (diff)
parentde1f572fc441143244792afd6575111cb9ec48cf (diff)
downloadchef-36041e110eb21fe1f930f7f2ca1a962dab985746.tar.gz
Merge pull request #6748 from chef/lcg/hardocde-tmpdir-aix-spec
use TMPDIR correctly in initscript
-rwxr-xr-xspec/functional/assets/chefinittest10
-rw-r--r--spec/functional/resource/bff_spec.rb6
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