I've prepared a patch for at_allow01 that essentially duplicates the
fixes that were checked in for at_deny01. This fixes the script to
actually run the test when the at utility in stead of returning TCONF,
correcting test environment, and let the script run normally without
changing the password. See commit
a589d12b0b49287d10f43b1a1fb72950819588eb for more details.

Signed-off-by: Henry Yei <[email protected]>

Henry Yei <[email protected]>
--- ltp-dev/testcases/commands/at/at_allow01	2010-04-30 15:33:10.000000000 -0700
+++ ltp-dev-wdir/testcases/commands/at/at_allow01	2010-08-26 19:38:05.960440401 -0700
@@ -73,6 +73,12 @@ do_setup()
 	# users' home directories, and run it from there.
 	cp "$0" "${test_user1_home}/."
 	cp "$0" "${test_user2_home}/."
+	echo "export LTPROOT='$LTPROOT'" > "${test_user1_home}/cached_ltproot"
+	echo "export LTPROOT='$LTPROOT'" > "${test_user2_home}/cached_ltproot"
+	if [ $? -ne 0 ]; then
+		tst_resm TBROK "Couldn't copy over req'd files for test users"
+		exit 1
+	fi	
 
 	# Restart atd daemon.
 	/etc/init.d/atd restart
@@ -98,7 +104,10 @@ do_cleanup()
 #-----------------------------------------------------------------------
 run_test()
 {
-	if [ $(whoami) = "${test_user1}" ]; then 
+	if [ $(whoami) = "${test_user1}" ]; then
+		. "${test_user1_home}/cached_ltproot" || exit 1
+		export PATH="$PATH:$LTPROOT/testcases/bin"
+
 		echo "TEST: $allow should allow only those who in the file to run jobs."
 		echo "(1) TEST THAT PERSON IN ${allow} IS ABLE TO RUN JOB."
 		echo "echo 'TEST JOB RAN' >>\"${tmpfile}\" 2>&1" |
@@ -121,6 +130,10 @@ run_test()
 		exit ${exit_code}
 
 	elif [ $(whoami) = "${test_user2}" ]; then
+
+		. "${test_user2_home}/cached_ltproot" || exit 1
+		export PATH="$PATH:$LTPROOT/testcases/bin"
+
 		echo "(2) TEST PERSON THAT IS NOT IN ${allow} IS NOT ABLE TO RUN JOB."
 		echo "echo 'TEST JOB RAN' >>\"${tmpfile}\" 2>&1" |
 		if ! at -m now + 1 minutes; then
@@ -145,7 +158,7 @@ run_test()
 #-----------------------------------------------------------------------
 # FUNCTION: main
 #-----------------------------------------------------------------------
-if type at > /dev/null; then
+if ! type at > /dev/null; then
 	tst_resm TCONF "at command not found on system"
 elif [ "$(id -ru)" = 0 ]; then
 	if do_setup; then
------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to