[Pkg-shadow-commits] r1693 - debian/trunk/tests/su/01

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Sun Jan 6 20:16:25 UTC 2008


Author: nekral-guest
Date: 2008-01-06 20:16:25 +0000 (Sun, 06 Jan 2008)
New Revision: 1693

Modified:
   debian/trunk/tests/su/01/su_root.test
   debian/trunk/tests/su/01/su_user.test
Log:
Updated tests to the new infrastructure.


Modified: debian/trunk/tests/su/01/su_root.test
===================================================================
--- debian/trunk/tests/su/01/su_root.test	2008-01-06 20:02:39 UTC (rev 1692)
+++ debian/trunk/tests/su/01/su_root.test	2008-01-06 20:16:25 UTC (rev 1693)
@@ -4,41 +4,22 @@
 
 cd $(dirname $0)
 
-# Rational:
-# Test that su can be used to switch to root and to a normal account
+. ../../common/config.sh
+. ../../common/log.sh
 
-# no testsuite password
-# root password: rootF00barbaz
-# myuser password: myuserF00barbaz
+log_start "$0" "su can be used to switch to root"
 
-save()
-{
-	[ ! -d tmp ] && mkdir tmp
-	for i in passwd group shadow gshadow
-	do
-		[ -f /etc/$i  ] && cp /etc/$i  tmp/$i
-	done
 
-	true
-}
+save_config
 
-restore()
-{
-	for i in passwd group shadow gshadow
-	do
-		[ -f tmp/$i  ] && cp tmp/$i  /etc/$i  && rm tmp/$i
-	done
-	rmdir tmp
-}
-
-save
-
 # restore the files on exit
-trap 'restore' 0
+trap 'log_status "$0" "FAILURE"; restore_config' 0
 
-cp data/{passwd,shadow,group,gshadow} /etc/
+change_config
 
-./run_su root rootF00barbaz '# '
+./run_su.exp root rootF00barbaz '# '
 
-./run_su myuser myuserF00barbaz '$ '
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
 

Modified: debian/trunk/tests/su/01/su_user.test
===================================================================
--- debian/trunk/tests/su/01/su_user.test	2008-01-06 20:02:39 UTC (rev 1692)
+++ debian/trunk/tests/su/01/su_user.test	2008-01-06 20:16:25 UTC (rev 1693)
@@ -4,41 +4,22 @@
 
 cd $(dirname $0)
 
-# Rational:
-# Test that su can be used to switch to root and to a normal account
+. ../../common/config.sh
+. ../../common/log.sh
 
-# no testsuite password
-# root password: rootF00barbaz
-# myuser password: myuserF00barbaz
+log_start "$0" "su can be used to switch to a non-root user"
 
-save()
-{
-	[ ! -d tmp ] && mkdir tmp
-	for i in passwd group shadow gshadow
-	do
-		[ -f /etc/$i  ] && cp /etc/$i  tmp/$i
-	done
 
-	true
-}
+save_config
 
-restore()
-{
-	for i in passwd group shadow gshadow
-	do
-		[ -f tmp/$i  ] && cp tmp/$i  /etc/$i  && rm tmp/$i
-	done
-	rmdir tmp
-}
-
-save
-
 # restore the files on exit
-trap 'restore' 0
+trap 'log_status "$0" "FAILURE"; restore_config' 0
 
-cp data/{passwd,shadow,group,gshadow} /etc/
+change_config
 
-./run_su root rootF00barbaz '# '
+./run_su.exp myuser myuserF00barbaz '$ '
 
-./run_su myuser myuserF00barbaz '$ '
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
 




More information about the Pkg-shadow-commits mailing list