Use a saner variant for computing the number of groups in cpuctl tests
[ltp-debian.git] / testscripts / test_containers.sh
blobb6aae52b63547bb90aea742dfa9ff14648cde781
1 #!/bin/bash
3 # Copyright 2007 IBM
5 # This program is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by the Free
7 # Software Foundation; either version 2 of the License, or (at your option)
8 # any later version.
10 # test_containers.sh - Run the containers test suite.
12 # Must be root to run the containers testsuite
13 if [ $UID != 0 ]
14 then
15 echo "FAILED: Must be root to execute this script"
16 exit 1
19 # set the LTPROOT directory
20 cd `dirname $0`
21 LTPROOT=${PWD}
22 echo $LTPROOT | grep testscripts > /dev/null 2>&1
23 if [ $? -eq 0 ]
24 then
25 cd ..
26 LTPROOT=${PWD}
29 # set the PATH to include testcase/bin
31 export PATH=$PATH:/usr/sbin:$LTPROOT/testcases/bin
32 export LTPBIN=$LTPROOT/testcases/bin
34 # We will store the logfiles in $LTPROOT/results, so make sure
35 # it exists.
36 if [ ! -d $LTPROOT/results ]
37 then
38 mkdir $LTPROOT/results
41 # Check the role and mode testsuite is being executed under.
42 echo "Running the containers testsuite..."
44 $LTPROOT/pan/ltp-pan -S -a $LTPROOT/results/containers -n ltp-containers -l $LTPROOT/results/containers.logfile -o $LTPROOT/results/containers.outfile -p -f $LTPROOT/runtest/containers
46 echo "Done."
47 exit 0