The testenv.sh backs up and restores /etc/cgrules.conf. But when there is
no /etc/cgrules.conf when the test starts, the file is not removed when the
test ends.

Changelog:
  - redirected 'rm' output to /dev/null

Signed-off-by: Jan Safranek <jsafr...@redhat.com>
---

 tests/tools/testenv.sh.in |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/tests/tools/testenv.sh.in b/tests/tools/testenv.sh.in
index 0f8a7d6..6c2e33d 100644
--- a/tests/tools/testenv.sh.in
+++ b/tests/tools/testenv.sh.in
@@ -22,7 +22,11 @@ function die()
 {
        echo $*
        cgclear
-       mv $TMP/cgrules-backup.conf /etc/cgrules.conf &>/dev/null
+       if [ -e $TMP/cgrules-backup.conf ]; then
+               mv $TMP/cgrules-backup.conf /etc/cgrules.conf &>/dev/null
+       else
+               rm /etc/cgrules.conf &>/dev/null
+       fi
        rm -rf $TMP
        unset TMP
        exit 1
@@ -43,7 +47,11 @@ function cleanup()
                RET=1
                cgclear
        fi
-       mv $TMP/cgrules-backup.conf /etc/cgrules.conf &>/dev/null
+       if [ -e $TMP/cgrules-backup.conf ]; then
+               mv $TMP/cgrules-backup.conf /etc/cgrules.conf &>/dev/null
+       else
+               rm /etc/cgrules.conf &>/dev/null
+       fi
        rm -rf $TMP
        unset TMP
        [ -z $RET ] || exit $RET
@@ -73,4 +81,4 @@ export TOOLSDIR="@abs_top_srcdir@/libtool --mode=execute 
@abs_top_srcdir@/src/to
 # config files directory
 export CONFIGDIR="@abs_top_srcdir@/samples"
 # test directory
-export TESTDIR="@abs_top_srcdir@/tests"
\ No newline at end of file
+export TESTDIR="@abs_top_srcdir@/tests"


------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to