[Pkg-shadow-commits] r3259 - in debian/trunk/tests/usertools/13_usermod_move_homedir_file: . data

Nicolas FRANÇOIS nekral-guest at alioth.debian.org
Fri Aug 27 17:58:36 UTC 2010


Author: nekral-guest
Date: 2010-08-27 17:58:24 +0000 (Fri, 27 Aug 2010)
New Revision: 3259

Added:
   debian/trunk/tests/usertools/13_usermod_move_homedir_file/data/usermod.err
Removed:
   debian/trunk/tests/usertools/13_usermod_move_homedir_file/data/home_ls-a
Modified:
   debian/trunk/tests/usertools/13_usermod_move_homedir_file/usermod.test
Log:
Behavior of usermod was improved regarding (re)moving the old homedir.


Deleted: debian/trunk/tests/usertools/13_usermod_move_homedir_file/data/home_ls-a
===================================================================
--- debian/trunk/tests/usertools/13_usermod_move_homedir_file/data/home_ls-a	2010-08-27 17:57:42 UTC (rev 3258)
+++ debian/trunk/tests/usertools/13_usermod_move_homedir_file/data/home_ls-a	2010-08-27 17:58:24 UTC (rev 3259)
@@ -1,3 +0,0 @@
--rw-r--r-- foo:foo `/home/foo2/toto'
-drwxr-xr-x foo:foo `/home/foo2/.'
-drwxr-xr-x root:root `/home/foo2/..'

Added: debian/trunk/tests/usertools/13_usermod_move_homedir_file/data/usermod.err
===================================================================
--- debian/trunk/tests/usertools/13_usermod_move_homedir_file/data/usermod.err	                        (rev 0)
+++ debian/trunk/tests/usertools/13_usermod_move_homedir_file/data/usermod.err	2010-08-27 17:58:24 UTC (rev 3259)
@@ -0,0 +1 @@
+usermod: The previous home directory (/home/foo) was not a directory. It is not removed and no home directories are created.

Modified: debian/trunk/tests/usertools/13_usermod_move_homedir_file/usermod.test
===================================================================
--- debian/trunk/tests/usertools/13_usermod_move_homedir_file/usermod.test	2010-08-27 17:57:42 UTC (rev 3258)
+++ debian/trunk/tests/usertools/13_usermod_move_homedir_file/usermod.test	2010-08-27 17:58:24 UTC (rev 3259)
@@ -20,9 +20,26 @@
 touch /home/foo
 
 echo -n "Change the user's home directory (usermod -m -d /home/foo2 foo)..."
-usermod -m -d /home/foo2 foo
+usermod -m -d /home/foo2 foo 2>tmp/usermod.err && exit 1 || {
+	status=$?
+}
 echo "OK"
 
+echo -n "Check returned status ($status)..."
+test "$status" = "12"
+echo "OK"
+
+echo "usermod reported:"
+echo "======================================================================="
+cat tmp/usermod.err
+echo "======================================================================="
+echo -n "Check that there were a failure message..."
+diff -au data/usermod.err tmp/usermod.err
+echo "error message OK."
+rm -f tmp/usermod.err
+
+echo "OK"
+
 echo -n "Check the passwd file..."
 ../../common/compare_file.pl data/passwd /etc/passwd
 echo "OK"
@@ -38,17 +55,9 @@
 echo -n "Check /home/foo was not removed..."
 test -f /home/foo
 echo "OK"
-ls /home
-echo -n "Check the user's home directory was moved..."
-test -d /home/foo2
+echo -n "Check the user's home directory was not created..."
+test ! -e /home/foo2
 echo "OK"
-echo -n "Check content of /home/foo2/..."
-stat --printf "%A %U:%G %N\n" /home/foo2/* /home/foo2/.* 2>/dev/null | sort > tmp/home_ls-a
-diff -rauN data/home_ls-a tmp/home_ls-a
-echo "OK"
-echo -n "Remove the new home directory..."
-rm -rf /home/foo2
-echo "done"
 
 rm -f /home/foo
 




More information about the Pkg-shadow-commits mailing list