From 6a21c819e77a7e1cfdd081b24c3521129f9388bd Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Tue, 24 Apr 2012 17:17:59 +1000 Subject: tests/eventscripts: Be more defensive about removing the var directory Could add -r but that might avoid error. The only time it doesn't exist is the 1st time a top-level var directory is used. Signed-off-by: Martin Schwenke (This used to be ctdb commit 047d97dc84a5943556efb31bb2856fd04835fffa) --- ctdb/tests/eventscripts/scripts/local.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ctdb/tests/eventscripts/scripts/local.sh b/ctdb/tests/eventscripts/scripts/local.sh index 25003052a0..c31e9fae26 100644 --- a/ctdb/tests/eventscripts/scripts/local.sh +++ b/ctdb/tests/eventscripts/scripts/local.sh @@ -55,7 +55,8 @@ EOF fi export EVENTSCRIPTS_TESTS_VAR_DIR="${TEST_VAR_DIR}/unit_eventscripts" -if [ "$EVENTSCRIPTS_TESTS_VAR_DIR" != "/unit_eventscripts" ] ; then +if [ -d "$EVENTSCRIPTS_TESTS_VAR_DIR" -a \ + "$EVENTSCRIPTS_TESTS_VAR_DIR" != "/unit_eventscripts" ] ; then rm -r "$EVENTSCRIPTS_TESTS_VAR_DIR" fi mkdir -p "$EVENTSCRIPTS_TESTS_VAR_DIR" -- cgit