On 03/14/2011 05:24 PM, Jan Safranek wrote: > 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. > > 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..07ee1f7 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 If this file does not exist (eg in cgclassify test when libcgroup is not installed), this command cause an error message on output > + 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 If this file does not exist (eg in cgclassify test when libcgroup is not installed), this command cause an error message on output > + 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" > > > ------------------------------------------------------------------------------ > Colocation vs. Managed Hosting > A question and answer guide to determining the best fit > for your organization - today and in the future. > http://p.sf.net/sfu/internap-sfd2d > _______________________________________________ > Libcg-devel mailing list > Libcg-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/libcg-devel
------------------------------------------------------------------------------ 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