[LTP] [PATCH] mc_cmds: Set TCID and TST_-variables and use TMPDIR

Stanislav Kholmanskikh
2014-02-10T09:45:43Z

Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
---
testcases/network/multicast/mc_cmds/mc_cmds | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/testcases/network/multicast/mc_cmds/mc_cmds b/testcases/network/multicast/mc_cmds/mc_cmds
index 180e93f..54fc69c 100755
--- a/testcases/network/multicast/mc_cmds/mc_cmds
+++ b/testcases/network/multicast/mc_cmds/mc_cmds
@@ -35,9 +35,20 @@
$trace_logic

TC=mc_cmds
-PING_OUT=/tmp/${TC}_out
+TCtmp=${TCtmp:-$TMPDIR/$TC$$}
+PING_OUT=${TCtmp}/PING_OUT
HOSTNAME=`hostname`
CLEANUP=${CLEANUP:-ON}
+
+export TCID=$TC
+export TST_TOTAL=1
+export TST_COUNT=1
+
+setup()
+{
+ mkdir -p $TCtmp || { tst_brkm TBROK NULL "Could not create $TCtmp"; exit 1; }
+}
+
#*******************************************************************************
#
# FUNCTION: do_test
@@ -119,6 +130,7 @@ for eth in $IFNAME
if [ $? -eq 0 ]
then
tst_resm TCONF "Multicast ping disabled on this system (this is normal on post year:2005 kernels)"
+ rm -rf $TCtmp
exit 0
fi

@@ -158,7 +170,7 @@ do_cleanup()
{
$trace_logic
echo "$this_file: doing $0."
- rm -rf $PING_OUT
+ rm -rf $TCtmp
}

#=============================================================================
@@ -193,5 +205,6 @@ end_testcase()
# OUTPUT: Logged run results written to testcase run log
#
#*******************************************************************************
+setup
do_test
end_testcase
--
1.7.1

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net