summaryrefslogtreecommitdiff
path: root/ci/verify-chef.sh
diff options
context:
space:
mode:
authorJohn Keiser <john@johnkeiser.com>2016-02-10 14:17:58 -0800
committerJohn Keiser <john@johnkeiser.com>2016-02-10 15:07:12 -0800
commitcd96a4a386e7da079061b60923b98abc7f8e74f5 (patch)
treece8c5f2dc0a41db2cd3c8e71a9bcdd495ee34e3d /ci/verify-chef.sh
parent919aaa7b2669875b79335f80778633c844bf4fa5 (diff)
downloadchef-cd96a4a386e7da079061b60923b98abc7f8e74f5.tar.gz
Create special tempdir and destroy it on each ci run
Diffstat (limited to 'ci/verify-chef.sh')
-rwxr-xr-xci/verify-chef.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/ci/verify-chef.sh b/ci/verify-chef.sh
index 0c8ca768f7..117bf6b642 100755
--- a/ci/verify-chef.sh
+++ b/ci/verify-chef.sh
@@ -1,5 +1,11 @@
#!/bin/sh
+# Set up a custom tmpdir, and clean it up before and after the tests
+TMPDIR="${TMPDIR:-/tmp}/cheftest"
+export TMPDIR
+rm -rf $TMPDIR
+mkdir -p $TMPDIR
+
# $PROJECT_NAME is set by Jenkins, this allows us to use the same script to verify
# Chef and Angry Chef
PATH=/opt/$PROJECT_NAME/bin:$PATH
@@ -107,3 +113,6 @@ else
fi
sudo env PATH=$PATH TERM=xterm CHEF_FIPS=$CHEF_FIPS bundle exec rspec -r rspec_junit_formatter -f RspecJunitFormatter -o $WORKSPACE/test.xml -f documentation spec/functional spec/unit
fi
+
+# Clean up the tmpdir at the end for good measure.
+rm -rf $TMPDIR