From: Garrett C. <yab...@us...> - 2010-01-31 22:46:23
|
Update of /cvsroot/ltp/ltp/testcases/commands/at In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv10202/testcases/commands/at Modified Files: at_allow01 Log Message: 1. Correct some style notes. 2. Add a check for the at command. 3. Parameterize $TMP. Signed-off-by: Garrett Cooper <yan...@gm...> Index: at_allow01 =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/commands/at/at_allow01,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** at_allow01 23 Aug 2009 06:31:45 -0000 1.4 --- at_allow01 31 Jan 2010 22:46:15 -0000 1.5 *************** *** 28,31 **** --- 28,32 ---- # + TMP=${TMP:=/tmp} allow="/etc/at.allow" test_user1="test_user_1" *************** *** 33,37 **** test_user2_home="/home/${test_user2}" test_user1_home="/home/${test_user1}" ! tmpfile="/tmp/at_allow_test" #----------------------------------------------------------------------- --- 34,38 ---- test_user2_home="/home/${test_user2}" test_user1_home="/home/${test_user1}" ! tmpfile="$TMP/at_allow_test" #----------------------------------------------------------------------- *************** *** 51,56 **** # Create the 1st user. ! useradd -g users -d "${test_user1_home}" -m "${test_user1}" ! if [ $? != 0 ]; then echo "Could not add test user ${test_user1} to system." exit 1 --- 52,56 ---- # Create the 1st user. ! if ! useradd -g users -d "${test_user1_home}" -m "${test_user1}"; then echo "Could not add test user ${test_user1} to system." exit 1 *************** *** 58,63 **** # Create the 2nd user. ! useradd -g users -d "${test_user2_home}" -m "${test_user2}" ! if [ $? != 0 ]; then echo "Could not add test user ${test_user2} to system." exit 1 --- 58,62 ---- # Create the 2nd user. ! if ! useradd -g users -d "${test_user2_home}" -m "${test_user2}"; then echo "Could not add test user ${test_user2} to system." exit 1 *************** *** 149,153 **** # FUNCTION: main #----------------------------------------------------------------------- ! if [ $(whoami) = "root" ]; then do_setup echo "${test_user1}" >"${allow}" --- 148,154 ---- # FUNCTION: main #----------------------------------------------------------------------- ! if type at > /dev/null; then ! tst_resm TCONF "at command not found on system" ! elif [ "$(id -ru)" = 0 ]; then do_setup echo "${test_user1}" >"${allow}" |