[Pkg-shadow-commits] r1709 - in debian/trunk/tests/usertools/01: . 01_useradd_add_user 02_useradd_recreate_deleted_user 03_useradd_additional_options 04_useradd_add_user_with_existing_UID_fail 04_useradd_add_user_with_existing_UID_with_-o 04_useradd_specified_UID 04_useradd_specified_UID_and_GID 04_userdel_delete_user_with_non_unique_UID 05_useradd_invalid_numeric_primary_group 06_useradd_invalid_named_primary_group 07_useradd_numerical_primary_group 08_useradd_named_primary_group 09_usermod_change_user_info 10_usermod_rename_user 10_usermod_rename_user_in_group 11_usermod_change_password 11_usermod_lock_password 11_usermod_unlock_empty_password 11_usermod_unlock_password 12_usermod_change_gid_name 12_usermod_change_gid_number 13_useradd_negative_UID 14_useradd_out_of_range_UID 15_useradd_specified_large_UID 16_useradd_add_user_to_multiple_groups 16_useradd_add_user_to_one_group 17_useradd_create_homedir 18_userdel_remove_homedir 22_usermod_new_groups 23_usermod_add_groups 24_usermod_new_groups_remove_old_groups

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Sat Jan 12 15:10:59 UTC 2008


Author: nekral-guest
Date: 2008-01-12 15:10:58 +0000 (Sat, 12 Jan 2008)
New Revision: 1709

Added:
   debian/trunk/tests/usertools/01/01_useradd_add_user.test
   debian/trunk/tests/usertools/01/01_useradd_add_user/
   debian/trunk/tests/usertools/01/01_useradd_add_user/group
   debian/trunk/tests/usertools/01/01_useradd_add_user/gshadow
   debian/trunk/tests/usertools/01/01_useradd_add_user/passwd
   debian/trunk/tests/usertools/01/01_useradd_add_user/shadow
   debian/trunk/tests/usertools/01/01_userdel_delete_user.test
   debian/trunk/tests/usertools/01/02_useradd_recreate_deleted_user.test
   debian/trunk/tests/usertools/01/02_useradd_recreate_deleted_user/
   debian/trunk/tests/usertools/01/02_useradd_recreate_deleted_user/group
   debian/trunk/tests/usertools/01/02_useradd_recreate_deleted_user/gshadow
   debian/trunk/tests/usertools/01/02_useradd_recreate_deleted_user/passwd
   debian/trunk/tests/usertools/01/02_useradd_recreate_deleted_user/shadow
   debian/trunk/tests/usertools/01/03_useradd_additional_options.test
   debian/trunk/tests/usertools/01/03_useradd_additional_options/
   debian/trunk/tests/usertools/01/03_useradd_additional_options/group
   debian/trunk/tests/usertools/01/03_useradd_additional_options/gshadow
   debian/trunk/tests/usertools/01/03_useradd_additional_options/passwd
   debian/trunk/tests/usertools/01/03_useradd_additional_options/shadow
   debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_fail.test
   debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_fail/
   debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_fail/group
   debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_fail/gshadow
   debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_fail/passwd
   debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_fail/shadow
   debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_fail/useradd.err
   debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_with_-o.test
   debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_with_-o/
   debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_with_-o/group
   debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_with_-o/gshadow
   debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_with_-o/passwd
   debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_with_-o/shadow
   debian/trunk/tests/usertools/01/04_useradd_specified_UID.test
   debian/trunk/tests/usertools/01/04_useradd_specified_UID/
   debian/trunk/tests/usertools/01/04_useradd_specified_UID/group
   debian/trunk/tests/usertools/01/04_useradd_specified_UID/gshadow
   debian/trunk/tests/usertools/01/04_useradd_specified_UID/passwd
   debian/trunk/tests/usertools/01/04_useradd_specified_UID/shadow
   debian/trunk/tests/usertools/01/04_useradd_specified_UID_and_GID.test
   debian/trunk/tests/usertools/01/04_useradd_specified_UID_and_GID/
   debian/trunk/tests/usertools/01/04_useradd_specified_UID_and_GID/group
   debian/trunk/tests/usertools/01/04_useradd_specified_UID_and_GID/gshadow
   debian/trunk/tests/usertools/01/04_useradd_specified_UID_and_GID/passwd
   debian/trunk/tests/usertools/01/04_useradd_specified_UID_and_GID/shadow
   debian/trunk/tests/usertools/01/04_userdel_delete_user_with_non_unique_UID.test
   debian/trunk/tests/usertools/01/04_userdel_delete_user_with_non_unique_UID/
   debian/trunk/tests/usertools/01/04_userdel_delete_user_with_non_unique_UID/group
   debian/trunk/tests/usertools/01/04_userdel_delete_user_with_non_unique_UID/gshadow
   debian/trunk/tests/usertools/01/04_userdel_delete_user_with_non_unique_UID/passwd
   debian/trunk/tests/usertools/01/04_userdel_delete_user_with_non_unique_UID/shadow
   debian/trunk/tests/usertools/01/05_useradd_invalid_numeric_primary_group.test
   debian/trunk/tests/usertools/01/05_useradd_invalid_numeric_primary_group/
   debian/trunk/tests/usertools/01/05_useradd_invalid_numeric_primary_group/useradd.err
   debian/trunk/tests/usertools/01/06_useradd_invalid_named_primary_group.test
   debian/trunk/tests/usertools/01/06_useradd_invalid_named_primary_group/
   debian/trunk/tests/usertools/01/06_useradd_invalid_named_primary_group/useradd.err
   debian/trunk/tests/usertools/01/07_useradd_numerical_primary_group.test
   debian/trunk/tests/usertools/01/07_useradd_numerical_primary_group/
   debian/trunk/tests/usertools/01/07_useradd_numerical_primary_group/group
   debian/trunk/tests/usertools/01/07_useradd_numerical_primary_group/gshadow
   debian/trunk/tests/usertools/01/07_useradd_numerical_primary_group/passwd
   debian/trunk/tests/usertools/01/07_useradd_numerical_primary_group/shadow
   debian/trunk/tests/usertools/01/08_useradd_named_primary_group.test
   debian/trunk/tests/usertools/01/08_useradd_named_primary_group/
   debian/trunk/tests/usertools/01/08_useradd_named_primary_group/group
   debian/trunk/tests/usertools/01/08_useradd_named_primary_group/gshadow
   debian/trunk/tests/usertools/01/08_useradd_named_primary_group/passwd
   debian/trunk/tests/usertools/01/08_useradd_named_primary_group/shadow
   debian/trunk/tests/usertools/01/09_usermod_change_user_info.test
   debian/trunk/tests/usertools/01/09_usermod_change_user_info/
   debian/trunk/tests/usertools/01/09_usermod_change_user_info/group
   debian/trunk/tests/usertools/01/09_usermod_change_user_info/gshadow
   debian/trunk/tests/usertools/01/09_usermod_change_user_info/passwd
   debian/trunk/tests/usertools/01/09_usermod_change_user_info/shadow
   debian/trunk/tests/usertools/01/10_usermod_rename_user.test
   debian/trunk/tests/usertools/01/10_usermod_rename_user/
   debian/trunk/tests/usertools/01/10_usermod_rename_user/group
   debian/trunk/tests/usertools/01/10_usermod_rename_user/gshadow
   debian/trunk/tests/usertools/01/10_usermod_rename_user/passwd
   debian/trunk/tests/usertools/01/10_usermod_rename_user/shadow
   debian/trunk/tests/usertools/01/10_usermod_rename_user_in_group.test
   debian/trunk/tests/usertools/01/10_usermod_rename_user_in_group/
   debian/trunk/tests/usertools/01/10_usermod_rename_user_in_group/group
   debian/trunk/tests/usertools/01/10_usermod_rename_user_in_group/gshadow
   debian/trunk/tests/usertools/01/10_usermod_rename_user_in_group/passwd
   debian/trunk/tests/usertools/01/10_usermod_rename_user_in_group/shadow
   debian/trunk/tests/usertools/01/11_usermod_change_password.test
   debian/trunk/tests/usertools/01/11_usermod_change_password/
   debian/trunk/tests/usertools/01/11_usermod_change_password/group
   debian/trunk/tests/usertools/01/11_usermod_change_password/gshadow
   debian/trunk/tests/usertools/01/11_usermod_change_password/passwd
   debian/trunk/tests/usertools/01/11_usermod_change_password/shadow
   debian/trunk/tests/usertools/01/11_usermod_lock_password.test
   debian/trunk/tests/usertools/01/11_usermod_lock_password/
   debian/trunk/tests/usertools/01/11_usermod_lock_password/group
   debian/trunk/tests/usertools/01/11_usermod_lock_password/gshadow
   debian/trunk/tests/usertools/01/11_usermod_lock_password/passwd
   debian/trunk/tests/usertools/01/11_usermod_lock_password/shadow
   debian/trunk/tests/usertools/01/11_usermod_unlock_empty_password.test
   debian/trunk/tests/usertools/01/11_usermod_unlock_empty_password/
   debian/trunk/tests/usertools/01/11_usermod_unlock_empty_password/group
   debian/trunk/tests/usertools/01/11_usermod_unlock_empty_password/gshadow
   debian/trunk/tests/usertools/01/11_usermod_unlock_empty_password/passwd
   debian/trunk/tests/usertools/01/11_usermod_unlock_empty_password/shadow
   debian/trunk/tests/usertools/01/11_usermod_unlock_empty_password/usermod.err
   debian/trunk/tests/usertools/01/11_usermod_unlock_password.test
   debian/trunk/tests/usertools/01/11_usermod_unlock_password/
   debian/trunk/tests/usertools/01/11_usermod_unlock_password/group
   debian/trunk/tests/usertools/01/11_usermod_unlock_password/gshadow
   debian/trunk/tests/usertools/01/11_usermod_unlock_password/passwd
   debian/trunk/tests/usertools/01/11_usermod_unlock_password/shadow
   debian/trunk/tests/usertools/01/12_usermod_change_gid_name.test
   debian/trunk/tests/usertools/01/12_usermod_change_gid_name/
   debian/trunk/tests/usertools/01/12_usermod_change_gid_name/group
   debian/trunk/tests/usertools/01/12_usermod_change_gid_name/gshadow
   debian/trunk/tests/usertools/01/12_usermod_change_gid_name/passwd
   debian/trunk/tests/usertools/01/12_usermod_change_gid_name/shadow
   debian/trunk/tests/usertools/01/12_usermod_change_gid_number.test
   debian/trunk/tests/usertools/01/12_usermod_change_gid_number/
   debian/trunk/tests/usertools/01/12_usermod_change_gid_number/group
   debian/trunk/tests/usertools/01/12_usermod_change_gid_number/gshadow
   debian/trunk/tests/usertools/01/12_usermod_change_gid_number/passwd
   debian/trunk/tests/usertools/01/12_usermod_change_gid_number/shadow
   debian/trunk/tests/usertools/01/13_useradd_negative_UID.test
   debian/trunk/tests/usertools/01/13_useradd_negative_UID/
   debian/trunk/tests/usertools/01/13_useradd_negative_UID/group
   debian/trunk/tests/usertools/01/13_useradd_negative_UID/gshadow
   debian/trunk/tests/usertools/01/13_useradd_negative_UID/passwd
   debian/trunk/tests/usertools/01/13_useradd_negative_UID/shadow
   debian/trunk/tests/usertools/01/14_useradd_out_of_range_UID.test
   debian/trunk/tests/usertools/01/14_useradd_out_of_range_UID/
   debian/trunk/tests/usertools/01/14_useradd_out_of_range_UID/group
   debian/trunk/tests/usertools/01/14_useradd_out_of_range_UID/gshadow
   debian/trunk/tests/usertools/01/14_useradd_out_of_range_UID/passwd
   debian/trunk/tests/usertools/01/14_useradd_out_of_range_UID/shadow
   debian/trunk/tests/usertools/01/15_useradd_specified_large_UID.test
   debian/trunk/tests/usertools/01/15_useradd_specified_large_UID/
   debian/trunk/tests/usertools/01/15_useradd_specified_large_UID/group
   debian/trunk/tests/usertools/01/15_useradd_specified_large_UID/gshadow
   debian/trunk/tests/usertools/01/15_useradd_specified_large_UID/passwd
   debian/trunk/tests/usertools/01/15_useradd_specified_large_UID/shadow
   debian/trunk/tests/usertools/01/16_useradd_add_user_to_multiple_groups.test
   debian/trunk/tests/usertools/01/16_useradd_add_user_to_multiple_groups/
   debian/trunk/tests/usertools/01/16_useradd_add_user_to_multiple_groups/group
   debian/trunk/tests/usertools/01/16_useradd_add_user_to_multiple_groups/gshadow
   debian/trunk/tests/usertools/01/16_useradd_add_user_to_multiple_groups/passwd
   debian/trunk/tests/usertools/01/16_useradd_add_user_to_multiple_groups/shadow
   debian/trunk/tests/usertools/01/16_useradd_add_user_to_one_group.test
   debian/trunk/tests/usertools/01/16_useradd_add_user_to_one_group/
   debian/trunk/tests/usertools/01/16_useradd_add_user_to_one_group/group
   debian/trunk/tests/usertools/01/16_useradd_add_user_to_one_group/gshadow
   debian/trunk/tests/usertools/01/16_useradd_add_user_to_one_group/passwd
   debian/trunk/tests/usertools/01/16_useradd_add_user_to_one_group/shadow
   debian/trunk/tests/usertools/01/17_useradd_create_homedir.test
   debian/trunk/tests/usertools/01/17_useradd_create_homedir/
   debian/trunk/tests/usertools/01/17_useradd_create_homedir/group
   debian/trunk/tests/usertools/01/17_useradd_create_homedir/gshadow
   debian/trunk/tests/usertools/01/17_useradd_create_homedir/passwd
   debian/trunk/tests/usertools/01/17_useradd_create_homedir/shadow
   debian/trunk/tests/usertools/01/18_userdel_remove_homedir.test
   debian/trunk/tests/usertools/01/18_userdel_remove_homedir/
   debian/trunk/tests/usertools/01/18_userdel_remove_homedir/group
   debian/trunk/tests/usertools/01/18_userdel_remove_homedir/gshadow
   debian/trunk/tests/usertools/01/18_userdel_remove_homedir/passwd
   debian/trunk/tests/usertools/01/18_userdel_remove_homedir/shadow
   debian/trunk/tests/usertools/01/19_userdel_delete_user_in_group.test
   debian/trunk/tests/usertools/01/20_usermod_change_homedir.test
   debian/trunk/tests/usertools/01/21_usermod_change_and_move_homedir.test
   debian/trunk/tests/usertools/01/22_usermod_new_groups.test
   debian/trunk/tests/usertools/01/22_usermod_new_groups/
   debian/trunk/tests/usertools/01/22_usermod_new_groups/group
   debian/trunk/tests/usertools/01/22_usermod_new_groups/gshadow
   debian/trunk/tests/usertools/01/22_usermod_new_groups/passwd
   debian/trunk/tests/usertools/01/22_usermod_new_groups/shadow
   debian/trunk/tests/usertools/01/23_usermod_add_groups.test
   debian/trunk/tests/usertools/01/23_usermod_add_groups/
   debian/trunk/tests/usertools/01/23_usermod_add_groups/group
   debian/trunk/tests/usertools/01/23_usermod_add_groups/gshadow
   debian/trunk/tests/usertools/01/23_usermod_add_groups/passwd
   debian/trunk/tests/usertools/01/23_usermod_add_groups/shadow
   debian/trunk/tests/usertools/01/24_usermod_new_groups_remove_old_groups.test
   debian/trunk/tests/usertools/01/24_usermod_new_groups_remove_old_groups/
   debian/trunk/tests/usertools/01/24_usermod_new_groups_remove_old_groups/group
   debian/trunk/tests/usertools/01/24_usermod_new_groups_remove_old_groups/gshadow
   debian/trunk/tests/usertools/01/24_usermod_new_groups_remove_old_groups/passwd
   debian/trunk/tests/usertools/01/24_usermod_new_groups_remove_old_groups/shadow
Removed:
   debian/trunk/tests/usertools/01/run1
   debian/trunk/tests/usertools/01/run10
   debian/trunk/tests/usertools/01/run11
   debian/trunk/tests/usertools/01/run12
   debian/trunk/tests/usertools/01/run13
   debian/trunk/tests/usertools/01/run14
   debian/trunk/tests/usertools/01/run15
   debian/trunk/tests/usertools/01/run2
   debian/trunk/tests/usertools/01/run3
   debian/trunk/tests/usertools/01/run4
   debian/trunk/tests/usertools/01/run5
   debian/trunk/tests/usertools/01/run6
   debian/trunk/tests/usertools/01/run7
   debian/trunk/tests/usertools/01/run8
   debian/trunk/tests/usertools/01/run9
Log:
Switch to the new infrastructure and split the old test in more atomic
tests.


Added: debian/trunk/tests/usertools/01/01_useradd_add_user/group
===================================================================
--- debian/trunk/tests/usertools/01/01_useradd_add_user/group	                        (rev 0)
+++ debian/trunk/tests/usertools/01/01_useradd_add_user/group	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:x:0:
+daemon:x:1:
+bin:x:2:
+sys:x:3:
+adm:x:4:
+tty:x:5:
+disk:x:6:
+lp:x:7:
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:
+tape:x:26:
+sudo:x:27:
+audio:x:29:
+dip:x:30:
+www-data:x:33:
+backup:x:34:
+operator:x:37:
+list:x:38:
+irc:x:39:
+src:x:40:
+gnats:x:41:
+shadow:x:42:
+utmp:x:43:
+video:x:44:
+sasl:x:45:
+plugdev:x:46:
+staff:x:50:
+games:x:60:
+users:x:100:
+nogroup:x:65534:
+crontab:x:101:
+Debian-exim:x:102:
+test1:x:1000:

Added: debian/trunk/tests/usertools/01/01_useradd_add_user/gshadow
===================================================================
--- debian/trunk/tests/usertools/01/01_useradd_add_user/gshadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/01_useradd_add_user/gshadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:*::
+daemon:*::
+bin:*::
+sys:*::
+adm:*::
+tty:*::
+disk:*::
+lp:*::
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*::
+voice:*::
+cdrom:*::
+floppy:*::
+tape:*::
+sudo:*::
+audio:*::
+dip:*::
+www-data:*::
+backup:*::
+operator:*::
+list:*::
+irc:*::
+src:*::
+gnats:*::
+shadow:*::
+utmp:*::
+video:*::
+sasl:*::
+plugdev:*::
+staff:*::
+games:*::
+users:*::
+nogroup:*::
+crontab:x::
+Debian-exim:x::
+test1:!::

Added: debian/trunk/tests/usertools/01/01_useradd_add_user/passwd
===================================================================
--- debian/trunk/tests/usertools/01/01_useradd_add_user/passwd	                        (rev 0)
+++ debian/trunk/tests/usertools/01/01_useradd_add_user/passwd	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:x:0:0:root:/root:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+bin:x:2:2:bin:/bin:/bin/sh
+sys:x:3:3:sys:/dev:/bin/sh
+sync:x:4:65534:sync:/bin:/bin/sync
+games:x:5:60:games:/usr/games:/bin/sh
+man:x:6:12:man:/var/cache/man:/bin/sh
+lp:x:7:7:lp:/var/spool/lpd:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/var/spool/news:/bin/sh
+uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/var/www:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/var/list:/bin/sh
+irc:x:39:39:ircd:/var/run/ircd:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
+nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
+Debian-exim:x:102:102::/var/spool/exim4:/bin/false
+test1:x:1000:1000::/home/test1:/bin/sh

Added: debian/trunk/tests/usertools/01/01_useradd_add_user/shadow
===================================================================
--- debian/trunk/tests/usertools/01/01_useradd_add_user/shadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/01_useradd_add_user/shadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
+daemon:*:12977:0:99999:7:::
+bin:*:12977:0:99999:7:::
+sys:*:12977:0:99999:7:::
+sync:*:12977:0:99999:7:::
+games:*:12977:0:99999:7:::
+man:*:12977:0:99999:7:::
+lp:*:12977:0:99999:7:::
+mail:*:12977:0:99999:7:::
+news:*:12977:0:99999:7:::
+uucp:*:12977:0:99999:7:::
+proxy:*:12977:0:99999:7:::
+www-data:*:12977:0:99999:7:::
+backup:*:12977:0:99999:7:::
+list:*:12977:0:99999:7:::
+irc:*:12977:0:99999:7:::
+gnats:*:12977:0:99999:7:::
+nobody:*:12977:0:99999:7:::
+Debian-exim:!:12977:0:99999:7:::
+test1:!:@TODAY@:0:99999:7:::

Added: debian/trunk/tests/usertools/01/01_useradd_add_user.test
===================================================================
--- debian/trunk/tests/usertools/01/01_useradd_add_user.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/01_useradd_add_user.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Add a new user"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1 (useradd test1)..."
+useradd test1
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl 01_useradd_add_user/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl 01_useradd_add_user/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl 01_useradd_add_user/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl 01_useradd_add_user/gshadow /etc/gshadow
+echo "OK"
+echo -n "no homedir..."
+test -d /home/test1 && exit 1 || true
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/01_useradd_add_user.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/01_userdel_delete_user.test
===================================================================
--- debian/trunk/tests/usertools/01/01_userdel_delete_user.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/01_userdel_delete_user.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Delete user"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1 (useradd test1)..."
+useradd test1
+echo "OK"
+echo -n "Delete user test1 (userdel test1)..."
+userdel test1
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl config/etc/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl config/etc/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl config/etc/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl config/etc/gshadow /etc/gshadow
+echo "OK"
+echo -n "no homedir..."
+test -d /home/test1 && exit 1 || true
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/01_userdel_delete_user.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/02_useradd_recreate_deleted_user/group
===================================================================
--- debian/trunk/tests/usertools/01/02_useradd_recreate_deleted_user/group	                        (rev 0)
+++ debian/trunk/tests/usertools/01/02_useradd_recreate_deleted_user/group	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:x:0:
+daemon:x:1:
+bin:x:2:
+sys:x:3:
+adm:x:4:
+tty:x:5:
+disk:x:6:
+lp:x:7:
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:
+tape:x:26:
+sudo:x:27:
+audio:x:29:
+dip:x:30:
+www-data:x:33:
+backup:x:34:
+operator:x:37:
+list:x:38:
+irc:x:39:
+src:x:40:
+gnats:x:41:
+shadow:x:42:
+utmp:x:43:
+video:x:44:
+sasl:x:45:
+plugdev:x:46:
+staff:x:50:
+games:x:60:
+users:x:100:
+nogroup:x:65534:
+crontab:x:101:
+Debian-exim:x:102:
+test2:x:1000:

Added: debian/trunk/tests/usertools/01/02_useradd_recreate_deleted_user/gshadow
===================================================================
--- debian/trunk/tests/usertools/01/02_useradd_recreate_deleted_user/gshadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/02_useradd_recreate_deleted_user/gshadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:*::
+daemon:*::
+bin:*::
+sys:*::
+adm:*::
+tty:*::
+disk:*::
+lp:*::
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*::
+voice:*::
+cdrom:*::
+floppy:*::
+tape:*::
+sudo:*::
+audio:*::
+dip:*::
+www-data:*::
+backup:*::
+operator:*::
+list:*::
+irc:*::
+src:*::
+gnats:*::
+shadow:*::
+utmp:*::
+video:*::
+sasl:*::
+plugdev:*::
+staff:*::
+games:*::
+users:*::
+nogroup:*::
+crontab:x::
+Debian-exim:x::
+test2:!::

Added: debian/trunk/tests/usertools/01/02_useradd_recreate_deleted_user/passwd
===================================================================
--- debian/trunk/tests/usertools/01/02_useradd_recreate_deleted_user/passwd	                        (rev 0)
+++ debian/trunk/tests/usertools/01/02_useradd_recreate_deleted_user/passwd	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:x:0:0:root:/root:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+bin:x:2:2:bin:/bin:/bin/sh
+sys:x:3:3:sys:/dev:/bin/sh
+sync:x:4:65534:sync:/bin:/bin/sync
+games:x:5:60:games:/usr/games:/bin/sh
+man:x:6:12:man:/var/cache/man:/bin/sh
+lp:x:7:7:lp:/var/spool/lpd:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/var/spool/news:/bin/sh
+uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/var/www:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/var/list:/bin/sh
+irc:x:39:39:ircd:/var/run/ircd:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
+nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
+Debian-exim:x:102:102::/var/spool/exim4:/bin/false
+test2:x:1000:1000::/home/test2:/bin/sh

Added: debian/trunk/tests/usertools/01/02_useradd_recreate_deleted_user/shadow
===================================================================
--- debian/trunk/tests/usertools/01/02_useradd_recreate_deleted_user/shadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/02_useradd_recreate_deleted_user/shadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
+daemon:*:12977:0:99999:7:::
+bin:*:12977:0:99999:7:::
+sys:*:12977:0:99999:7:::
+sync:*:12977:0:99999:7:::
+games:*:12977:0:99999:7:::
+man:*:12977:0:99999:7:::
+lp:*:12977:0:99999:7:::
+mail:*:12977:0:99999:7:::
+news:*:12977:0:99999:7:::
+uucp:*:12977:0:99999:7:::
+proxy:*:12977:0:99999:7:::
+www-data:*:12977:0:99999:7:::
+backup:*:12977:0:99999:7:::
+list:*:12977:0:99999:7:::
+irc:*:12977:0:99999:7:::
+gnats:*:12977:0:99999:7:::
+nobody:*:12977:0:99999:7:::
+Debian-exim:!:12977:0:99999:7:::
+test2:!:@TODAY@:0:99999:7:::

Added: debian/trunk/tests/usertools/01/02_useradd_recreate_deleted_user.test
===================================================================
--- debian/trunk/tests/usertools/01/02_useradd_recreate_deleted_user.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/02_useradd_recreate_deleted_user.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Add a new user"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1 (useradd test1)..."
+useradd test1
+echo "OK"
+echo -n "Delete user test1 (userdel test1)..."
+userdel test1
+echo "OK"
+echo -n "Create user test2 (useradd test1)..."
+useradd test2
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl 02_useradd_recreate_deleted_user/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl 02_useradd_recreate_deleted_user/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl 02_useradd_recreate_deleted_user/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl 02_useradd_recreate_deleted_user/gshadow /etc/gshadow
+echo "OK"
+echo -n "no homedir..."
+test -d /home/test2 && exit 1 || true
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/02_useradd_recreate_deleted_user.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/03_useradd_additional_options/group
===================================================================
--- debian/trunk/tests/usertools/01/03_useradd_additional_options/group	                        (rev 0)
+++ debian/trunk/tests/usertools/01/03_useradd_additional_options/group	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:x:0:
+daemon:x:1:
+bin:x:2:
+sys:x:3:
+adm:x:4:
+tty:x:5:
+disk:x:6:
+lp:x:7:
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:
+tape:x:26:
+sudo:x:27:
+audio:x:29:
+dip:x:30:
+www-data:x:33:
+backup:x:34:
+operator:x:37:
+list:x:38:
+irc:x:39:
+src:x:40:
+gnats:x:41:
+shadow:x:42:
+utmp:x:43:
+video:x:44:
+sasl:x:45:
+plugdev:x:46:
+staff:x:50:
+games:x:60:
+users:x:100:
+nogroup:x:65534:
+crontab:x:101:
+Debian-exim:x:102:
+test3:x:1000:

Added: debian/trunk/tests/usertools/01/03_useradd_additional_options/gshadow
===================================================================
--- debian/trunk/tests/usertools/01/03_useradd_additional_options/gshadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/03_useradd_additional_options/gshadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:*::
+daemon:*::
+bin:*::
+sys:*::
+adm:*::
+tty:*::
+disk:*::
+lp:*::
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*::
+voice:*::
+cdrom:*::
+floppy:*::
+tape:*::
+sudo:*::
+audio:*::
+dip:*::
+www-data:*::
+backup:*::
+operator:*::
+list:*::
+irc:*::
+src:*::
+gnats:*::
+shadow:*::
+utmp:*::
+video:*::
+sasl:*::
+plugdev:*::
+staff:*::
+games:*::
+users:*::
+nogroup:*::
+crontab:x::
+Debian-exim:x::
+test3:!::

Added: debian/trunk/tests/usertools/01/03_useradd_additional_options/passwd
===================================================================
--- debian/trunk/tests/usertools/01/03_useradd_additional_options/passwd	                        (rev 0)
+++ debian/trunk/tests/usertools/01/03_useradd_additional_options/passwd	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:x:0:0:root:/root:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+bin:x:2:2:bin:/bin:/bin/sh
+sys:x:3:3:sys:/dev:/bin/sh
+sync:x:4:65534:sync:/bin:/bin/sync
+games:x:5:60:games:/usr/games:/bin/sh
+man:x:6:12:man:/var/cache/man:/bin/sh
+lp:x:7:7:lp:/var/spool/lpd:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/var/spool/news:/bin/sh
+uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/var/www:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/var/list:/bin/sh
+irc:x:39:39:ircd:/var/run/ircd:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
+nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
+Debian-exim:x:102:102::/var/spool/exim4:/bin/false
+test3:x:1000:1000:comment test3:/nonexistenthomedir:/bin/bash

Added: debian/trunk/tests/usertools/01/03_useradd_additional_options/shadow
===================================================================
--- debian/trunk/tests/usertools/01/03_useradd_additional_options/shadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/03_useradd_additional_options/shadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
+daemon:*:12977:0:99999:7:::
+bin:*:12977:0:99999:7:::
+sys:*:12977:0:99999:7:::
+sync:*:12977:0:99999:7:::
+games:*:12977:0:99999:7:::
+man:*:12977:0:99999:7:::
+lp:*:12977:0:99999:7:::
+mail:*:12977:0:99999:7:::
+news:*:12977:0:99999:7:::
+uucp:*:12977:0:99999:7:::
+proxy:*:12977:0:99999:7:::
+www-data:*:12977:0:99999:7:::
+backup:*:12977:0:99999:7:::
+list:*:12977:0:99999:7:::
+irc:*:12977:0:99999:7:::
+gnats:*:12977:0:99999:7:::
+nobody:*:12977:0:99999:7:::
+Debian-exim:!:12977:0:99999:7:::
+test3:!:@TODAY@:0:99999:7:12:13183:

Added: debian/trunk/tests/usertools/01/03_useradd_additional_options.test
===================================================================
--- debian/trunk/tests/usertools/01/03_useradd_additional_options.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/03_useradd_additional_options.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "useradd options --comment, --expiredate, --shell, --inactive, --home-dir"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1 (useradd test3 with options)..."
+useradd --comment "comment test3" \
+	--expiredate "2006-02-04" \
+	--shell "/bin/bash" \
+	--inactive "12" \
+	--home-dir "/nonexistenthomedir" \
+	test3
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl 03_useradd_additional_options/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl 03_useradd_additional_options/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl 03_useradd_additional_options/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl 03_useradd_additional_options/gshadow /etc/gshadow
+echo "OK"
+echo -n "no homedir /home/test3..."
+test ! -d /home/test3
+echo "OK"
+echo -n "no homedir /nonexistenthomedir..."
+test ! -d /nonexistenthomedir
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/03_useradd_additional_options.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_fail/group
===================================================================
--- debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_fail/group	                        (rev 0)
+++ debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_fail/group	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:x:0:
+daemon:x:1:
+bin:x:2:
+sys:x:3:
+adm:x:4:
+tty:x:5:
+disk:x:6:
+lp:x:7:
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:
+tape:x:26:
+sudo:x:27:
+audio:x:29:
+dip:x:30:
+www-data:x:33:
+backup:x:34:
+operator:x:37:
+list:x:38:
+irc:x:39:
+src:x:40:
+gnats:x:41:
+shadow:x:42:
+utmp:x:43:
+video:x:44:
+sasl:x:45:
+plugdev:x:46:
+staff:x:50:
+games:x:60:
+users:x:100:
+nogroup:x:65534:
+crontab:x:101:
+Debian-exim:x:102:
+test1:x:4242:

Added: debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_fail/gshadow
===================================================================
--- debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_fail/gshadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_fail/gshadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:*::
+daemon:*::
+bin:*::
+sys:*::
+adm:*::
+tty:*::
+disk:*::
+lp:*::
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*::
+voice:*::
+cdrom:*::
+floppy:*::
+tape:*::
+sudo:*::
+audio:*::
+dip:*::
+www-data:*::
+backup:*::
+operator:*::
+list:*::
+irc:*::
+src:*::
+gnats:*::
+shadow:*::
+utmp:*::
+video:*::
+sasl:*::
+plugdev:*::
+staff:*::
+games:*::
+users:*::
+nogroup:*::
+crontab:x::
+Debian-exim:x::
+test1:!::

Added: debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_fail/passwd
===================================================================
--- debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_fail/passwd	                        (rev 0)
+++ debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_fail/passwd	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:x:0:0:root:/root:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+bin:x:2:2:bin:/bin:/bin/sh
+sys:x:3:3:sys:/dev:/bin/sh
+sync:x:4:65534:sync:/bin:/bin/sync
+games:x:5:60:games:/usr/games:/bin/sh
+man:x:6:12:man:/var/cache/man:/bin/sh
+lp:x:7:7:lp:/var/spool/lpd:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/var/spool/news:/bin/sh
+uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/var/www:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/var/list:/bin/sh
+irc:x:39:39:ircd:/var/run/ircd:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
+nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
+Debian-exim:x:102:102::/var/spool/exim4:/bin/false
+test1:x:4242:4242::/home/test1:/bin/sh

Added: debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_fail/shadow
===================================================================
--- debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_fail/shadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_fail/shadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
+daemon:*:12977:0:99999:7:::
+bin:*:12977:0:99999:7:::
+sys:*:12977:0:99999:7:::
+sync:*:12977:0:99999:7:::
+games:*:12977:0:99999:7:::
+man:*:12977:0:99999:7:::
+lp:*:12977:0:99999:7:::
+mail:*:12977:0:99999:7:::
+news:*:12977:0:99999:7:::
+uucp:*:12977:0:99999:7:::
+proxy:*:12977:0:99999:7:::
+www-data:*:12977:0:99999:7:::
+backup:*:12977:0:99999:7:::
+list:*:12977:0:99999:7:::
+irc:*:12977:0:99999:7:::
+gnats:*:12977:0:99999:7:::
+nobody:*:12977:0:99999:7:::
+Debian-exim:!:12977:0:99999:7:::
+test1:!:@TODAY@:0:99999:7:::

Added: debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_fail/useradd.err
===================================================================
--- debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_fail/useradd.err	                        (rev 0)
+++ debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_fail/useradd.err	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1 @@
+useradd: UID 4242 is not unique

Added: debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_fail.test
===================================================================
--- debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_fail.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_fail.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,60 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Add a new user with an existing ID"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1 (useradd -u 4242 test1)..."
+useradd -u 4242 test1
+echo "OK"
+echo -n "Create user test2 with the same ID (useradd -u 4242 test2)..."
+useradd -u 4242 test2 2>tmp/useradd.err && exit 1 || {
+	status=$?
+}
+echo "OK"
+echo "All right, useradd returned error $status."
+echo -n "Check returned status..."
+test "$status" = "4"
+echo "OK"
+
+echo "useradd displayed:"
+echo "======================================================================="
+cat tmp/useradd.err
+echo "======================================================================="
+echo -n "Check that there were a failure message..."
+diff -au 04_useradd_add_user_with_existing_UID_fail/useradd.err tmp/useradd.err
+echo "error message OK."
+rm -f tmp/useradd.err
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl 04_useradd_add_user_with_existing_UID_fail/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl 04_useradd_add_user_with_existing_UID_fail/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl 04_useradd_add_user_with_existing_UID_fail/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl 04_useradd_add_user_with_existing_UID_fail/gshadow /etc/gshadow
+echo "OK"
+echo -n "no homedir..."
+test -d /home/test1 && exit 1 || true
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_fail.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_with_-o/group
===================================================================
--- debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_with_-o/group	                        (rev 0)
+++ debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_with_-o/group	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,43 @@
+root:x:0:
+daemon:x:1:
+bin:x:2:
+sys:x:3:
+adm:x:4:
+tty:x:5:
+disk:x:6:
+lp:x:7:
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:
+tape:x:26:
+sudo:x:27:
+audio:x:29:
+dip:x:30:
+www-data:x:33:
+backup:x:34:
+operator:x:37:
+list:x:38:
+irc:x:39:
+src:x:40:
+gnats:x:41:
+shadow:x:42:
+utmp:x:43:
+video:x:44:
+sasl:x:45:
+plugdev:x:46:
+staff:x:50:
+games:x:60:
+users:x:100:
+nogroup:x:65534:
+crontab:x:101:
+Debian-exim:x:102:
+test1:x:4242:
+test2:x:4243:

Added: debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_with_-o/gshadow
===================================================================
--- debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_with_-o/gshadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_with_-o/gshadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,43 @@
+root:*::
+daemon:*::
+bin:*::
+sys:*::
+adm:*::
+tty:*::
+disk:*::
+lp:*::
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*::
+voice:*::
+cdrom:*::
+floppy:*::
+tape:*::
+sudo:*::
+audio:*::
+dip:*::
+www-data:*::
+backup:*::
+operator:*::
+list:*::
+irc:*::
+src:*::
+gnats:*::
+shadow:*::
+utmp:*::
+video:*::
+sasl:*::
+plugdev:*::
+staff:*::
+games:*::
+users:*::
+nogroup:*::
+crontab:x::
+Debian-exim:x::
+test1:!::
+test2:!::

Added: debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_with_-o/passwd
===================================================================
--- debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_with_-o/passwd	                        (rev 0)
+++ debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_with_-o/passwd	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,21 @@
+root:x:0:0:root:/root:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+bin:x:2:2:bin:/bin:/bin/sh
+sys:x:3:3:sys:/dev:/bin/sh
+sync:x:4:65534:sync:/bin:/bin/sync
+games:x:5:60:games:/usr/games:/bin/sh
+man:x:6:12:man:/var/cache/man:/bin/sh
+lp:x:7:7:lp:/var/spool/lpd:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/var/spool/news:/bin/sh
+uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/var/www:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/var/list:/bin/sh
+irc:x:39:39:ircd:/var/run/ircd:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
+nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
+Debian-exim:x:102:102::/var/spool/exim4:/bin/false
+test1:x:4242:4242::/home/test1:/bin/sh
+test2:x:4242:4243::/home/test2:/bin/sh

Added: debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_with_-o/shadow
===================================================================
--- debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_with_-o/shadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_with_-o/shadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,21 @@
+root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
+daemon:*:12977:0:99999:7:::
+bin:*:12977:0:99999:7:::
+sys:*:12977:0:99999:7:::
+sync:*:12977:0:99999:7:::
+games:*:12977:0:99999:7:::
+man:*:12977:0:99999:7:::
+lp:*:12977:0:99999:7:::
+mail:*:12977:0:99999:7:::
+news:*:12977:0:99999:7:::
+uucp:*:12977:0:99999:7:::
+proxy:*:12977:0:99999:7:::
+www-data:*:12977:0:99999:7:::
+backup:*:12977:0:99999:7:::
+list:*:12977:0:99999:7:::
+irc:*:12977:0:99999:7:::
+gnats:*:12977:0:99999:7:::
+nobody:*:12977:0:99999:7:::
+Debian-exim:!:12977:0:99999:7:::
+test1:!:@TODAY@:0:99999:7:::
+test2:!:@TODAY@:0:99999:7:::

Added: debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_with_-o.test
===================================================================
--- debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_with_-o.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_with_-o.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Add a new user with a specified existing ID"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1 (useradd -u 4242 test1)..."
+useradd -u 4242 test1
+echo "OK"
+echo -n "Create user test2 with the same ID (useradd -u 4242 -o test2)..."
+useradd -u 4242 -o test2
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl 04_useradd_add_user_with_existing_UID_with_-o/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl 04_useradd_add_user_with_existing_UID_with_-o/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl 04_useradd_add_user_with_existing_UID_with_-o/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl 04_useradd_add_user_with_existing_UID_with_-o/gshadow /etc/gshadow
+echo "OK"
+echo -n "no homedir /home/test1..."
+test -d /home/test1 && exit 1 || true
+echo "OK"
+echo -n "no homedir /home/test2..."
+test -d /home/test2 && exit 1 || true
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/04_useradd_add_user_with_existing_UID_with_-o.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/04_useradd_specified_UID/group
===================================================================
--- debian/trunk/tests/usertools/01/04_useradd_specified_UID/group	                        (rev 0)
+++ debian/trunk/tests/usertools/01/04_useradd_specified_UID/group	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:x:0:
+daemon:x:1:
+bin:x:2:
+sys:x:3:
+adm:x:4:
+tty:x:5:
+disk:x:6:
+lp:x:7:
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:
+tape:x:26:
+sudo:x:27:
+audio:x:29:
+dip:x:30:
+www-data:x:33:
+backup:x:34:
+operator:x:37:
+list:x:38:
+irc:x:39:
+src:x:40:
+gnats:x:41:
+shadow:x:42:
+utmp:x:43:
+video:x:44:
+sasl:x:45:
+plugdev:x:46:
+staff:x:50:
+games:x:60:
+users:x:100:
+nogroup:x:65534:
+crontab:x:101:
+Debian-exim:x:102:
+test1:x:4242:

Added: debian/trunk/tests/usertools/01/04_useradd_specified_UID/gshadow
===================================================================
--- debian/trunk/tests/usertools/01/04_useradd_specified_UID/gshadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/04_useradd_specified_UID/gshadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:*::
+daemon:*::
+bin:*::
+sys:*::
+adm:*::
+tty:*::
+disk:*::
+lp:*::
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*::
+voice:*::
+cdrom:*::
+floppy:*::
+tape:*::
+sudo:*::
+audio:*::
+dip:*::
+www-data:*::
+backup:*::
+operator:*::
+list:*::
+irc:*::
+src:*::
+gnats:*::
+shadow:*::
+utmp:*::
+video:*::
+sasl:*::
+plugdev:*::
+staff:*::
+games:*::
+users:*::
+nogroup:*::
+crontab:x::
+Debian-exim:x::
+test1:!::

Added: debian/trunk/tests/usertools/01/04_useradd_specified_UID/passwd
===================================================================
--- debian/trunk/tests/usertools/01/04_useradd_specified_UID/passwd	                        (rev 0)
+++ debian/trunk/tests/usertools/01/04_useradd_specified_UID/passwd	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:x:0:0:root:/root:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+bin:x:2:2:bin:/bin:/bin/sh
+sys:x:3:3:sys:/dev:/bin/sh
+sync:x:4:65534:sync:/bin:/bin/sync
+games:x:5:60:games:/usr/games:/bin/sh
+man:x:6:12:man:/var/cache/man:/bin/sh
+lp:x:7:7:lp:/var/spool/lpd:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/var/spool/news:/bin/sh
+uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/var/www:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/var/list:/bin/sh
+irc:x:39:39:ircd:/var/run/ircd:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
+nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
+Debian-exim:x:102:102::/var/spool/exim4:/bin/false
+test1:x:4242:4242::/home/test1:/bin/sh

Added: debian/trunk/tests/usertools/01/04_useradd_specified_UID/shadow
===================================================================
--- debian/trunk/tests/usertools/01/04_useradd_specified_UID/shadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/04_useradd_specified_UID/shadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
+daemon:*:12977:0:99999:7:::
+bin:*:12977:0:99999:7:::
+sys:*:12977:0:99999:7:::
+sync:*:12977:0:99999:7:::
+games:*:12977:0:99999:7:::
+man:*:12977:0:99999:7:::
+lp:*:12977:0:99999:7:::
+mail:*:12977:0:99999:7:::
+news:*:12977:0:99999:7:::
+uucp:*:12977:0:99999:7:::
+proxy:*:12977:0:99999:7:::
+www-data:*:12977:0:99999:7:::
+backup:*:12977:0:99999:7:::
+list:*:12977:0:99999:7:::
+irc:*:12977:0:99999:7:::
+gnats:*:12977:0:99999:7:::
+nobody:*:12977:0:99999:7:::
+Debian-exim:!:12977:0:99999:7:::
+test1:!:@TODAY@:0:99999:7:::

Added: debian/trunk/tests/usertools/01/04_useradd_specified_UID.test
===================================================================
--- debian/trunk/tests/usertools/01/04_useradd_specified_UID.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/04_useradd_specified_UID.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Add a new user with a specified ID"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1 (useradd -u 4242 test1)..."
+useradd -u 4242 test1
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl 04_useradd_specified_UID/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl 04_useradd_specified_UID/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl 04_useradd_specified_UID/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl 04_useradd_specified_UID/gshadow /etc/gshadow
+echo "OK"
+echo -n "no homedir..."
+test -d /home/test1 && exit 1 || true
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/04_useradd_specified_UID.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/04_useradd_specified_UID_and_GID/group
===================================================================
--- debian/trunk/tests/usertools/01/04_useradd_specified_UID_and_GID/group	                        (rev 0)
+++ debian/trunk/tests/usertools/01/04_useradd_specified_UID_and_GID/group	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:x:0:
+daemon:x:1:
+bin:x:2:
+sys:x:3:
+adm:x:4:
+tty:x:5:
+disk:x:6:
+lp:x:7:
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:
+tape:x:26:
+sudo:x:27:
+audio:x:29:
+dip:x:30:
+www-data:x:33:
+backup:x:34:
+operator:x:37:
+list:x:38:
+irc:x:39:
+src:x:40:
+gnats:x:41:
+shadow:x:42:
+utmp:x:43:
+video:x:44:
+sasl:x:45:
+plugdev:x:46:
+staff:x:50:
+games:x:60:
+users:x:100:
+nogroup:x:65534:
+crontab:x:101:
+Debian-exim:x:102:
+test1:x:4242:

Added: debian/trunk/tests/usertools/01/04_useradd_specified_UID_and_GID/gshadow
===================================================================
--- debian/trunk/tests/usertools/01/04_useradd_specified_UID_and_GID/gshadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/04_useradd_specified_UID_and_GID/gshadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:*::
+daemon:*::
+bin:*::
+sys:*::
+adm:*::
+tty:*::
+disk:*::
+lp:*::
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*::
+voice:*::
+cdrom:*::
+floppy:*::
+tape:*::
+sudo:*::
+audio:*::
+dip:*::
+www-data:*::
+backup:*::
+operator:*::
+list:*::
+irc:*::
+src:*::
+gnats:*::
+shadow:*::
+utmp:*::
+video:*::
+sasl:*::
+plugdev:*::
+staff:*::
+games:*::
+users:*::
+nogroup:*::
+crontab:x::
+Debian-exim:x::
+test1:!::

Added: debian/trunk/tests/usertools/01/04_useradd_specified_UID_and_GID/passwd
===================================================================
--- debian/trunk/tests/usertools/01/04_useradd_specified_UID_and_GID/passwd	                        (rev 0)
+++ debian/trunk/tests/usertools/01/04_useradd_specified_UID_and_GID/passwd	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,21 @@
+root:x:0:0:root:/root:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+bin:x:2:2:bin:/bin:/bin/sh
+sys:x:3:3:sys:/dev:/bin/sh
+sync:x:4:65534:sync:/bin:/bin/sync
+games:x:5:60:games:/usr/games:/bin/sh
+man:x:6:12:man:/var/cache/man:/bin/sh
+lp:x:7:7:lp:/var/spool/lpd:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/var/spool/news:/bin/sh
+uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/var/www:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/var/list:/bin/sh
+irc:x:39:39:ircd:/var/run/ircd:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
+nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
+Debian-exim:x:102:102::/var/spool/exim4:/bin/false
+test1:x:4242:4242::/home/test1:/bin/sh
+test2:x:4242:4242::/home/test2:/bin/sh

Added: debian/trunk/tests/usertools/01/04_useradd_specified_UID_and_GID/shadow
===================================================================
--- debian/trunk/tests/usertools/01/04_useradd_specified_UID_and_GID/shadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/04_useradd_specified_UID_and_GID/shadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,21 @@
+root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
+daemon:*:12977:0:99999:7:::
+bin:*:12977:0:99999:7:::
+sys:*:12977:0:99999:7:::
+sync:*:12977:0:99999:7:::
+games:*:12977:0:99999:7:::
+man:*:12977:0:99999:7:::
+lp:*:12977:0:99999:7:::
+mail:*:12977:0:99999:7:::
+news:*:12977:0:99999:7:::
+uucp:*:12977:0:99999:7:::
+proxy:*:12977:0:99999:7:::
+www-data:*:12977:0:99999:7:::
+backup:*:12977:0:99999:7:::
+list:*:12977:0:99999:7:::
+irc:*:12977:0:99999:7:::
+gnats:*:12977:0:99999:7:::
+nobody:*:12977:0:99999:7:::
+Debian-exim:!:12977:0:99999:7:::
+test1:!:@TODAY@:0:99999:7:::
+test2:!:@TODAY@:0:99999:7:::

Added: debian/trunk/tests/usertools/01/04_useradd_specified_UID_and_GID.test
===================================================================
--- debian/trunk/tests/usertools/01/04_useradd_specified_UID_and_GID.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/04_useradd_specified_UID_and_GID.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Add a new user with a specified existing UID and GID"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1 (useradd -u 4242 test1)..."
+useradd -u 4242 test1
+echo "OK"
+echo -n "Create user test2 with the same ID (useradd -u 4242 -g 4242 -o test2)..."
+useradd -u 4242 -g 4242 -o test2
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl 04_useradd_specified_UID_and_GID/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl 04_useradd_specified_UID_and_GID/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl 04_useradd_specified_UID_and_GID/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl 04_useradd_specified_UID_and_GID/gshadow /etc/gshadow
+echo "OK"
+echo -n "no homedir /home/test1..."
+test -d /home/test1 && exit 1 || true
+echo "OK"
+echo -n "no homedir /home/test2..."
+test -d /home/test2 && exit 1 || true
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/04_useradd_specified_UID_and_GID.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/04_userdel_delete_user_with_non_unique_UID/group
===================================================================
--- debian/trunk/tests/usertools/01/04_userdel_delete_user_with_non_unique_UID/group	                        (rev 0)
+++ debian/trunk/tests/usertools/01/04_userdel_delete_user_with_non_unique_UID/group	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:x:0:
+daemon:x:1:
+bin:x:2:
+sys:x:3:
+adm:x:4:
+tty:x:5:
+disk:x:6:
+lp:x:7:
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:
+tape:x:26:
+sudo:x:27:
+audio:x:29:
+dip:x:30:
+www-data:x:33:
+backup:x:34:
+operator:x:37:
+list:x:38:
+irc:x:39:
+src:x:40:
+gnats:x:41:
+shadow:x:42:
+utmp:x:43:
+video:x:44:
+sasl:x:45:
+plugdev:x:46:
+staff:x:50:
+games:x:60:
+users:x:100:
+nogroup:x:65534:
+crontab:x:101:
+Debian-exim:x:102:
+test1:x:4242:

Added: debian/trunk/tests/usertools/01/04_userdel_delete_user_with_non_unique_UID/gshadow
===================================================================
--- debian/trunk/tests/usertools/01/04_userdel_delete_user_with_non_unique_UID/gshadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/04_userdel_delete_user_with_non_unique_UID/gshadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:*::
+daemon:*::
+bin:*::
+sys:*::
+adm:*::
+tty:*::
+disk:*::
+lp:*::
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*::
+voice:*::
+cdrom:*::
+floppy:*::
+tape:*::
+sudo:*::
+audio:*::
+dip:*::
+www-data:*::
+backup:*::
+operator:*::
+list:*::
+irc:*::
+src:*::
+gnats:*::
+shadow:*::
+utmp:*::
+video:*::
+sasl:*::
+plugdev:*::
+staff:*::
+games:*::
+users:*::
+nogroup:*::
+crontab:x::
+Debian-exim:x::
+test1:!::

Added: debian/trunk/tests/usertools/01/04_userdel_delete_user_with_non_unique_UID/passwd
===================================================================
--- debian/trunk/tests/usertools/01/04_userdel_delete_user_with_non_unique_UID/passwd	                        (rev 0)
+++ debian/trunk/tests/usertools/01/04_userdel_delete_user_with_non_unique_UID/passwd	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:x:0:0:root:/root:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+bin:x:2:2:bin:/bin:/bin/sh
+sys:x:3:3:sys:/dev:/bin/sh
+sync:x:4:65534:sync:/bin:/bin/sync
+games:x:5:60:games:/usr/games:/bin/sh
+man:x:6:12:man:/var/cache/man:/bin/sh
+lp:x:7:7:lp:/var/spool/lpd:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/var/spool/news:/bin/sh
+uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/var/www:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/var/list:/bin/sh
+irc:x:39:39:ircd:/var/run/ircd:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
+nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
+Debian-exim:x:102:102::/var/spool/exim4:/bin/false
+test1:x:4242:4242::/home/test1:/bin/sh

Added: debian/trunk/tests/usertools/01/04_userdel_delete_user_with_non_unique_UID/shadow
===================================================================
--- debian/trunk/tests/usertools/01/04_userdel_delete_user_with_non_unique_UID/shadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/04_userdel_delete_user_with_non_unique_UID/shadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
+daemon:*:12977:0:99999:7:::
+bin:*:12977:0:99999:7:::
+sys:*:12977:0:99999:7:::
+sync:*:12977:0:99999:7:::
+games:*:12977:0:99999:7:::
+man:*:12977:0:99999:7:::
+lp:*:12977:0:99999:7:::
+mail:*:12977:0:99999:7:::
+news:*:12977:0:99999:7:::
+uucp:*:12977:0:99999:7:::
+proxy:*:12977:0:99999:7:::
+www-data:*:12977:0:99999:7:::
+backup:*:12977:0:99999:7:::
+list:*:12977:0:99999:7:::
+irc:*:12977:0:99999:7:::
+gnats:*:12977:0:99999:7:::
+nobody:*:12977:0:99999:7:::
+Debian-exim:!:12977:0:99999:7:::
+test1:!:@TODAY@:0:99999:7:::

Added: debian/trunk/tests/usertools/01/04_userdel_delete_user_with_non_unique_UID.test
===================================================================
--- debian/trunk/tests/usertools/01/04_userdel_delete_user_with_non_unique_UID.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/04_userdel_delete_user_with_non_unique_UID.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Remove an user with a duplicate ID"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1 (useradd -u 4242 test1)..."
+useradd -u 4242 test1
+echo "OK"
+echo -n "Create user test2 with the same ID (useradd -u 4242 -o test2)..."
+useradd -u 4242 -o test2
+echo "OK"
+echo -n "Delete user test2 (userdel test2)..."
+userdel test2
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl 04_userdel_delete_user_with_non_unique_UID/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl 04_userdel_delete_user_with_non_unique_UID/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl 04_userdel_delete_user_with_non_unique_UID/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl 04_userdel_delete_user_with_non_unique_UID/gshadow /etc/gshadow
+echo "OK"
+echo -n "no homedir /home/test1..."
+test -d /home/test1 && exit 1 || true
+echo "OK"
+echo -n "no homedir /home/test2..."
+test -d /home/test2 && exit 1 || true
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/04_userdel_delete_user_with_non_unique_UID.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/05_useradd_invalid_numeric_primary_group/useradd.err
===================================================================
--- debian/trunk/tests/usertools/01/05_useradd_invalid_numeric_primary_group/useradd.err	                        (rev 0)
+++ debian/trunk/tests/usertools/01/05_useradd_invalid_numeric_primary_group/useradd.err	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1 @@
+useradd: unknown group 4242

Added: debian/trunk/tests/usertools/01/05_useradd_invalid_numeric_primary_group.test
===================================================================
--- debian/trunk/tests/usertools/01/05_useradd_invalid_numeric_primary_group.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/05_useradd_invalid_numeric_primary_group.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,58 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Add a new user with a specified unexisting GID"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1 (useradd -g 4242 test1)..."
+useradd -g 4242 test1 2>tmp/useradd.err && exit 1 || {
+	status=$?
+}
+echo "OK"
+echo "OK"
+echo "All right, useradd returned error $status."
+echo -n "Check returned status..."
+test "$status" = "6"
+echo "OK"
+
+echo "useradd displayed:"
+echo "======================================================================="
+cat tmp/useradd.err
+echo "======================================================================="
+echo -n "Check that there were a failure message..."
+diff -au 05_useradd_invalid_numeric_primary_group/useradd.err tmp/useradd.err
+echo "error message OK."
+rm -f tmp/useradd.err
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl config/etc/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl config/etc/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl config/etc/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl config/etc/gshadow /etc/gshadow
+echo "OK"
+echo -n "no homedir..."
+test -d /home/test1 && exit 1 || true
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/05_useradd_invalid_numeric_primary_group.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/06_useradd_invalid_named_primary_group/useradd.err
===================================================================
--- debian/trunk/tests/usertools/01/06_useradd_invalid_named_primary_group/useradd.err	                        (rev 0)
+++ debian/trunk/tests/usertools/01/06_useradd_invalid_named_primary_group/useradd.err	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1 @@
+useradd: unknown group nekral

Added: debian/trunk/tests/usertools/01/06_useradd_invalid_named_primary_group.test
===================================================================
--- debian/trunk/tests/usertools/01/06_useradd_invalid_named_primary_group.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/06_useradd_invalid_named_primary_group.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,58 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Add a new user with a specified unexisting GID"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1 (useradd test1 -g nekral)..."
+useradd test1 -g nekral 2>tmp/useradd.err && exit 1 || {
+	status=$?
+}
+echo "OK"
+echo "OK"
+echo "All right, useradd returned error $status."
+echo -n "Check returned status..."
+test "$status" = "6"
+echo "OK"
+
+echo "useradd displayed:"
+echo "======================================================================="
+cat tmp/useradd.err
+echo "======================================================================="
+echo -n "Check that there were a failure message..."
+diff -au 06_useradd_invalid_named_primary_group/useradd.err tmp/useradd.err
+echo "error message OK."
+rm -f tmp/useradd.err
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl config/etc/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl config/etc/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl config/etc/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl config/etc/gshadow /etc/gshadow
+echo "OK"
+echo -n "no homedir..."
+test -d /home/test1 && exit 1 || true
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/06_useradd_invalid_named_primary_group.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/07_useradd_numerical_primary_group/group
===================================================================
--- debian/trunk/tests/usertools/01/07_useradd_numerical_primary_group/group	                        (rev 0)
+++ debian/trunk/tests/usertools/01/07_useradd_numerical_primary_group/group	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,41 @@
+root:x:0:
+daemon:x:1:
+bin:x:2:
+sys:x:3:
+adm:x:4:
+tty:x:5:
+disk:x:6:
+lp:x:7:
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:
+tape:x:26:
+sudo:x:27:
+audio:x:29:
+dip:x:30:
+www-data:x:33:
+backup:x:34:
+operator:x:37:
+list:x:38:
+irc:x:39:
+src:x:40:
+gnats:x:41:
+shadow:x:42:
+utmp:x:43:
+video:x:44:
+sasl:x:45:
+plugdev:x:46:
+staff:x:50:
+games:x:60:
+users:x:100:
+nogroup:x:65534:
+crontab:x:101:
+Debian-exim:x:102:

Added: debian/trunk/tests/usertools/01/07_useradd_numerical_primary_group/gshadow
===================================================================
--- debian/trunk/tests/usertools/01/07_useradd_numerical_primary_group/gshadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/07_useradd_numerical_primary_group/gshadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,41 @@
+root:*::
+daemon:*::
+bin:*::
+sys:*::
+adm:*::
+tty:*::
+disk:*::
+lp:*::
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*::
+voice:*::
+cdrom:*::
+floppy:*::
+tape:*::
+sudo:*::
+audio:*::
+dip:*::
+www-data:*::
+backup:*::
+operator:*::
+list:*::
+irc:*::
+src:*::
+gnats:*::
+shadow:*::
+utmp:*::
+video:*::
+sasl:*::
+plugdev:*::
+staff:*::
+games:*::
+users:*::
+nogroup:*::
+crontab:x::
+Debian-exim:x::

Added: debian/trunk/tests/usertools/01/07_useradd_numerical_primary_group/passwd
===================================================================
--- debian/trunk/tests/usertools/01/07_useradd_numerical_primary_group/passwd	                        (rev 0)
+++ debian/trunk/tests/usertools/01/07_useradd_numerical_primary_group/passwd	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:x:0:0:root:/root:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+bin:x:2:2:bin:/bin:/bin/sh
+sys:x:3:3:sys:/dev:/bin/sh
+sync:x:4:65534:sync:/bin:/bin/sync
+games:x:5:60:games:/usr/games:/bin/sh
+man:x:6:12:man:/var/cache/man:/bin/sh
+lp:x:7:7:lp:/var/spool/lpd:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/var/spool/news:/bin/sh
+uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/var/www:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/var/list:/bin/sh
+irc:x:39:39:ircd:/var/run/ircd:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
+nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
+Debian-exim:x:102:102::/var/spool/exim4:/bin/false
+test1:x:1000:1::/home/test1:/bin/sh

Added: debian/trunk/tests/usertools/01/07_useradd_numerical_primary_group/shadow
===================================================================
--- debian/trunk/tests/usertools/01/07_useradd_numerical_primary_group/shadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/07_useradd_numerical_primary_group/shadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
+daemon:*:12977:0:99999:7:::
+bin:*:12977:0:99999:7:::
+sys:*:12977:0:99999:7:::
+sync:*:12977:0:99999:7:::
+games:*:12977:0:99999:7:::
+man:*:12977:0:99999:7:::
+lp:*:12977:0:99999:7:::
+mail:*:12977:0:99999:7:::
+news:*:12977:0:99999:7:::
+uucp:*:12977:0:99999:7:::
+proxy:*:12977:0:99999:7:::
+www-data:*:12977:0:99999:7:::
+backup:*:12977:0:99999:7:::
+list:*:12977:0:99999:7:::
+irc:*:12977:0:99999:7:::
+gnats:*:12977:0:99999:7:::
+nobody:*:12977:0:99999:7:::
+Debian-exim:!:12977:0:99999:7:::
+test1:!:@TODAY@:0:99999:7:::

Added: debian/trunk/tests/usertools/01/07_useradd_numerical_primary_group.test
===================================================================
--- debian/trunk/tests/usertools/01/07_useradd_numerical_primary_group.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/07_useradd_numerical_primary_group.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Add a new user with a numerical GID"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1 (useradd -g 1 test1)..."
+useradd -g 1 test1
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl 07_useradd_numerical_primary_group/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl 07_useradd_numerical_primary_group/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl 07_useradd_numerical_primary_group/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl 07_useradd_numerical_primary_group/gshadow /etc/gshadow
+echo "OK"
+echo -n "no homedir..."
+test -d /home/test1 && exit 1 || true
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/07_useradd_numerical_primary_group.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/08_useradd_named_primary_group/group
===================================================================
--- debian/trunk/tests/usertools/01/08_useradd_named_primary_group/group	                        (rev 0)
+++ debian/trunk/tests/usertools/01/08_useradd_named_primary_group/group	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,41 @@
+root:x:0:
+daemon:x:1:
+bin:x:2:
+sys:x:3:
+adm:x:4:
+tty:x:5:
+disk:x:6:
+lp:x:7:
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:
+tape:x:26:
+sudo:x:27:
+audio:x:29:
+dip:x:30:
+www-data:x:33:
+backup:x:34:
+operator:x:37:
+list:x:38:
+irc:x:39:
+src:x:40:
+gnats:x:41:
+shadow:x:42:
+utmp:x:43:
+video:x:44:
+sasl:x:45:
+plugdev:x:46:
+staff:x:50:
+games:x:60:
+users:x:100:
+nogroup:x:65534:
+crontab:x:101:
+Debian-exim:x:102:

Added: debian/trunk/tests/usertools/01/08_useradd_named_primary_group/gshadow
===================================================================
--- debian/trunk/tests/usertools/01/08_useradd_named_primary_group/gshadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/08_useradd_named_primary_group/gshadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,41 @@
+root:*::
+daemon:*::
+bin:*::
+sys:*::
+adm:*::
+tty:*::
+disk:*::
+lp:*::
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*::
+voice:*::
+cdrom:*::
+floppy:*::
+tape:*::
+sudo:*::
+audio:*::
+dip:*::
+www-data:*::
+backup:*::
+operator:*::
+list:*::
+irc:*::
+src:*::
+gnats:*::
+shadow:*::
+utmp:*::
+video:*::
+sasl:*::
+plugdev:*::
+staff:*::
+games:*::
+users:*::
+nogroup:*::
+crontab:x::
+Debian-exim:x::

Added: debian/trunk/tests/usertools/01/08_useradd_named_primary_group/passwd
===================================================================
--- debian/trunk/tests/usertools/01/08_useradd_named_primary_group/passwd	                        (rev 0)
+++ debian/trunk/tests/usertools/01/08_useradd_named_primary_group/passwd	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:x:0:0:root:/root:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+bin:x:2:2:bin:/bin:/bin/sh
+sys:x:3:3:sys:/dev:/bin/sh
+sync:x:4:65534:sync:/bin:/bin/sync
+games:x:5:60:games:/usr/games:/bin/sh
+man:x:6:12:man:/var/cache/man:/bin/sh
+lp:x:7:7:lp:/var/spool/lpd:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/var/spool/news:/bin/sh
+uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/var/www:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/var/list:/bin/sh
+irc:x:39:39:ircd:/var/run/ircd:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
+nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
+Debian-exim:x:102:102::/var/spool/exim4:/bin/false
+test1:x:1000:65534::/home/test1:/bin/sh

Added: debian/trunk/tests/usertools/01/08_useradd_named_primary_group/shadow
===================================================================
--- debian/trunk/tests/usertools/01/08_useradd_named_primary_group/shadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/08_useradd_named_primary_group/shadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
+daemon:*:12977:0:99999:7:::
+bin:*:12977:0:99999:7:::
+sys:*:12977:0:99999:7:::
+sync:*:12977:0:99999:7:::
+games:*:12977:0:99999:7:::
+man:*:12977:0:99999:7:::
+lp:*:12977:0:99999:7:::
+mail:*:12977:0:99999:7:::
+news:*:12977:0:99999:7:::
+uucp:*:12977:0:99999:7:::
+proxy:*:12977:0:99999:7:::
+www-data:*:12977:0:99999:7:::
+backup:*:12977:0:99999:7:::
+list:*:12977:0:99999:7:::
+irc:*:12977:0:99999:7:::
+gnats:*:12977:0:99999:7:::
+nobody:*:12977:0:99999:7:::
+Debian-exim:!:12977:0:99999:7:::
+test1:!:@TODAY@:0:99999:7:::

Added: debian/trunk/tests/usertools/01/08_useradd_named_primary_group.test
===================================================================
--- debian/trunk/tests/usertools/01/08_useradd_named_primary_group.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/08_useradd_named_primary_group.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Add a new user with a named GID"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1 (useradd test1 -g nogroup)..."
+useradd test1 -g nogroup
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl 08_useradd_named_primary_group/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl 08_useradd_named_primary_group/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl 08_useradd_named_primary_group/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl 08_useradd_named_primary_group/gshadow /etc/gshadow
+echo "OK"
+echo -n "no homedir..."
+test -d /home/test1 && exit 1 || true
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/08_useradd_named_primary_group.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/09_usermod_change_user_info/group
===================================================================
--- debian/trunk/tests/usertools/01/09_usermod_change_user_info/group	                        (rev 0)
+++ debian/trunk/tests/usertools/01/09_usermod_change_user_info/group	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:x:0:
+daemon:x:1:
+bin:x:2:
+sys:x:3:
+adm:x:4:
+tty:x:5:
+disk:x:6:
+lp:x:7:
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:
+tape:x:26:
+sudo:x:27:
+audio:x:29:
+dip:x:30:
+www-data:x:33:
+backup:x:34:
+operator:x:37:
+list:x:38:
+irc:x:39:
+src:x:40:
+gnats:x:41:
+shadow:x:42:
+utmp:x:43:
+video:x:44:
+sasl:x:45:
+plugdev:x:46:
+staff:x:50:
+games:x:60:
+users:x:100:
+nogroup:x:65534:
+crontab:x:101:
+Debian-exim:x:102:
+test1:x:1000:

Added: debian/trunk/tests/usertools/01/09_usermod_change_user_info/gshadow
===================================================================
--- debian/trunk/tests/usertools/01/09_usermod_change_user_info/gshadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/09_usermod_change_user_info/gshadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:*::
+daemon:*::
+bin:*::
+sys:*::
+adm:*::
+tty:*::
+disk:*::
+lp:*::
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*::
+voice:*::
+cdrom:*::
+floppy:*::
+tape:*::
+sudo:*::
+audio:*::
+dip:*::
+www-data:*::
+backup:*::
+operator:*::
+list:*::
+irc:*::
+src:*::
+gnats:*::
+shadow:*::
+utmp:*::
+video:*::
+sasl:*::
+plugdev:*::
+staff:*::
+games:*::
+users:*::
+nogroup:*::
+crontab:x::
+Debian-exim:x::
+test1:!::

Added: debian/trunk/tests/usertools/01/09_usermod_change_user_info/passwd
===================================================================
--- debian/trunk/tests/usertools/01/09_usermod_change_user_info/passwd	                        (rev 0)
+++ debian/trunk/tests/usertools/01/09_usermod_change_user_info/passwd	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:x:0:0:root:/root:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+bin:x:2:2:bin:/bin:/bin/sh
+sys:x:3:3:sys:/dev:/bin/sh
+sync:x:4:65534:sync:/bin:/bin/sync
+games:x:5:60:games:/usr/games:/bin/sh
+man:x:6:12:man:/var/cache/man:/bin/sh
+lp:x:7:7:lp:/var/spool/lpd:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/var/spool/news:/bin/sh
+uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/var/www:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/var/list:/bin/sh
+irc:x:39:39:ircd:/var/run/ircd:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
+nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
+Debian-exim:x:102:102::/var/spool/exim4:/bin/false
+test1:x:1000:1:comment:/tmp:/bin/bash

Added: debian/trunk/tests/usertools/01/09_usermod_change_user_info/shadow
===================================================================
--- debian/trunk/tests/usertools/01/09_usermod_change_user_info/shadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/09_usermod_change_user_info/shadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
+daemon:*:12977:0:99999:7:::
+bin:*:12977:0:99999:7:::
+sys:*:12977:0:99999:7:::
+sync:*:12977:0:99999:7:::
+games:*:12977:0:99999:7:::
+man:*:12977:0:99999:7:::
+lp:*:12977:0:99999:7:::
+mail:*:12977:0:99999:7:::
+news:*:12977:0:99999:7:::
+uucp:*:12977:0:99999:7:::
+proxy:*:12977:0:99999:7:::
+www-data:*:12977:0:99999:7:::
+backup:*:12977:0:99999:7:::
+list:*:12977:0:99999:7:::
+irc:*:12977:0:99999:7:::
+gnats:*:12977:0:99999:7:::
+nobody:*:12977:0:99999:7:::
+Debian-exim:!:12977:0:99999:7:::
+test1:!:@TODAY@:0:99999:7:17:11201:

Added: debian/trunk/tests/usertools/01/09_usermod_change_user_info.test
===================================================================
--- debian/trunk/tests/usertools/01/09_usermod_change_user_info.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/09_usermod_change_user_info.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Change user information with usermod"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1 (useradd test1)..."
+useradd test1
+echo "OK"
+echo -n "Change user test1..."
+usermod -g 1 --comment "comment" -e 2000-09-01 -f 17 -s /bin/bash -d /tmp test1
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl 09_usermod_change_user_info/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl 09_usermod_change_user_info/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl 09_usermod_change_user_info/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl 09_usermod_change_user_info/gshadow /etc/gshadow
+echo "OK"
+echo -n "no homedir..."
+test -d /home/test1 && exit 1 || true
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/09_usermod_change_user_info.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/10_usermod_rename_user/group
===================================================================
--- debian/trunk/tests/usertools/01/10_usermod_rename_user/group	                        (rev 0)
+++ debian/trunk/tests/usertools/01/10_usermod_rename_user/group	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:x:0:
+daemon:x:1:
+bin:x:2:
+sys:x:3:
+adm:x:4:
+tty:x:5:
+disk:x:6:
+lp:x:7:
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:
+tape:x:26:
+sudo:x:27:
+audio:x:29:
+dip:x:30:
+www-data:x:33:
+backup:x:34:
+operator:x:37:
+list:x:38:
+irc:x:39:
+src:x:40:
+gnats:x:41:
+shadow:x:42:
+utmp:x:43:
+video:x:44:
+sasl:x:45:
+plugdev:x:46:
+staff:x:50:
+games:x:60:
+users:x:100:
+nogroup:x:65534:
+crontab:x:101:
+Debian-exim:x:102:
+test1:x:1000:

Added: debian/trunk/tests/usertools/01/10_usermod_rename_user/gshadow
===================================================================
--- debian/trunk/tests/usertools/01/10_usermod_rename_user/gshadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/10_usermod_rename_user/gshadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:*::
+daemon:*::
+bin:*::
+sys:*::
+adm:*::
+tty:*::
+disk:*::
+lp:*::
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*::
+voice:*::
+cdrom:*::
+floppy:*::
+tape:*::
+sudo:*::
+audio:*::
+dip:*::
+www-data:*::
+backup:*::
+operator:*::
+list:*::
+irc:*::
+src:*::
+gnats:*::
+shadow:*::
+utmp:*::
+video:*::
+sasl:*::
+plugdev:*::
+staff:*::
+games:*::
+users:*::
+nogroup:*::
+crontab:x::
+Debian-exim:x::
+test1:!::

Added: debian/trunk/tests/usertools/01/10_usermod_rename_user/passwd
===================================================================
--- debian/trunk/tests/usertools/01/10_usermod_rename_user/passwd	                        (rev 0)
+++ debian/trunk/tests/usertools/01/10_usermod_rename_user/passwd	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:x:0:0:root:/root:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+bin:x:2:2:bin:/bin:/bin/sh
+sys:x:3:3:sys:/dev:/bin/sh
+sync:x:4:65534:sync:/bin:/bin/sync
+games:x:5:60:games:/usr/games:/bin/sh
+man:x:6:12:man:/var/cache/man:/bin/sh
+lp:x:7:7:lp:/var/spool/lpd:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/var/spool/news:/bin/sh
+uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/var/www:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/var/list:/bin/sh
+irc:x:39:39:ircd:/var/run/ircd:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
+nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
+Debian-exim:x:102:102::/var/spool/exim4:/bin/false
+test2:x:1000:1000::/home/test1:/bin/sh

Added: debian/trunk/tests/usertools/01/10_usermod_rename_user/shadow
===================================================================
--- debian/trunk/tests/usertools/01/10_usermod_rename_user/shadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/10_usermod_rename_user/shadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
+daemon:*:12977:0:99999:7:::
+bin:*:12977:0:99999:7:::
+sys:*:12977:0:99999:7:::
+sync:*:12977:0:99999:7:::
+games:*:12977:0:99999:7:::
+man:*:12977:0:99999:7:::
+lp:*:12977:0:99999:7:::
+mail:*:12977:0:99999:7:::
+news:*:12977:0:99999:7:::
+uucp:*:12977:0:99999:7:::
+proxy:*:12977:0:99999:7:::
+www-data:*:12977:0:99999:7:::
+backup:*:12977:0:99999:7:::
+list:*:12977:0:99999:7:::
+irc:*:12977:0:99999:7:::
+gnats:*:12977:0:99999:7:::
+nobody:*:12977:0:99999:7:::
+Debian-exim:!:12977:0:99999:7:::
+test2:!:@TODAY@:0:99999:7:::

Added: debian/trunk/tests/usertools/01/10_usermod_rename_user.test
===================================================================
--- debian/trunk/tests/usertools/01/10_usermod_rename_user.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/10_usermod_rename_user.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Add a new user"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1 (useradd test1)..."
+useradd test1
+echo "OK"
+echo -n "Rename user test1 to test2 (usermod -l test2 test1)..."
+usermod -l test2 test1
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl 10_usermod_rename_user/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl 10_usermod_rename_user/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl 10_usermod_rename_user/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl 10_usermod_rename_user/gshadow /etc/gshadow
+echo "OK"
+echo -n "no homedir (/home/test1)..."
+test -d /home/test1 && exit 1 || true
+echo "OK"
+echo -n "no homedir (/home/test2)..."
+test -d /home/test2 && exit 1 || true
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/10_usermod_rename_user.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/10_usermod_rename_user_in_group/group
===================================================================
--- debian/trunk/tests/usertools/01/10_usermod_rename_user_in_group/group	                        (rev 0)
+++ debian/trunk/tests/usertools/01/10_usermod_rename_user_in_group/group	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:x:0:
+daemon:x:1:test2
+bin:x:2:
+sys:x:3:
+adm:x:4:
+tty:x:5:
+disk:x:6:
+lp:x:7:
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:
+tape:x:26:
+sudo:x:27:
+audio:x:29:
+dip:x:30:
+www-data:x:33:
+backup:x:34:
+operator:x:37:
+list:x:38:
+irc:x:39:
+src:x:40:
+gnats:x:41:
+shadow:x:42:
+utmp:x:43:
+video:x:44:
+sasl:x:45:
+plugdev:x:46:
+staff:x:50:
+games:x:60:
+users:x:100:
+nogroup:x:65534:
+crontab:x:101:
+Debian-exim:x:102:
+test1:x:1000:

Added: debian/trunk/tests/usertools/01/10_usermod_rename_user_in_group/gshadow
===================================================================
--- debian/trunk/tests/usertools/01/10_usermod_rename_user_in_group/gshadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/10_usermod_rename_user_in_group/gshadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:*::
+daemon:*::test2
+bin:*::
+sys:*::
+adm:*::
+tty:*::
+disk:*::
+lp:*::
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*::
+voice:*::
+cdrom:*::
+floppy:*::
+tape:*::
+sudo:*::
+audio:*::
+dip:*::
+www-data:*::
+backup:*::
+operator:*::
+list:*::
+irc:*::
+src:*::
+gnats:*::
+shadow:*::
+utmp:*::
+video:*::
+sasl:*::
+plugdev:*::
+staff:*::
+games:*::
+users:*::
+nogroup:*::
+crontab:x::
+Debian-exim:x::
+test1:!::

Added: debian/trunk/tests/usertools/01/10_usermod_rename_user_in_group/passwd
===================================================================
--- debian/trunk/tests/usertools/01/10_usermod_rename_user_in_group/passwd	                        (rev 0)
+++ debian/trunk/tests/usertools/01/10_usermod_rename_user_in_group/passwd	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:x:0:0:root:/root:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+bin:x:2:2:bin:/bin:/bin/sh
+sys:x:3:3:sys:/dev:/bin/sh
+sync:x:4:65534:sync:/bin:/bin/sync
+games:x:5:60:games:/usr/games:/bin/sh
+man:x:6:12:man:/var/cache/man:/bin/sh
+lp:x:7:7:lp:/var/spool/lpd:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/var/spool/news:/bin/sh
+uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/var/www:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/var/list:/bin/sh
+irc:x:39:39:ircd:/var/run/ircd:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
+nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
+Debian-exim:x:102:102::/var/spool/exim4:/bin/false
+test2:x:1000:1000::/home/test1:/bin/sh

Added: debian/trunk/tests/usertools/01/10_usermod_rename_user_in_group/shadow
===================================================================
--- debian/trunk/tests/usertools/01/10_usermod_rename_user_in_group/shadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/10_usermod_rename_user_in_group/shadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
+daemon:*:12977:0:99999:7:::
+bin:*:12977:0:99999:7:::
+sys:*:12977:0:99999:7:::
+sync:*:12977:0:99999:7:::
+games:*:12977:0:99999:7:::
+man:*:12977:0:99999:7:::
+lp:*:12977:0:99999:7:::
+mail:*:12977:0:99999:7:::
+news:*:12977:0:99999:7:::
+uucp:*:12977:0:99999:7:::
+proxy:*:12977:0:99999:7:::
+www-data:*:12977:0:99999:7:::
+backup:*:12977:0:99999:7:::
+list:*:12977:0:99999:7:::
+irc:*:12977:0:99999:7:::
+gnats:*:12977:0:99999:7:::
+nobody:*:12977:0:99999:7:::
+Debian-exim:!:12977:0:99999:7:::
+test2:!:@TODAY@:0:99999:7:::

Added: debian/trunk/tests/usertools/01/10_usermod_rename_user_in_group.test
===================================================================
--- debian/trunk/tests/usertools/01/10_usermod_rename_user_in_group.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/10_usermod_rename_user_in_group.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Add a new user"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1 also in group daemon (useradd test1 -G daemon)..."
+useradd test1 -G daemon
+echo "OK"
+echo -n "Rename user test1 to test2 (usermod -l test2 test1)..."
+usermod -l test2 test1
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl 10_usermod_rename_user_in_group/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl 10_usermod_rename_user_in_group/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl 10_usermod_rename_user_in_group/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl 10_usermod_rename_user_in_group/gshadow /etc/gshadow
+echo "OK"
+echo -n "no homedir (/home/test1)..."
+test -d /home/test1 && exit 1 || true
+echo "OK"
+echo -n "no homedir (/home/test2)..."
+test -d /home/test2 && exit 1 || true
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/10_usermod_rename_user_in_group.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/11_usermod_change_password/group
===================================================================
--- debian/trunk/tests/usertools/01/11_usermod_change_password/group	                        (rev 0)
+++ debian/trunk/tests/usertools/01/11_usermod_change_password/group	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:x:0:
+daemon:x:1:
+bin:x:2:
+sys:x:3:
+adm:x:4:
+tty:x:5:
+disk:x:6:
+lp:x:7:
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:
+tape:x:26:
+sudo:x:27:
+audio:x:29:
+dip:x:30:
+www-data:x:33:
+backup:x:34:
+operator:x:37:
+list:x:38:
+irc:x:39:
+src:x:40:
+gnats:x:41:
+shadow:x:42:
+utmp:x:43:
+video:x:44:
+sasl:x:45:
+plugdev:x:46:
+staff:x:50:
+games:x:60:
+users:x:100:
+nogroup:x:65534:
+crontab:x:101:
+Debian-exim:x:102:
+test1:x:1000:

Added: debian/trunk/tests/usertools/01/11_usermod_change_password/gshadow
===================================================================
--- debian/trunk/tests/usertools/01/11_usermod_change_password/gshadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/11_usermod_change_password/gshadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:*::
+daemon:*::
+bin:*::
+sys:*::
+adm:*::
+tty:*::
+disk:*::
+lp:*::
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*::
+voice:*::
+cdrom:*::
+floppy:*::
+tape:*::
+sudo:*::
+audio:*::
+dip:*::
+www-data:*::
+backup:*::
+operator:*::
+list:*::
+irc:*::
+src:*::
+gnats:*::
+shadow:*::
+utmp:*::
+video:*::
+sasl:*::
+plugdev:*::
+staff:*::
+games:*::
+users:*::
+nogroup:*::
+crontab:x::
+Debian-exim:x::
+test1:!::

Added: debian/trunk/tests/usertools/01/11_usermod_change_password/passwd
===================================================================
--- debian/trunk/tests/usertools/01/11_usermod_change_password/passwd	                        (rev 0)
+++ debian/trunk/tests/usertools/01/11_usermod_change_password/passwd	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:x:0:0:root:/root:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+bin:x:2:2:bin:/bin:/bin/sh
+sys:x:3:3:sys:/dev:/bin/sh
+sync:x:4:65534:sync:/bin:/bin/sync
+games:x:5:60:games:/usr/games:/bin/sh
+man:x:6:12:man:/var/cache/man:/bin/sh
+lp:x:7:7:lp:/var/spool/lpd:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/var/spool/news:/bin/sh
+uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/var/www:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/var/list:/bin/sh
+irc:x:39:39:ircd:/var/run/ircd:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
+nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
+Debian-exim:x:102:102::/var/spool/exim4:/bin/false
+test1:x:1000:1000::/home/test1:/bin/sh

Added: debian/trunk/tests/usertools/01/11_usermod_change_password/shadow
===================================================================
--- debian/trunk/tests/usertools/01/11_usermod_change_password/shadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/11_usermod_change_password/shadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
+daemon:*:12977:0:99999:7:::
+bin:*:12977:0:99999:7:::
+sys:*:12977:0:99999:7:::
+sync:*:12977:0:99999:7:::
+games:*:12977:0:99999:7:::
+man:*:12977:0:99999:7:::
+lp:*:12977:0:99999:7:::
+mail:*:12977:0:99999:7:::
+news:*:12977:0:99999:7:::
+uucp:*:12977:0:99999:7:::
+proxy:*:12977:0:99999:7:::
+www-data:*:12977:0:99999:7:::
+backup:*:12977:0:99999:7:::
+list:*:12977:0:99999:7:::
+irc:*:12977:0:99999:7:::
+gnats:*:12977:0:99999:7:::
+nobody:*:12977:0:99999:7:::
+Debian-exim:!:12977:0:99999:7:::
+test1:$1$12345678$0jEt1CYOyE.5NxWFMZyZy1:@TODAY@:0:99999:7:::

Added: debian/trunk/tests/usertools/01/11_usermod_change_password.test
===================================================================
--- debian/trunk/tests/usertools/01/11_usermod_change_password.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/11_usermod_change_password.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Add a new user"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1 (useradd test1)..."
+useradd test1
+echo "OK"
+echo -n "Change user's password..."
+usermod -p '$1$12345678$0jEt1CYOyE.5NxWFMZyZy1' test1
+# (test1F00barbaz)
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl 11_usermod_change_password/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl 11_usermod_change_password/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl 11_usermod_change_password/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl 11_usermod_change_password/gshadow /etc/gshadow
+echo "OK"
+echo -n "no homedir..."
+test -d /home/test1 && exit 1 || true
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/11_usermod_change_password.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/11_usermod_lock_password/group
===================================================================
--- debian/trunk/tests/usertools/01/11_usermod_lock_password/group	                        (rev 0)
+++ debian/trunk/tests/usertools/01/11_usermod_lock_password/group	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:x:0:
+daemon:x:1:
+bin:x:2:
+sys:x:3:
+adm:x:4:
+tty:x:5:
+disk:x:6:
+lp:x:7:
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:
+tape:x:26:
+sudo:x:27:
+audio:x:29:
+dip:x:30:
+www-data:x:33:
+backup:x:34:
+operator:x:37:
+list:x:38:
+irc:x:39:
+src:x:40:
+gnats:x:41:
+shadow:x:42:
+utmp:x:43:
+video:x:44:
+sasl:x:45:
+plugdev:x:46:
+staff:x:50:
+games:x:60:
+users:x:100:
+nogroup:x:65534:
+crontab:x:101:
+Debian-exim:x:102:
+test1:x:1000:

Added: debian/trunk/tests/usertools/01/11_usermod_lock_password/gshadow
===================================================================
--- debian/trunk/tests/usertools/01/11_usermod_lock_password/gshadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/11_usermod_lock_password/gshadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:*::
+daemon:*::
+bin:*::
+sys:*::
+adm:*::
+tty:*::
+disk:*::
+lp:*::
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*::
+voice:*::
+cdrom:*::
+floppy:*::
+tape:*::
+sudo:*::
+audio:*::
+dip:*::
+www-data:*::
+backup:*::
+operator:*::
+list:*::
+irc:*::
+src:*::
+gnats:*::
+shadow:*::
+utmp:*::
+video:*::
+sasl:*::
+plugdev:*::
+staff:*::
+games:*::
+users:*::
+nogroup:*::
+crontab:x::
+Debian-exim:x::
+test1:!::

Added: debian/trunk/tests/usertools/01/11_usermod_lock_password/passwd
===================================================================
--- debian/trunk/tests/usertools/01/11_usermod_lock_password/passwd	                        (rev 0)
+++ debian/trunk/tests/usertools/01/11_usermod_lock_password/passwd	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:x:0:0:root:/root:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+bin:x:2:2:bin:/bin:/bin/sh
+sys:x:3:3:sys:/dev:/bin/sh
+sync:x:4:65534:sync:/bin:/bin/sync
+games:x:5:60:games:/usr/games:/bin/sh
+man:x:6:12:man:/var/cache/man:/bin/sh
+lp:x:7:7:lp:/var/spool/lpd:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/var/spool/news:/bin/sh
+uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/var/www:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/var/list:/bin/sh
+irc:x:39:39:ircd:/var/run/ircd:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
+nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
+Debian-exim:x:102:102::/var/spool/exim4:/bin/false
+test1:x:1000:1000::/home/test1:/bin/sh

Added: debian/trunk/tests/usertools/01/11_usermod_lock_password/shadow
===================================================================
--- debian/trunk/tests/usertools/01/11_usermod_lock_password/shadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/11_usermod_lock_password/shadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
+daemon:*:12977:0:99999:7:::
+bin:*:12977:0:99999:7:::
+sys:*:12977:0:99999:7:::
+sync:*:12977:0:99999:7:::
+games:*:12977:0:99999:7:::
+man:*:12977:0:99999:7:::
+lp:*:12977:0:99999:7:::
+mail:*:12977:0:99999:7:::
+news:*:12977:0:99999:7:::
+uucp:*:12977:0:99999:7:::
+proxy:*:12977:0:99999:7:::
+www-data:*:12977:0:99999:7:::
+backup:*:12977:0:99999:7:::
+list:*:12977:0:99999:7:::
+irc:*:12977:0:99999:7:::
+gnats:*:12977:0:99999:7:::
+nobody:*:12977:0:99999:7:::
+Debian-exim:!:12977:0:99999:7:::
+test1:!$1$12345678$0jEt1CYOyE.5NxWFMZyZy1:@TODAY@:0:99999:7:::

Added: debian/trunk/tests/usertools/01/11_usermod_lock_password.test
===================================================================
--- debian/trunk/tests/usertools/01/11_usermod_lock_password.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/11_usermod_lock_password.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Add a new user"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1 (useradd test1)..."
+useradd test1
+echo "OK"
+echo -n "Change user's password..."
+usermod -p '$1$12345678$0jEt1CYOyE.5NxWFMZyZy1' test1
+# (test1F00barbaz)
+echo "OK"
+echo -n "Lock user's password..."
+usermod -L test1
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl 11_usermod_lock_password/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl 11_usermod_lock_password/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl 11_usermod_lock_password/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl 11_usermod_lock_password/gshadow /etc/gshadow
+echo "OK"
+echo -n "no homedir..."
+test -d /home/test1 && exit 1 || true
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/11_usermod_lock_password.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/11_usermod_unlock_empty_password/group
===================================================================
--- debian/trunk/tests/usertools/01/11_usermod_unlock_empty_password/group	                        (rev 0)
+++ debian/trunk/tests/usertools/01/11_usermod_unlock_empty_password/group	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:x:0:
+daemon:x:1:
+bin:x:2:
+sys:x:3:
+adm:x:4:
+tty:x:5:
+disk:x:6:
+lp:x:7:
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:
+tape:x:26:
+sudo:x:27:
+audio:x:29:
+dip:x:30:
+www-data:x:33:
+backup:x:34:
+operator:x:37:
+list:x:38:
+irc:x:39:
+src:x:40:
+gnats:x:41:
+shadow:x:42:
+utmp:x:43:
+video:x:44:
+sasl:x:45:
+plugdev:x:46:
+staff:x:50:
+games:x:60:
+users:x:100:
+nogroup:x:65534:
+crontab:x:101:
+Debian-exim:x:102:
+test1:x:1000:

Added: debian/trunk/tests/usertools/01/11_usermod_unlock_empty_password/gshadow
===================================================================
--- debian/trunk/tests/usertools/01/11_usermod_unlock_empty_password/gshadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/11_usermod_unlock_empty_password/gshadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:*::
+daemon:*::
+bin:*::
+sys:*::
+adm:*::
+tty:*::
+disk:*::
+lp:*::
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*::
+voice:*::
+cdrom:*::
+floppy:*::
+tape:*::
+sudo:*::
+audio:*::
+dip:*::
+www-data:*::
+backup:*::
+operator:*::
+list:*::
+irc:*::
+src:*::
+gnats:*::
+shadow:*::
+utmp:*::
+video:*::
+sasl:*::
+plugdev:*::
+staff:*::
+games:*::
+users:*::
+nogroup:*::
+crontab:x::
+Debian-exim:x::
+test1:!::

Added: debian/trunk/tests/usertools/01/11_usermod_unlock_empty_password/passwd
===================================================================
--- debian/trunk/tests/usertools/01/11_usermod_unlock_empty_password/passwd	                        (rev 0)
+++ debian/trunk/tests/usertools/01/11_usermod_unlock_empty_password/passwd	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:x:0:0:root:/root:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+bin:x:2:2:bin:/bin:/bin/sh
+sys:x:3:3:sys:/dev:/bin/sh
+sync:x:4:65534:sync:/bin:/bin/sync
+games:x:5:60:games:/usr/games:/bin/sh
+man:x:6:12:man:/var/cache/man:/bin/sh
+lp:x:7:7:lp:/var/spool/lpd:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/var/spool/news:/bin/sh
+uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/var/www:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/var/list:/bin/sh
+irc:x:39:39:ircd:/var/run/ircd:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
+nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
+Debian-exim:x:102:102::/var/spool/exim4:/bin/false
+test1:x:1000:1000::/home/test1:/bin/sh

Added: debian/trunk/tests/usertools/01/11_usermod_unlock_empty_password/shadow
===================================================================
--- debian/trunk/tests/usertools/01/11_usermod_unlock_empty_password/shadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/11_usermod_unlock_empty_password/shadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
+daemon:*:12977:0:99999:7:::
+bin:*:12977:0:99999:7:::
+sys:*:12977:0:99999:7:::
+sync:*:12977:0:99999:7:::
+games:*:12977:0:99999:7:::
+man:*:12977:0:99999:7:::
+lp:*:12977:0:99999:7:::
+mail:*:12977:0:99999:7:::
+news:*:12977:0:99999:7:::
+uucp:*:12977:0:99999:7:::
+proxy:*:12977:0:99999:7:::
+www-data:*:12977:0:99999:7:::
+backup:*:12977:0:99999:7:::
+list:*:12977:0:99999:7:::
+irc:*:12977:0:99999:7:::
+gnats:*:12977:0:99999:7:::
+nobody:*:12977:0:99999:7:::
+Debian-exim:!:12977:0:99999:7:::
+test1:!:@TODAY@:0:99999:7:::

Added: debian/trunk/tests/usertools/01/11_usermod_unlock_empty_password/usermod.err
===================================================================
--- debian/trunk/tests/usertools/01/11_usermod_unlock_empty_password/usermod.err	                        (rev 0)
+++ debian/trunk/tests/usertools/01/11_usermod_unlock_empty_password/usermod.err	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,2 @@
+usermod: unlocking the user would result in a passwordless account.
+You should set a password with usermod -p to unlock this user account.

Added: debian/trunk/tests/usertools/01/11_usermod_unlock_empty_password.test
===================================================================
--- debian/trunk/tests/usertools/01/11_usermod_unlock_empty_password.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/11_usermod_unlock_empty_password.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Add a new user"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1 (useradd test1)..."
+useradd test1
+echo "OK"
+echo -n "Unlock user's password..."
+usermod -U test1 2>tmp/err
+echo "OK"
+
+echo "usermod displayed:"
+echo "======================================================================="
+cat tmp/err
+echo "======================================================================="
+echo -n "Check that there were a failure message..."
+diff -au 11_usermod_unlock_empty_password/usermod.err tmp/err
+echo "error message OK."
+rm -f tmp/err
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl 11_usermod_unlock_empty_password/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl 11_usermod_unlock_empty_password/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl 11_usermod_unlock_empty_password/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl 11_usermod_unlock_empty_password/gshadow /etc/gshadow
+echo "OK"
+echo -n "no homedir..."
+test -d /home/test1 && exit 1 || true
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/11_usermod_unlock_empty_password.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/11_usermod_unlock_password/group
===================================================================
--- debian/trunk/tests/usertools/01/11_usermod_unlock_password/group	                        (rev 0)
+++ debian/trunk/tests/usertools/01/11_usermod_unlock_password/group	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:x:0:
+daemon:x:1:
+bin:x:2:
+sys:x:3:
+adm:x:4:
+tty:x:5:
+disk:x:6:
+lp:x:7:
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:
+tape:x:26:
+sudo:x:27:
+audio:x:29:
+dip:x:30:
+www-data:x:33:
+backup:x:34:
+operator:x:37:
+list:x:38:
+irc:x:39:
+src:x:40:
+gnats:x:41:
+shadow:x:42:
+utmp:x:43:
+video:x:44:
+sasl:x:45:
+plugdev:x:46:
+staff:x:50:
+games:x:60:
+users:x:100:
+nogroup:x:65534:
+crontab:x:101:
+Debian-exim:x:102:
+test1:x:1000:

Added: debian/trunk/tests/usertools/01/11_usermod_unlock_password/gshadow
===================================================================
--- debian/trunk/tests/usertools/01/11_usermod_unlock_password/gshadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/11_usermod_unlock_password/gshadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:*::
+daemon:*::
+bin:*::
+sys:*::
+adm:*::
+tty:*::
+disk:*::
+lp:*::
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*::
+voice:*::
+cdrom:*::
+floppy:*::
+tape:*::
+sudo:*::
+audio:*::
+dip:*::
+www-data:*::
+backup:*::
+operator:*::
+list:*::
+irc:*::
+src:*::
+gnats:*::
+shadow:*::
+utmp:*::
+video:*::
+sasl:*::
+plugdev:*::
+staff:*::
+games:*::
+users:*::
+nogroup:*::
+crontab:x::
+Debian-exim:x::
+test1:!::

Added: debian/trunk/tests/usertools/01/11_usermod_unlock_password/passwd
===================================================================
--- debian/trunk/tests/usertools/01/11_usermod_unlock_password/passwd	                        (rev 0)
+++ debian/trunk/tests/usertools/01/11_usermod_unlock_password/passwd	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:x:0:0:root:/root:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+bin:x:2:2:bin:/bin:/bin/sh
+sys:x:3:3:sys:/dev:/bin/sh
+sync:x:4:65534:sync:/bin:/bin/sync
+games:x:5:60:games:/usr/games:/bin/sh
+man:x:6:12:man:/var/cache/man:/bin/sh
+lp:x:7:7:lp:/var/spool/lpd:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/var/spool/news:/bin/sh
+uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/var/www:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/var/list:/bin/sh
+irc:x:39:39:ircd:/var/run/ircd:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
+nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
+Debian-exim:x:102:102::/var/spool/exim4:/bin/false
+test1:x:1000:1000::/home/test1:/bin/sh

Added: debian/trunk/tests/usertools/01/11_usermod_unlock_password/shadow
===================================================================
--- debian/trunk/tests/usertools/01/11_usermod_unlock_password/shadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/11_usermod_unlock_password/shadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
+daemon:*:12977:0:99999:7:::
+bin:*:12977:0:99999:7:::
+sys:*:12977:0:99999:7:::
+sync:*:12977:0:99999:7:::
+games:*:12977:0:99999:7:::
+man:*:12977:0:99999:7:::
+lp:*:12977:0:99999:7:::
+mail:*:12977:0:99999:7:::
+news:*:12977:0:99999:7:::
+uucp:*:12977:0:99999:7:::
+proxy:*:12977:0:99999:7:::
+www-data:*:12977:0:99999:7:::
+backup:*:12977:0:99999:7:::
+list:*:12977:0:99999:7:::
+irc:*:12977:0:99999:7:::
+gnats:*:12977:0:99999:7:::
+nobody:*:12977:0:99999:7:::
+Debian-exim:!:12977:0:99999:7:::
+test1:$1$12345678$0jEt1CYOyE.5NxWFMZyZy1:@TODAY@:0:99999:7:::

Added: debian/trunk/tests/usertools/01/11_usermod_unlock_password.test
===================================================================
--- debian/trunk/tests/usertools/01/11_usermod_unlock_password.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/11_usermod_unlock_password.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Add a new user"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1 (useradd test1)..."
+useradd test1
+echo "OK"
+echo -n "Change user's password..."
+usermod -p '$1$12345678$0jEt1CYOyE.5NxWFMZyZy1' test1
+# (test1F00barbaz)
+echo "OK"
+echo -n "Lock user's password..."
+usermod -L test1
+echo "OK"
+echo -n "Unlock user's password..."
+usermod -U test1
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl 11_usermod_unlock_password/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl 11_usermod_unlock_password/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl 11_usermod_unlock_password/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl 11_usermod_unlock_password/gshadow /etc/gshadow
+echo "OK"
+echo -n "no homedir..."
+test -d /home/test1 && exit 1 || true
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/11_usermod_unlock_password.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/12_usermod_change_gid_name/group
===================================================================
--- debian/trunk/tests/usertools/01/12_usermod_change_gid_name/group	                        (rev 0)
+++ debian/trunk/tests/usertools/01/12_usermod_change_gid_name/group	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:x:0:
+daemon:x:1:
+bin:x:2:
+sys:x:3:
+adm:x:4:
+tty:x:5:
+disk:x:6:
+lp:x:7:
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:
+tape:x:26:
+sudo:x:27:
+audio:x:29:
+dip:x:30:
+www-data:x:33:
+backup:x:34:
+operator:x:37:
+list:x:38:
+irc:x:39:
+src:x:40:
+gnats:x:41:
+shadow:x:42:
+utmp:x:43:
+video:x:44:
+sasl:x:45:
+plugdev:x:46:
+staff:x:50:
+games:x:60:
+users:x:100:
+nogroup:x:65534:
+crontab:x:101:
+Debian-exim:x:102:
+test1:x:1000:

Added: debian/trunk/tests/usertools/01/12_usermod_change_gid_name/gshadow
===================================================================
--- debian/trunk/tests/usertools/01/12_usermod_change_gid_name/gshadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/12_usermod_change_gid_name/gshadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:*::
+daemon:*::
+bin:*::
+sys:*::
+adm:*::
+tty:*::
+disk:*::
+lp:*::
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*::
+voice:*::
+cdrom:*::
+floppy:*::
+tape:*::
+sudo:*::
+audio:*::
+dip:*::
+www-data:*::
+backup:*::
+operator:*::
+list:*::
+irc:*::
+src:*::
+gnats:*::
+shadow:*::
+utmp:*::
+video:*::
+sasl:*::
+plugdev:*::
+staff:*::
+games:*::
+users:*::
+nogroup:*::
+crontab:x::
+Debian-exim:x::
+test1:!::

Added: debian/trunk/tests/usertools/01/12_usermod_change_gid_name/passwd
===================================================================
--- debian/trunk/tests/usertools/01/12_usermod_change_gid_name/passwd	                        (rev 0)
+++ debian/trunk/tests/usertools/01/12_usermod_change_gid_name/passwd	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:x:0:0:root:/root:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+bin:x:2:2:bin:/bin:/bin/sh
+sys:x:3:3:sys:/dev:/bin/sh
+sync:x:4:65534:sync:/bin:/bin/sync
+games:x:5:60:games:/usr/games:/bin/sh
+man:x:6:12:man:/var/cache/man:/bin/sh
+lp:x:7:7:lp:/var/spool/lpd:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/var/spool/news:/bin/sh
+uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/var/www:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/var/list:/bin/sh
+irc:x:39:39:ircd:/var/run/ircd:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
+nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
+Debian-exim:x:102:102::/var/spool/exim4:/bin/false
+test1:x:1000:1::/home/test1:/bin/sh

Added: debian/trunk/tests/usertools/01/12_usermod_change_gid_name/shadow
===================================================================
--- debian/trunk/tests/usertools/01/12_usermod_change_gid_name/shadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/12_usermod_change_gid_name/shadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
+daemon:*:12977:0:99999:7:::
+bin:*:12977:0:99999:7:::
+sys:*:12977:0:99999:7:::
+sync:*:12977:0:99999:7:::
+games:*:12977:0:99999:7:::
+man:*:12977:0:99999:7:::
+lp:*:12977:0:99999:7:::
+mail:*:12977:0:99999:7:::
+news:*:12977:0:99999:7:::
+uucp:*:12977:0:99999:7:::
+proxy:*:12977:0:99999:7:::
+www-data:*:12977:0:99999:7:::
+backup:*:12977:0:99999:7:::
+list:*:12977:0:99999:7:::
+irc:*:12977:0:99999:7:::
+gnats:*:12977:0:99999:7:::
+nobody:*:12977:0:99999:7:::
+Debian-exim:!:12977:0:99999:7:::
+test1:!:@TODAY@:0:99999:7:::

Added: debian/trunk/tests/usertools/01/12_usermod_change_gid_name.test
===================================================================
--- debian/trunk/tests/usertools/01/12_usermod_change_gid_name.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/12_usermod_change_gid_name.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Add a new user"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1 (useradd test1)..."
+useradd test1
+echo "OK"
+echo -n "Change user's group..."
+usermod -g daemon test1
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl 12_usermod_change_gid_name/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl 12_usermod_change_gid_name/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl 12_usermod_change_gid_name/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl 12_usermod_change_gid_name/gshadow /etc/gshadow
+echo "OK"
+echo -n "no homedir..."
+test -d /home/test1 && exit 1 || true
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/12_usermod_change_gid_name.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/12_usermod_change_gid_number/group
===================================================================
--- debian/trunk/tests/usertools/01/12_usermod_change_gid_number/group	                        (rev 0)
+++ debian/trunk/tests/usertools/01/12_usermod_change_gid_number/group	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:x:0:
+daemon:x:1:
+bin:x:2:
+sys:x:3:
+adm:x:4:
+tty:x:5:
+disk:x:6:
+lp:x:7:
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:
+tape:x:26:
+sudo:x:27:
+audio:x:29:
+dip:x:30:
+www-data:x:33:
+backup:x:34:
+operator:x:37:
+list:x:38:
+irc:x:39:
+src:x:40:
+gnats:x:41:
+shadow:x:42:
+utmp:x:43:
+video:x:44:
+sasl:x:45:
+plugdev:x:46:
+staff:x:50:
+games:x:60:
+users:x:100:
+nogroup:x:65534:
+crontab:x:101:
+Debian-exim:x:102:
+test1:x:1000:

Added: debian/trunk/tests/usertools/01/12_usermod_change_gid_number/gshadow
===================================================================
--- debian/trunk/tests/usertools/01/12_usermod_change_gid_number/gshadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/12_usermod_change_gid_number/gshadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:*::
+daemon:*::
+bin:*::
+sys:*::
+adm:*::
+tty:*::
+disk:*::
+lp:*::
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*::
+voice:*::
+cdrom:*::
+floppy:*::
+tape:*::
+sudo:*::
+audio:*::
+dip:*::
+www-data:*::
+backup:*::
+operator:*::
+list:*::
+irc:*::
+src:*::
+gnats:*::
+shadow:*::
+utmp:*::
+video:*::
+sasl:*::
+plugdev:*::
+staff:*::
+games:*::
+users:*::
+nogroup:*::
+crontab:x::
+Debian-exim:x::
+test1:!::

Added: debian/trunk/tests/usertools/01/12_usermod_change_gid_number/passwd
===================================================================
--- debian/trunk/tests/usertools/01/12_usermod_change_gid_number/passwd	                        (rev 0)
+++ debian/trunk/tests/usertools/01/12_usermod_change_gid_number/passwd	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:x:0:0:root:/root:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+bin:x:2:2:bin:/bin:/bin/sh
+sys:x:3:3:sys:/dev:/bin/sh
+sync:x:4:65534:sync:/bin:/bin/sync
+games:x:5:60:games:/usr/games:/bin/sh
+man:x:6:12:man:/var/cache/man:/bin/sh
+lp:x:7:7:lp:/var/spool/lpd:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/var/spool/news:/bin/sh
+uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/var/www:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/var/list:/bin/sh
+irc:x:39:39:ircd:/var/run/ircd:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
+nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
+Debian-exim:x:102:102::/var/spool/exim4:/bin/false
+test1:x:1000:1::/home/test1:/bin/sh

Added: debian/trunk/tests/usertools/01/12_usermod_change_gid_number/shadow
===================================================================
--- debian/trunk/tests/usertools/01/12_usermod_change_gid_number/shadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/12_usermod_change_gid_number/shadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
+daemon:*:12977:0:99999:7:::
+bin:*:12977:0:99999:7:::
+sys:*:12977:0:99999:7:::
+sync:*:12977:0:99999:7:::
+games:*:12977:0:99999:7:::
+man:*:12977:0:99999:7:::
+lp:*:12977:0:99999:7:::
+mail:*:12977:0:99999:7:::
+news:*:12977:0:99999:7:::
+uucp:*:12977:0:99999:7:::
+proxy:*:12977:0:99999:7:::
+www-data:*:12977:0:99999:7:::
+backup:*:12977:0:99999:7:::
+list:*:12977:0:99999:7:::
+irc:*:12977:0:99999:7:::
+gnats:*:12977:0:99999:7:::
+nobody:*:12977:0:99999:7:::
+Debian-exim:!:12977:0:99999:7:::
+test1:!:@TODAY@:0:99999:7:::

Added: debian/trunk/tests/usertools/01/12_usermod_change_gid_number.test
===================================================================
--- debian/trunk/tests/usertools/01/12_usermod_change_gid_number.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/12_usermod_change_gid_number.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Add a new user"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1 (useradd test1)..."
+useradd test1
+echo "OK"
+echo -n "Change user's group..."
+usermod -g 1 test1
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl 12_usermod_change_gid_number/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl 12_usermod_change_gid_number/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl 12_usermod_change_gid_number/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl 12_usermod_change_gid_number/gshadow /etc/gshadow
+echo "OK"
+echo -n "no homedir..."
+test -d /home/test1 && exit 1 || true
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/12_usermod_change_gid_number.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/13_useradd_negative_UID/group
===================================================================
--- debian/trunk/tests/usertools/01/13_useradd_negative_UID/group	                        (rev 0)
+++ debian/trunk/tests/usertools/01/13_useradd_negative_UID/group	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,41 @@
+root:x:0:
+daemon:x:1:
+bin:x:2:
+sys:x:3:
+adm:x:4:
+tty:x:5:
+disk:x:6:
+lp:x:7:
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:
+tape:x:26:
+sudo:x:27:
+audio:x:29:
+dip:x:30:
+www-data:x:33:
+backup:x:34:
+operator:x:37:
+list:x:38:
+irc:x:39:
+src:x:40:
+gnats:x:41:
+shadow:x:42:
+utmp:x:43:
+video:x:44:
+sasl:x:45:
+plugdev:x:46:
+staff:x:50:
+games:x:60:
+users:x:100:
+nogroup:x:65534:
+crontab:x:101:
+Debian-exim:x:102:

Added: debian/trunk/tests/usertools/01/13_useradd_negative_UID/gshadow
===================================================================
--- debian/trunk/tests/usertools/01/13_useradd_negative_UID/gshadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/13_useradd_negative_UID/gshadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,41 @@
+root:*::
+daemon:*::
+bin:*::
+sys:*::
+adm:*::
+tty:*::
+disk:*::
+lp:*::
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*::
+voice:*::
+cdrom:*::
+floppy:*::
+tape:*::
+sudo:*::
+audio:*::
+dip:*::
+www-data:*::
+backup:*::
+operator:*::
+list:*::
+irc:*::
+src:*::
+gnats:*::
+shadow:*::
+utmp:*::
+video:*::
+sasl:*::
+plugdev:*::
+staff:*::
+games:*::
+users:*::
+nogroup:*::
+crontab:x::
+Debian-exim:x::

Added: debian/trunk/tests/usertools/01/13_useradd_negative_UID/passwd
===================================================================
--- debian/trunk/tests/usertools/01/13_useradd_negative_UID/passwd	                        (rev 0)
+++ debian/trunk/tests/usertools/01/13_useradd_negative_UID/passwd	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,19 @@
+root:x:0:0:root:/root:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+bin:x:2:2:bin:/bin:/bin/sh
+sys:x:3:3:sys:/dev:/bin/sh
+sync:x:4:65534:sync:/bin:/bin/sync
+games:x:5:60:games:/usr/games:/bin/sh
+man:x:6:12:man:/var/cache/man:/bin/sh
+lp:x:7:7:lp:/var/spool/lpd:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/var/spool/news:/bin/sh
+uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/var/www:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/var/list:/bin/sh
+irc:x:39:39:ircd:/var/run/ircd:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
+nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
+Debian-exim:x:102:102::/var/spool/exim4:/bin/false

Added: debian/trunk/tests/usertools/01/13_useradd_negative_UID/shadow
===================================================================
--- debian/trunk/tests/usertools/01/13_useradd_negative_UID/shadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/13_useradd_negative_UID/shadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,19 @@
+root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
+daemon:*:12977:0:99999:7:::
+bin:*:12977:0:99999:7:::
+sys:*:12977:0:99999:7:::
+sync:*:12977:0:99999:7:::
+games:*:12977:0:99999:7:::
+man:*:12977:0:99999:7:::
+lp:*:12977:0:99999:7:::
+mail:*:12977:0:99999:7:::
+news:*:12977:0:99999:7:::
+uucp:*:12977:0:99999:7:::
+proxy:*:12977:0:99999:7:::
+www-data:*:12977:0:99999:7:::
+backup:*:12977:0:99999:7:::
+list:*:12977:0:99999:7:::
+irc:*:12977:0:99999:7:::
+gnats:*:12977:0:99999:7:::
+nobody:*:12977:0:99999:7:::
+Debian-exim:!:12977:0:99999:7:::

Added: debian/trunk/tests/usertools/01/13_useradd_negative_UID.test
===================================================================
--- debian/trunk/tests/usertools/01/13_useradd_negative_UID.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/13_useradd_negative_UID.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Add a new user"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1 with a negative UID (useradd -u -1 test1)..."
+msg=$(useradd -u -1 test1 2>&1) && exit 1 || {
+	status=$?
+}
+echo "OK"
+echo "useradd returned status $status,"
+echo "and displayed \"$msg\""
+echo -n "The returned status should be 3..."
+test "$status" = "3"
+echo "OK"
+echo -n "Test the error message (should be \"useradd: invalid numeric argument '-1'\")..."
+test "$msg" = "useradd: invalid numeric argument '-1'"
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl 13_useradd_negative_UID/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl 13_useradd_negative_UID/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl 13_useradd_negative_UID/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl 13_useradd_negative_UID/gshadow /etc/gshadow
+echo "OK"
+echo -n "no homedir..."
+test -d /home/test1 && exit 1 || true
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/13_useradd_negative_UID.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/14_useradd_out_of_range_UID/group
===================================================================
--- debian/trunk/tests/usertools/01/14_useradd_out_of_range_UID/group	                        (rev 0)
+++ debian/trunk/tests/usertools/01/14_useradd_out_of_range_UID/group	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,41 @@
+root:x:0:
+daemon:x:1:
+bin:x:2:
+sys:x:3:
+adm:x:4:
+tty:x:5:
+disk:x:6:
+lp:x:7:
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:
+tape:x:26:
+sudo:x:27:
+audio:x:29:
+dip:x:30:
+www-data:x:33:
+backup:x:34:
+operator:x:37:
+list:x:38:
+irc:x:39:
+src:x:40:
+gnats:x:41:
+shadow:x:42:
+utmp:x:43:
+video:x:44:
+sasl:x:45:
+plugdev:x:46:
+staff:x:50:
+games:x:60:
+users:x:100:
+nogroup:x:65534:
+crontab:x:101:
+Debian-exim:x:102:

Added: debian/trunk/tests/usertools/01/14_useradd_out_of_range_UID/gshadow
===================================================================
--- debian/trunk/tests/usertools/01/14_useradd_out_of_range_UID/gshadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/14_useradd_out_of_range_UID/gshadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,41 @@
+root:*::
+daemon:*::
+bin:*::
+sys:*::
+adm:*::
+tty:*::
+disk:*::
+lp:*::
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*::
+voice:*::
+cdrom:*::
+floppy:*::
+tape:*::
+sudo:*::
+audio:*::
+dip:*::
+www-data:*::
+backup:*::
+operator:*::
+list:*::
+irc:*::
+src:*::
+gnats:*::
+shadow:*::
+utmp:*::
+video:*::
+sasl:*::
+plugdev:*::
+staff:*::
+games:*::
+users:*::
+nogroup:*::
+crontab:x::
+Debian-exim:x::

Added: debian/trunk/tests/usertools/01/14_useradd_out_of_range_UID/passwd
===================================================================
--- debian/trunk/tests/usertools/01/14_useradd_out_of_range_UID/passwd	                        (rev 0)
+++ debian/trunk/tests/usertools/01/14_useradd_out_of_range_UID/passwd	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,19 @@
+root:x:0:0:root:/root:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+bin:x:2:2:bin:/bin:/bin/sh
+sys:x:3:3:sys:/dev:/bin/sh
+sync:x:4:65534:sync:/bin:/bin/sync
+games:x:5:60:games:/usr/games:/bin/sh
+man:x:6:12:man:/var/cache/man:/bin/sh
+lp:x:7:7:lp:/var/spool/lpd:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/var/spool/news:/bin/sh
+uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/var/www:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/var/list:/bin/sh
+irc:x:39:39:ircd:/var/run/ircd:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
+nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
+Debian-exim:x:102:102::/var/spool/exim4:/bin/false

Added: debian/trunk/tests/usertools/01/14_useradd_out_of_range_UID/shadow
===================================================================
--- debian/trunk/tests/usertools/01/14_useradd_out_of_range_UID/shadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/14_useradd_out_of_range_UID/shadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,19 @@
+root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
+daemon:*:12977:0:99999:7:::
+bin:*:12977:0:99999:7:::
+sys:*:12977:0:99999:7:::
+sync:*:12977:0:99999:7:::
+games:*:12977:0:99999:7:::
+man:*:12977:0:99999:7:::
+lp:*:12977:0:99999:7:::
+mail:*:12977:0:99999:7:::
+news:*:12977:0:99999:7:::
+uucp:*:12977:0:99999:7:::
+proxy:*:12977:0:99999:7:::
+www-data:*:12977:0:99999:7:::
+backup:*:12977:0:99999:7:::
+list:*:12977:0:99999:7:::
+irc:*:12977:0:99999:7:::
+gnats:*:12977:0:99999:7:::
+nobody:*:12977:0:99999:7:::
+Debian-exim:!:12977:0:99999:7:::

Added: debian/trunk/tests/usertools/01/14_useradd_out_of_range_UID.test
===================================================================
--- debian/trunk/tests/usertools/01/14_useradd_out_of_range_UID.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/14_useradd_out_of_range_UID.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Add a new user"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1 with UID 2147483648 (useradd -u 2147483648 test1)..."
+msg=$(useradd -u 2147483648 test1 2>&1) && exit 1 || {
+	status=$?
+}
+echo "OK"
+echo "useradd returned status $status,"
+echo "and displayed \"$msg\""
+echo -n "The returned status should be 3..."
+test "$status" = "3"
+echo "OK"
+echo -n "Test the error message (should be \"useradd: invalid numeric argument '2147483648'\")..."
+test "$msg" = "useradd: invalid numeric argument '2147483648'"
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl 14_useradd_out_of_range_UID/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl 14_useradd_out_of_range_UID/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl 14_useradd_out_of_range_UID/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl 14_useradd_out_of_range_UID/gshadow /etc/gshadow
+echo "OK"
+echo -n "no homedir..."
+test -d /home/test1 && exit 1 || true
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/14_useradd_out_of_range_UID.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/15_useradd_specified_large_UID/group
===================================================================
--- debian/trunk/tests/usertools/01/15_useradd_specified_large_UID/group	                        (rev 0)
+++ debian/trunk/tests/usertools/01/15_useradd_specified_large_UID/group	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:x:0:
+daemon:x:1:
+bin:x:2:
+sys:x:3:
+adm:x:4:
+tty:x:5:
+disk:x:6:
+lp:x:7:
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:
+tape:x:26:
+sudo:x:27:
+audio:x:29:
+dip:x:30:
+www-data:x:33:
+backup:x:34:
+operator:x:37:
+list:x:38:
+irc:x:39:
+src:x:40:
+gnats:x:41:
+shadow:x:42:
+utmp:x:43:
+video:x:44:
+sasl:x:45:
+plugdev:x:46:
+staff:x:50:
+games:x:60:
+users:x:100:
+nogroup:x:65534:
+crontab:x:101:
+Debian-exim:x:102:
+test1:x:2147483647:

Added: debian/trunk/tests/usertools/01/15_useradd_specified_large_UID/gshadow
===================================================================
--- debian/trunk/tests/usertools/01/15_useradd_specified_large_UID/gshadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/15_useradd_specified_large_UID/gshadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:*::
+daemon:*::
+bin:*::
+sys:*::
+adm:*::
+tty:*::
+disk:*::
+lp:*::
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*::
+voice:*::
+cdrom:*::
+floppy:*::
+tape:*::
+sudo:*::
+audio:*::
+dip:*::
+www-data:*::
+backup:*::
+operator:*::
+list:*::
+irc:*::
+src:*::
+gnats:*::
+shadow:*::
+utmp:*::
+video:*::
+sasl:*::
+plugdev:*::
+staff:*::
+games:*::
+users:*::
+nogroup:*::
+crontab:x::
+Debian-exim:x::
+test1:!::

Added: debian/trunk/tests/usertools/01/15_useradd_specified_large_UID/passwd
===================================================================
--- debian/trunk/tests/usertools/01/15_useradd_specified_large_UID/passwd	                        (rev 0)
+++ debian/trunk/tests/usertools/01/15_useradd_specified_large_UID/passwd	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:x:0:0:root:/root:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+bin:x:2:2:bin:/bin:/bin/sh
+sys:x:3:3:sys:/dev:/bin/sh
+sync:x:4:65534:sync:/bin:/bin/sync
+games:x:5:60:games:/usr/games:/bin/sh
+man:x:6:12:man:/var/cache/man:/bin/sh
+lp:x:7:7:lp:/var/spool/lpd:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/var/spool/news:/bin/sh
+uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/var/www:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/var/list:/bin/sh
+irc:x:39:39:ircd:/var/run/ircd:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
+nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
+Debian-exim:x:102:102::/var/spool/exim4:/bin/false
+test1:x:2147483647:2147483647::/home/test1:/bin/sh

Added: debian/trunk/tests/usertools/01/15_useradd_specified_large_UID/shadow
===================================================================
--- debian/trunk/tests/usertools/01/15_useradd_specified_large_UID/shadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/15_useradd_specified_large_UID/shadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
+daemon:*:12977:0:99999:7:::
+bin:*:12977:0:99999:7:::
+sys:*:12977:0:99999:7:::
+sync:*:12977:0:99999:7:::
+games:*:12977:0:99999:7:::
+man:*:12977:0:99999:7:::
+lp:*:12977:0:99999:7:::
+mail:*:12977:0:99999:7:::
+news:*:12977:0:99999:7:::
+uucp:*:12977:0:99999:7:::
+proxy:*:12977:0:99999:7:::
+www-data:*:12977:0:99999:7:::
+backup:*:12977:0:99999:7:::
+list:*:12977:0:99999:7:::
+irc:*:12977:0:99999:7:::
+gnats:*:12977:0:99999:7:::
+nobody:*:12977:0:99999:7:::
+Debian-exim:!:12977:0:99999:7:::
+test1:!:@TODAY@:0:99999:7:::

Added: debian/trunk/tests/usertools/01/15_useradd_specified_large_UID.test
===================================================================
--- debian/trunk/tests/usertools/01/15_useradd_specified_large_UID.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/15_useradd_specified_large_UID.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Add a new user with a specified ID"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1 (useradd -u 2147483647 test1)..."
+useradd -u 2147483647 test1
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl 15_useradd_specified_large_UID/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl 15_useradd_specified_large_UID/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl 15_useradd_specified_large_UID/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl 15_useradd_specified_large_UID/gshadow /etc/gshadow
+echo "OK"
+echo -n "no homedir..."
+test -d /home/test1 && exit 1 || true
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/15_useradd_specified_large_UID.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/16_useradd_add_user_to_multiple_groups/group
===================================================================
--- debian/trunk/tests/usertools/01/16_useradd_add_user_to_multiple_groups/group	                        (rev 0)
+++ debian/trunk/tests/usertools/01/16_useradd_add_user_to_multiple_groups/group	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,41 @@
+root:x:0:
+daemon:x:1:test1
+bin:x:2:test1
+sys:x:3:
+adm:x:4:
+tty:x:5:
+disk:x:6:
+lp:x:7:
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:
+tape:x:26:
+sudo:x:27:
+audio:x:29:
+dip:x:30:
+www-data:x:33:
+backup:x:34:
+operator:x:37:
+list:x:38:
+irc:x:39:
+src:x:40:test1
+gnats:x:41:
+shadow:x:42:
+utmp:x:43:
+video:x:44:
+sasl:x:45:
+plugdev:x:46:
+staff:x:50:
+games:x:60:
+users:x:100:
+nogroup:x:65534:
+crontab:x:101:
+Debian-exim:x:102:

Added: debian/trunk/tests/usertools/01/16_useradd_add_user_to_multiple_groups/gshadow
===================================================================
--- debian/trunk/tests/usertools/01/16_useradd_add_user_to_multiple_groups/gshadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/16_useradd_add_user_to_multiple_groups/gshadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,41 @@
+root:*::
+daemon:*::test1
+bin:*::test1
+sys:*::
+adm:*::
+tty:*::
+disk:*::
+lp:*::
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*::
+voice:*::
+cdrom:*::
+floppy:*::
+tape:*::
+sudo:*::
+audio:*::
+dip:*::
+www-data:*::
+backup:*::
+operator:*::
+list:*::
+irc:*::
+src:*::test1
+gnats:*::
+shadow:*::
+utmp:*::
+video:*::
+sasl:*::
+plugdev:*::
+staff:*::
+games:*::
+users:*::
+nogroup:*::
+crontab:x::
+Debian-exim:x::

Added: debian/trunk/tests/usertools/01/16_useradd_add_user_to_multiple_groups/passwd
===================================================================
--- debian/trunk/tests/usertools/01/16_useradd_add_user_to_multiple_groups/passwd	                        (rev 0)
+++ debian/trunk/tests/usertools/01/16_useradd_add_user_to_multiple_groups/passwd	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:x:0:0:root:/root:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+bin:x:2:2:bin:/bin:/bin/sh
+sys:x:3:3:sys:/dev:/bin/sh
+sync:x:4:65534:sync:/bin:/bin/sync
+games:x:5:60:games:/usr/games:/bin/sh
+man:x:6:12:man:/var/cache/man:/bin/sh
+lp:x:7:7:lp:/var/spool/lpd:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/var/spool/news:/bin/sh
+uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/var/www:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/var/list:/bin/sh
+irc:x:39:39:ircd:/var/run/ircd:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
+nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
+Debian-exim:x:102:102::/var/spool/exim4:/bin/false
+test1:x:1000:65534::/home/test1:/bin/sh

Added: debian/trunk/tests/usertools/01/16_useradd_add_user_to_multiple_groups/shadow
===================================================================
--- debian/trunk/tests/usertools/01/16_useradd_add_user_to_multiple_groups/shadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/16_useradd_add_user_to_multiple_groups/shadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
+daemon:*:12977:0:99999:7:::
+bin:*:12977:0:99999:7:::
+sys:*:12977:0:99999:7:::
+sync:*:12977:0:99999:7:::
+games:*:12977:0:99999:7:::
+man:*:12977:0:99999:7:::
+lp:*:12977:0:99999:7:::
+mail:*:12977:0:99999:7:::
+news:*:12977:0:99999:7:::
+uucp:*:12977:0:99999:7:::
+proxy:*:12977:0:99999:7:::
+www-data:*:12977:0:99999:7:::
+backup:*:12977:0:99999:7:::
+list:*:12977:0:99999:7:::
+irc:*:12977:0:99999:7:::
+gnats:*:12977:0:99999:7:::
+nobody:*:12977:0:99999:7:::
+Debian-exim:!:12977:0:99999:7:::
+test1:!:@TODAY@:0:99999:7:::

Added: debian/trunk/tests/usertools/01/16_useradd_add_user_to_multiple_groups.test
===================================================================
--- debian/trunk/tests/usertools/01/16_useradd_add_user_to_multiple_groups.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/16_useradd_add_user_to_multiple_groups.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Add a new user"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1, and add it to group src (useradd test1 -g src)..."
+useradd test1 -g nogroup -G src,daemon,bin
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl 16_useradd_add_user_to_multiple_groups/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl 16_useradd_add_user_to_multiple_groups/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl 16_useradd_add_user_to_multiple_groups/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl 16_useradd_add_user_to_multiple_groups/gshadow /etc/gshadow
+echo "OK"
+echo -n "no homedir..."
+test -d /home/test1 && exit 1 || true
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/16_useradd_add_user_to_multiple_groups.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/16_useradd_add_user_to_one_group/group
===================================================================
--- debian/trunk/tests/usertools/01/16_useradd_add_user_to_one_group/group	                        (rev 0)
+++ debian/trunk/tests/usertools/01/16_useradd_add_user_to_one_group/group	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:x:0:
+daemon:x:1:
+bin:x:2:
+sys:x:3:
+adm:x:4:
+tty:x:5:
+disk:x:6:
+lp:x:7:
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:
+tape:x:26:
+sudo:x:27:
+audio:x:29:
+dip:x:30:
+www-data:x:33:
+backup:x:34:
+operator:x:37:
+list:x:38:
+irc:x:39:
+src:x:40:test1
+gnats:x:41:
+shadow:x:42:
+utmp:x:43:
+video:x:44:
+sasl:x:45:
+plugdev:x:46:
+staff:x:50:
+games:x:60:
+users:x:100:
+nogroup:x:65534:
+crontab:x:101:
+Debian-exim:x:102:
+test1:x:1000:

Added: debian/trunk/tests/usertools/01/16_useradd_add_user_to_one_group/gshadow
===================================================================
--- debian/trunk/tests/usertools/01/16_useradd_add_user_to_one_group/gshadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/16_useradd_add_user_to_one_group/gshadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:*::
+daemon:*::
+bin:*::
+sys:*::
+adm:*::
+tty:*::
+disk:*::
+lp:*::
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*::
+voice:*::
+cdrom:*::
+floppy:*::
+tape:*::
+sudo:*::
+audio:*::
+dip:*::
+www-data:*::
+backup:*::
+operator:*::
+list:*::
+irc:*::
+src:*::test1
+gnats:*::
+shadow:*::
+utmp:*::
+video:*::
+sasl:*::
+plugdev:*::
+staff:*::
+games:*::
+users:*::
+nogroup:*::
+crontab:x::
+Debian-exim:x::
+test1:!::

Added: debian/trunk/tests/usertools/01/16_useradd_add_user_to_one_group/passwd
===================================================================
--- debian/trunk/tests/usertools/01/16_useradd_add_user_to_one_group/passwd	                        (rev 0)
+++ debian/trunk/tests/usertools/01/16_useradd_add_user_to_one_group/passwd	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:x:0:0:root:/root:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+bin:x:2:2:bin:/bin:/bin/sh
+sys:x:3:3:sys:/dev:/bin/sh
+sync:x:4:65534:sync:/bin:/bin/sync
+games:x:5:60:games:/usr/games:/bin/sh
+man:x:6:12:man:/var/cache/man:/bin/sh
+lp:x:7:7:lp:/var/spool/lpd:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/var/spool/news:/bin/sh
+uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/var/www:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/var/list:/bin/sh
+irc:x:39:39:ircd:/var/run/ircd:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
+nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
+Debian-exim:x:102:102::/var/spool/exim4:/bin/false
+test1:x:1000:1000::/home/test1:/bin/sh

Added: debian/trunk/tests/usertools/01/16_useradd_add_user_to_one_group/shadow
===================================================================
--- debian/trunk/tests/usertools/01/16_useradd_add_user_to_one_group/shadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/16_useradd_add_user_to_one_group/shadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
+daemon:*:12977:0:99999:7:::
+bin:*:12977:0:99999:7:::
+sys:*:12977:0:99999:7:::
+sync:*:12977:0:99999:7:::
+games:*:12977:0:99999:7:::
+man:*:12977:0:99999:7:::
+lp:*:12977:0:99999:7:::
+mail:*:12977:0:99999:7:::
+news:*:12977:0:99999:7:::
+uucp:*:12977:0:99999:7:::
+proxy:*:12977:0:99999:7:::
+www-data:*:12977:0:99999:7:::
+backup:*:12977:0:99999:7:::
+list:*:12977:0:99999:7:::
+irc:*:12977:0:99999:7:::
+gnats:*:12977:0:99999:7:::
+nobody:*:12977:0:99999:7:::
+Debian-exim:!:12977:0:99999:7:::
+test1:!:@TODAY@:0:99999:7:::

Added: debian/trunk/tests/usertools/01/16_useradd_add_user_to_one_group.test
===================================================================
--- debian/trunk/tests/usertools/01/16_useradd_add_user_to_one_group.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/16_useradd_add_user_to_one_group.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Add a new user"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1, and add it to group src (useradd test1 -g src)..."
+useradd test1 -G src
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl 16_useradd_add_user_to_one_group/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl 16_useradd_add_user_to_one_group/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl 16_useradd_add_user_to_one_group/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl 16_useradd_add_user_to_one_group/gshadow /etc/gshadow
+echo "OK"
+echo -n "no homedir..."
+test -d /home/test1 && exit 1 || true
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/16_useradd_add_user_to_one_group.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/17_useradd_create_homedir/group
===================================================================
--- debian/trunk/tests/usertools/01/17_useradd_create_homedir/group	                        (rev 0)
+++ debian/trunk/tests/usertools/01/17_useradd_create_homedir/group	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:x:0:
+daemon:x:1:
+bin:x:2:
+sys:x:3:
+adm:x:4:
+tty:x:5:
+disk:x:6:
+lp:x:7:
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:
+tape:x:26:
+sudo:x:27:
+audio:x:29:
+dip:x:30:
+www-data:x:33:
+backup:x:34:
+operator:x:37:
+list:x:38:
+irc:x:39:
+src:x:40:
+gnats:x:41:
+shadow:x:42:
+utmp:x:43:
+video:x:44:
+sasl:x:45:
+plugdev:x:46:
+staff:x:50:
+games:x:60:
+users:x:100:
+nogroup:x:65534:
+crontab:x:101:
+Debian-exim:x:102:
+test1:x:1000:

Added: debian/trunk/tests/usertools/01/17_useradd_create_homedir/gshadow
===================================================================
--- debian/trunk/tests/usertools/01/17_useradd_create_homedir/gshadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/17_useradd_create_homedir/gshadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:*::
+daemon:*::
+bin:*::
+sys:*::
+adm:*::
+tty:*::
+disk:*::
+lp:*::
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*::
+voice:*::
+cdrom:*::
+floppy:*::
+tape:*::
+sudo:*::
+audio:*::
+dip:*::
+www-data:*::
+backup:*::
+operator:*::
+list:*::
+irc:*::
+src:*::
+gnats:*::
+shadow:*::
+utmp:*::
+video:*::
+sasl:*::
+plugdev:*::
+staff:*::
+games:*::
+users:*::
+nogroup:*::
+crontab:x::
+Debian-exim:x::
+test1:!::

Added: debian/trunk/tests/usertools/01/17_useradd_create_homedir/passwd
===================================================================
--- debian/trunk/tests/usertools/01/17_useradd_create_homedir/passwd	                        (rev 0)
+++ debian/trunk/tests/usertools/01/17_useradd_create_homedir/passwd	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:x:0:0:root:/root:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+bin:x:2:2:bin:/bin:/bin/sh
+sys:x:3:3:sys:/dev:/bin/sh
+sync:x:4:65534:sync:/bin:/bin/sync
+games:x:5:60:games:/usr/games:/bin/sh
+man:x:6:12:man:/var/cache/man:/bin/sh
+lp:x:7:7:lp:/var/spool/lpd:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/var/spool/news:/bin/sh
+uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/var/www:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/var/list:/bin/sh
+irc:x:39:39:ircd:/var/run/ircd:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
+nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
+Debian-exim:x:102:102::/var/spool/exim4:/bin/false
+test1:x:1000:1000::/home/test1:/bin/sh

Added: debian/trunk/tests/usertools/01/17_useradd_create_homedir/shadow
===================================================================
--- debian/trunk/tests/usertools/01/17_useradd_create_homedir/shadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/17_useradd_create_homedir/shadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
+daemon:*:12977:0:99999:7:::
+bin:*:12977:0:99999:7:::
+sys:*:12977:0:99999:7:::
+sync:*:12977:0:99999:7:::
+games:*:12977:0:99999:7:::
+man:*:12977:0:99999:7:::
+lp:*:12977:0:99999:7:::
+mail:*:12977:0:99999:7:::
+news:*:12977:0:99999:7:::
+uucp:*:12977:0:99999:7:::
+proxy:*:12977:0:99999:7:::
+www-data:*:12977:0:99999:7:::
+backup:*:12977:0:99999:7:::
+list:*:12977:0:99999:7:::
+irc:*:12977:0:99999:7:::
+gnats:*:12977:0:99999:7:::
+nobody:*:12977:0:99999:7:::
+Debian-exim:!:12977:0:99999:7:::
+test1:!:@TODAY@:0:99999:7:::

Added: debian/trunk/tests/usertools/01/17_useradd_create_homedir.test
===================================================================
--- debian/trunk/tests/usertools/01/17_useradd_create_homedir.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/17_useradd_create_homedir.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Add a new user"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1 with homedir (useradd --create-home test1)..."
+useradd --create-home test1
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl 01_useradd_add_user/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl 01_useradd_add_user/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl 01_useradd_add_user/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl 01_useradd_add_user/gshadow /etc/gshadow
+echo "OK"
+echo -n "homedir created..."
+test -d /home/test1
+echo "OK"
+echo -n "Check if skeleton files were added..."
+diff -rauN /etc/skel /home/test1
+echo "OK"
+rm -rf /home/test1
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/17_useradd_create_homedir.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/18_userdel_remove_homedir/group
===================================================================
--- debian/trunk/tests/usertools/01/18_userdel_remove_homedir/group	                        (rev 0)
+++ debian/trunk/tests/usertools/01/18_userdel_remove_homedir/group	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:x:0:
+daemon:x:1:
+bin:x:2:
+sys:x:3:
+adm:x:4:
+tty:x:5:
+disk:x:6:
+lp:x:7:
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:
+tape:x:26:
+sudo:x:27:
+audio:x:29:
+dip:x:30:
+www-data:x:33:
+backup:x:34:
+operator:x:37:
+list:x:38:
+irc:x:39:
+src:x:40:
+gnats:x:41:
+shadow:x:42:
+utmp:x:43:
+video:x:44:
+sasl:x:45:
+plugdev:x:46:
+staff:x:50:
+games:x:60:
+users:x:100:
+nogroup:x:65534:
+crontab:x:101:
+Debian-exim:x:102:
+test1:x:1000:

Added: debian/trunk/tests/usertools/01/18_userdel_remove_homedir/gshadow
===================================================================
--- debian/trunk/tests/usertools/01/18_userdel_remove_homedir/gshadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/18_userdel_remove_homedir/gshadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:*::
+daemon:*::
+bin:*::
+sys:*::
+adm:*::
+tty:*::
+disk:*::
+lp:*::
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*::
+voice:*::
+cdrom:*::
+floppy:*::
+tape:*::
+sudo:*::
+audio:*::
+dip:*::
+www-data:*::
+backup:*::
+operator:*::
+list:*::
+irc:*::
+src:*::
+gnats:*::
+shadow:*::
+utmp:*::
+video:*::
+sasl:*::
+plugdev:*::
+staff:*::
+games:*::
+users:*::
+nogroup:*::
+crontab:x::
+Debian-exim:x::
+test1:!::

Added: debian/trunk/tests/usertools/01/18_userdel_remove_homedir/passwd
===================================================================
--- debian/trunk/tests/usertools/01/18_userdel_remove_homedir/passwd	                        (rev 0)
+++ debian/trunk/tests/usertools/01/18_userdel_remove_homedir/passwd	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:x:0:0:root:/root:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+bin:x:2:2:bin:/bin:/bin/sh
+sys:x:3:3:sys:/dev:/bin/sh
+sync:x:4:65534:sync:/bin:/bin/sync
+games:x:5:60:games:/usr/games:/bin/sh
+man:x:6:12:man:/var/cache/man:/bin/sh
+lp:x:7:7:lp:/var/spool/lpd:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/var/spool/news:/bin/sh
+uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/var/www:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/var/list:/bin/sh
+irc:x:39:39:ircd:/var/run/ircd:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
+nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
+Debian-exim:x:102:102::/var/spool/exim4:/bin/false
+test1:x:1000:1000::/home/test1:/bin/sh

Added: debian/trunk/tests/usertools/01/18_userdel_remove_homedir/shadow
===================================================================
--- debian/trunk/tests/usertools/01/18_userdel_remove_homedir/shadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/18_userdel_remove_homedir/shadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
+daemon:*:12977:0:99999:7:::
+bin:*:12977:0:99999:7:::
+sys:*:12977:0:99999:7:::
+sync:*:12977:0:99999:7:::
+games:*:12977:0:99999:7:::
+man:*:12977:0:99999:7:::
+lp:*:12977:0:99999:7:::
+mail:*:12977:0:99999:7:::
+news:*:12977:0:99999:7:::
+uucp:*:12977:0:99999:7:::
+proxy:*:12977:0:99999:7:::
+www-data:*:12977:0:99999:7:::
+backup:*:12977:0:99999:7:::
+list:*:12977:0:99999:7:::
+irc:*:12977:0:99999:7:::
+gnats:*:12977:0:99999:7:::
+nobody:*:12977:0:99999:7:::
+Debian-exim:!:12977:0:99999:7:::
+test1:!:@TODAY@:0:99999:7:::

Added: debian/trunk/tests/usertools/01/18_userdel_remove_homedir.test
===================================================================
--- debian/trunk/tests/usertools/01/18_userdel_remove_homedir.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/18_userdel_remove_homedir.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Add a new user"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1 with homedir (useradd --create-home test1)..."
+useradd --create-home test1
+echo "OK"
+echo -n "Delete user test1 with homedir (userdel --remove test1)..."
+userdel --remove test1
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl config/etc/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl config/etc/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl config/etc/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl config/etc/gshadow /etc/gshadow
+echo "OK"
+echo -n "homedir removed..."
+test ! -d /home/test1
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/18_userdel_remove_homedir.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/19_userdel_delete_user_in_group.test
===================================================================
--- debian/trunk/tests/usertools/01/19_userdel_delete_user_in_group.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/19_userdel_delete_user_in_group.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Delete user"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1 and add it to groups daemon and bin (useradd test1 -G daemon,bin)..."
+useradd test1 -G daemon,bin
+echo "OK"
+echo -n "Delete user test1 (userdel test1)..."
+userdel test1
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl config/etc/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl config/etc/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl config/etc/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl config/etc/gshadow /etc/gshadow
+echo "OK"
+echo -n "no homedir..."
+test -d /home/test1 && exit 1 || true
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/19_userdel_delete_user_in_group.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/20_usermod_change_homedir.test
===================================================================
--- debian/trunk/tests/usertools/01/20_usermod_change_homedir.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/20_usermod_change_homedir.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,58 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Delete user"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1 and its homedir (useradd test1 -m)..."
+useradd test1 -m
+echo "OK"
+echo -n "Change the user's homedir (usermod --home /home/test1.new test1)..."
+usermod --home /home/test1.new test1
+echo "OK"
+echo -n "Test if the new homedir was not created..."
+test ! -d /home/test1.new
+echo "OK"
+echo -n "test if the old homedir was kept..."
+test -d /home/test1
+echo "OK"
+echo -n "Delete user test1 (userdel test1)..."
+userdel test1
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl config/etc/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl config/etc/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl config/etc/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl config/etc/gshadow /etc/gshadow
+echo "OK"
+echo -n "old homedir kept (/home/test1)..."
+test -d /home/test1
+echo "OK"
+echo -n "no homedir (/home/test1.new)..."
+test ! -d /home/test1.new
+echo "OK"
+rm -rf /home/test1
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/20_usermod_change_homedir.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/21_usermod_change_and_move_homedir.test
===================================================================
--- debian/trunk/tests/usertools/01/21_usermod_change_and_move_homedir.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/21_usermod_change_and_move_homedir.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Delete user"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1 and its homedir (useradd test1 -m)..."
+useradd test1 -m
+echo "OK"
+echo -n "Change the user's homedir (usermod -m --home /home/test1.new test1)..."
+usermod -m --home /home/test1.new test1
+echo "OK"
+echo -n "Test if the new homedir exists..."
+test -d /home/test1.new
+echo "OK"
+echo -n "test if the old homedir was removed..."
+test ! -d /home/test1
+echo "OK"
+echo -n "Delete user test1 (userdel test1)..."
+userdel test1 --remove
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl config/etc/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl config/etc/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl config/etc/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl config/etc/gshadow /etc/gshadow
+echo "OK"
+echo -n "no homedir (/home/test1)..."
+test ! -d /home/test1
+echo "OK"
+echo -n "no homedir (/home/test1.new)..."
+test ! -d /home/test1.new
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/21_usermod_change_and_move_homedir.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/22_usermod_new_groups/group
===================================================================
--- debian/trunk/tests/usertools/01/22_usermod_new_groups/group	                        (rev 0)
+++ debian/trunk/tests/usertools/01/22_usermod_new_groups/group	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:x:0:
+daemon:x:1:test1
+bin:x:2:
+sys:x:3:
+adm:x:4:
+tty:x:5:
+disk:x:6:
+lp:x:7:
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:
+tape:x:26:
+sudo:x:27:
+audio:x:29:
+dip:x:30:
+www-data:x:33:
+backup:x:34:
+operator:x:37:
+list:x:38:
+irc:x:39:
+src:x:40:test1
+gnats:x:41:
+shadow:x:42:
+utmp:x:43:
+video:x:44:
+sasl:x:45:
+plugdev:x:46:
+staff:x:50:
+games:x:60:
+users:x:100:
+nogroup:x:65534:test1
+crontab:x:101:
+Debian-exim:x:102:
+test1:x:1000:

Added: debian/trunk/tests/usertools/01/22_usermod_new_groups/gshadow
===================================================================
--- debian/trunk/tests/usertools/01/22_usermod_new_groups/gshadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/22_usermod_new_groups/gshadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:*::
+daemon:*::test1
+bin:*::
+sys:*::
+adm:*::
+tty:*::
+disk:*::
+lp:*::
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*::
+voice:*::
+cdrom:*::
+floppy:*::
+tape:*::
+sudo:*::
+audio:*::
+dip:*::
+www-data:*::
+backup:*::
+operator:*::
+list:*::
+irc:*::
+src:*::test1
+gnats:*::
+shadow:*::
+utmp:*::
+video:*::
+sasl:*::
+plugdev:*::
+staff:*::
+games:*::
+users:*::
+nogroup:*::test1
+crontab:x::
+Debian-exim:x::
+test1:!::

Added: debian/trunk/tests/usertools/01/22_usermod_new_groups/passwd
===================================================================
--- debian/trunk/tests/usertools/01/22_usermod_new_groups/passwd	                        (rev 0)
+++ debian/trunk/tests/usertools/01/22_usermod_new_groups/passwd	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:x:0:0:root:/root:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+bin:x:2:2:bin:/bin:/bin/sh
+sys:x:3:3:sys:/dev:/bin/sh
+sync:x:4:65534:sync:/bin:/bin/sync
+games:x:5:60:games:/usr/games:/bin/sh
+man:x:6:12:man:/var/cache/man:/bin/sh
+lp:x:7:7:lp:/var/spool/lpd:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/var/spool/news:/bin/sh
+uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/var/www:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/var/list:/bin/sh
+irc:x:39:39:ircd:/var/run/ircd:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
+nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
+Debian-exim:x:102:102::/var/spool/exim4:/bin/false
+test1:x:1000:1000::/home/test1:/bin/sh

Added: debian/trunk/tests/usertools/01/22_usermod_new_groups/shadow
===================================================================
--- debian/trunk/tests/usertools/01/22_usermod_new_groups/shadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/22_usermod_new_groups/shadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
+daemon:*:12977:0:99999:7:::
+bin:*:12977:0:99999:7:::
+sys:*:12977:0:99999:7:::
+sync:*:12977:0:99999:7:::
+games:*:12977:0:99999:7:::
+man:*:12977:0:99999:7:::
+lp:*:12977:0:99999:7:::
+mail:*:12977:0:99999:7:::
+news:*:12977:0:99999:7:::
+uucp:*:12977:0:99999:7:::
+proxy:*:12977:0:99999:7:::
+www-data:*:12977:0:99999:7:::
+backup:*:12977:0:99999:7:::
+list:*:12977:0:99999:7:::
+irc:*:12977:0:99999:7:::
+gnats:*:12977:0:99999:7:::
+nobody:*:12977:0:99999:7:::
+Debian-exim:!:12977:0:99999:7:::
+test1:!:@TODAY@:0:99999:7:::

Added: debian/trunk/tests/usertools/01/22_usermod_new_groups.test
===================================================================
--- debian/trunk/tests/usertools/01/22_usermod_new_groups.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/22_usermod_new_groups.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Add a new user"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1 (useradd test1)..."
+useradd test1
+echo "OK"
+echo -n "Add test1 to groups nogroup, daemon, and src..."
+usermod -G nogroup,daemon,src test1
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl 22_usermod_new_groups/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl 22_usermod_new_groups/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl 22_usermod_new_groups/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl 22_usermod_new_groups/gshadow /etc/gshadow
+echo "OK"
+echo -n "no homedir..."
+test -d /home/test1 && exit 1 || true
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/22_usermod_new_groups.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/23_usermod_add_groups/group
===================================================================
--- debian/trunk/tests/usertools/01/23_usermod_add_groups/group	                        (rev 0)
+++ debian/trunk/tests/usertools/01/23_usermod_add_groups/group	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:x:0:
+daemon:x:1:test1
+bin:x:2:test1
+sys:x:3:
+adm:x:4:
+tty:x:5:
+disk:x:6:
+lp:x:7:
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:
+tape:x:26:
+sudo:x:27:
+audio:x:29:
+dip:x:30:
+www-data:x:33:
+backup:x:34:
+operator:x:37:
+list:x:38:
+irc:x:39:
+src:x:40:test1
+gnats:x:41:
+shadow:x:42:
+utmp:x:43:
+video:x:44:
+sasl:x:45:
+plugdev:x:46:
+staff:x:50:
+games:x:60:
+users:x:100:
+nogroup:x:65534:test1
+crontab:x:101:
+Debian-exim:x:102:
+test1:x:1000:

Added: debian/trunk/tests/usertools/01/23_usermod_add_groups/gshadow
===================================================================
--- debian/trunk/tests/usertools/01/23_usermod_add_groups/gshadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/23_usermod_add_groups/gshadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:*::
+daemon:*::test1
+bin:*::test1
+sys:*::
+adm:*::
+tty:*::
+disk:*::
+lp:*::
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*::
+voice:*::
+cdrom:*::
+floppy:*::
+tape:*::
+sudo:*::
+audio:*::
+dip:*::
+www-data:*::
+backup:*::
+operator:*::
+list:*::
+irc:*::
+src:*::test1
+gnats:*::
+shadow:*::
+utmp:*::
+video:*::
+sasl:*::
+plugdev:*::
+staff:*::
+games:*::
+users:*::
+nogroup:*::test1
+crontab:x::
+Debian-exim:x::
+test1:!::

Added: debian/trunk/tests/usertools/01/23_usermod_add_groups/passwd
===================================================================
--- debian/trunk/tests/usertools/01/23_usermod_add_groups/passwd	                        (rev 0)
+++ debian/trunk/tests/usertools/01/23_usermod_add_groups/passwd	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:x:0:0:root:/root:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+bin:x:2:2:bin:/bin:/bin/sh
+sys:x:3:3:sys:/dev:/bin/sh
+sync:x:4:65534:sync:/bin:/bin/sync
+games:x:5:60:games:/usr/games:/bin/sh
+man:x:6:12:man:/var/cache/man:/bin/sh
+lp:x:7:7:lp:/var/spool/lpd:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/var/spool/news:/bin/sh
+uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/var/www:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/var/list:/bin/sh
+irc:x:39:39:ircd:/var/run/ircd:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
+nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
+Debian-exim:x:102:102::/var/spool/exim4:/bin/false
+test1:x:1000:1000::/home/test1:/bin/sh

Added: debian/trunk/tests/usertools/01/23_usermod_add_groups/shadow
===================================================================
--- debian/trunk/tests/usertools/01/23_usermod_add_groups/shadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/23_usermod_add_groups/shadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
+daemon:*:12977:0:99999:7:::
+bin:*:12977:0:99999:7:::
+sys:*:12977:0:99999:7:::
+sync:*:12977:0:99999:7:::
+games:*:12977:0:99999:7:::
+man:*:12977:0:99999:7:::
+lp:*:12977:0:99999:7:::
+mail:*:12977:0:99999:7:::
+news:*:12977:0:99999:7:::
+uucp:*:12977:0:99999:7:::
+proxy:*:12977:0:99999:7:::
+www-data:*:12977:0:99999:7:::
+backup:*:12977:0:99999:7:::
+list:*:12977:0:99999:7:::
+irc:*:12977:0:99999:7:::
+gnats:*:12977:0:99999:7:::
+nobody:*:12977:0:99999:7:::
+Debian-exim:!:12977:0:99999:7:::
+test1:!:@TODAY@:0:99999:7:::

Added: debian/trunk/tests/usertools/01/23_usermod_add_groups.test
===================================================================
--- debian/trunk/tests/usertools/01/23_usermod_add_groups.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/23_usermod_add_groups.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Add a new user"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1 and add it to group bin (useradd test1 -G bin)..."
+useradd test1 -G bin
+echo "OK"
+echo -n "Add test1 to the additional groups nogroup, daemon, and src..."
+usermod -a -G nogroup,daemon,src test1
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl 23_usermod_add_groups/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl 23_usermod_add_groups/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl 23_usermod_add_groups/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl 23_usermod_add_groups/gshadow /etc/gshadow
+echo "OK"
+echo -n "no homedir..."
+test -d /home/test1 && exit 1 || true
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/23_usermod_add_groups.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/usertools/01/24_usermod_new_groups_remove_old_groups/group
===================================================================
--- debian/trunk/tests/usertools/01/24_usermod_new_groups_remove_old_groups/group	                        (rev 0)
+++ debian/trunk/tests/usertools/01/24_usermod_new_groups_remove_old_groups/group	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:x:0:
+daemon:x:1:test1
+bin:x:2:
+sys:x:3:
+adm:x:4:
+tty:x:5:
+disk:x:6:
+lp:x:7:
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:
+tape:x:26:
+sudo:x:27:
+audio:x:29:
+dip:x:30:
+www-data:x:33:
+backup:x:34:
+operator:x:37:
+list:x:38:
+irc:x:39:
+src:x:40:test1
+gnats:x:41:
+shadow:x:42:
+utmp:x:43:
+video:x:44:
+sasl:x:45:
+plugdev:x:46:
+staff:x:50:
+games:x:60:
+users:x:100:
+nogroup:x:65534:test1
+crontab:x:101:
+Debian-exim:x:102:
+test1:x:1000:

Added: debian/trunk/tests/usertools/01/24_usermod_new_groups_remove_old_groups/gshadow
===================================================================
--- debian/trunk/tests/usertools/01/24_usermod_new_groups_remove_old_groups/gshadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/24_usermod_new_groups_remove_old_groups/gshadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,42 @@
+root:*::
+daemon:*::test1
+bin:*::
+sys:*::
+adm:*::
+tty:*::
+disk:*::
+lp:*::
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*::
+voice:*::
+cdrom:*::
+floppy:*::
+tape:*::
+sudo:*::
+audio:*::
+dip:*::
+www-data:*::
+backup:*::
+operator:*::
+list:*::
+irc:*::
+src:*::test1
+gnats:*::
+shadow:*::
+utmp:*::
+video:*::
+sasl:*::
+plugdev:*::
+staff:*::
+games:*::
+users:*::
+nogroup:*::test1
+crontab:x::
+Debian-exim:x::
+test1:!::

Added: debian/trunk/tests/usertools/01/24_usermod_new_groups_remove_old_groups/passwd
===================================================================
--- debian/trunk/tests/usertools/01/24_usermod_new_groups_remove_old_groups/passwd	                        (rev 0)
+++ debian/trunk/tests/usertools/01/24_usermod_new_groups_remove_old_groups/passwd	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:x:0:0:root:/root:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+bin:x:2:2:bin:/bin:/bin/sh
+sys:x:3:3:sys:/dev:/bin/sh
+sync:x:4:65534:sync:/bin:/bin/sync
+games:x:5:60:games:/usr/games:/bin/sh
+man:x:6:12:man:/var/cache/man:/bin/sh
+lp:x:7:7:lp:/var/spool/lpd:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/var/spool/news:/bin/sh
+uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/var/www:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/var/list:/bin/sh
+irc:x:39:39:ircd:/var/run/ircd:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
+nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
+Debian-exim:x:102:102::/var/spool/exim4:/bin/false
+test1:x:1000:1000::/home/test1:/bin/sh

Added: debian/trunk/tests/usertools/01/24_usermod_new_groups_remove_old_groups/shadow
===================================================================
--- debian/trunk/tests/usertools/01/24_usermod_new_groups_remove_old_groups/shadow	                        (rev 0)
+++ debian/trunk/tests/usertools/01/24_usermod_new_groups_remove_old_groups/shadow	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,20 @@
+root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
+daemon:*:12977:0:99999:7:::
+bin:*:12977:0:99999:7:::
+sys:*:12977:0:99999:7:::
+sync:*:12977:0:99999:7:::
+games:*:12977:0:99999:7:::
+man:*:12977:0:99999:7:::
+lp:*:12977:0:99999:7:::
+mail:*:12977:0:99999:7:::
+news:*:12977:0:99999:7:::
+uucp:*:12977:0:99999:7:::
+proxy:*:12977:0:99999:7:::
+www-data:*:12977:0:99999:7:::
+backup:*:12977:0:99999:7:::
+list:*:12977:0:99999:7:::
+irc:*:12977:0:99999:7:::
+gnats:*:12977:0:99999:7:::
+nobody:*:12977:0:99999:7:::
+Debian-exim:!:12977:0:99999:7:::
+test1:!:@TODAY@:0:99999:7:::

Added: debian/trunk/tests/usertools/01/24_usermod_new_groups_remove_old_groups.test
===================================================================
--- debian/trunk/tests/usertools/01/24_usermod_new_groups_remove_old_groups.test	                        (rev 0)
+++ debian/trunk/tests/usertools/01/24_usermod_new_groups_remove_old_groups.test	2008-01-12 15:10:58 UTC (rev 1709)
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "Add a new user"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create user test1 and add it to group bin (useradd test1 -G bin)..."
+useradd test1 -G bin
+echo "OK"
+echo -n "Change the groups of test1 to nogroup, daemon, and src..."
+usermod -G nogroup,daemon,src test1
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl 24_usermod_new_groups_remove_old_groups/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl 24_usermod_new_groups_remove_old_groups/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl 24_usermod_new_groups_remove_old_groups/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl 24_usermod_new_groups_remove_old_groups/gshadow /etc/gshadow
+echo "OK"
+echo -n "no homedir..."
+test -d /home/test1 && exit 1 || true
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/usertools/01/24_usermod_new_groups_remove_old_groups.test
___________________________________________________________________
Name: svn:executable
   + *

Deleted: debian/trunk/tests/usertools/01/run1
===================================================================
--- debian/trunk/tests/usertools/01/run1	2008-01-12 15:08:54 UTC (rev 1708)
+++ debian/trunk/tests/usertools/01/run1	2008-01-12 15:10:58 UTC (rev 1709)
@@ -1,102 +0,0 @@
-#!/bin/sh
-
-set -e
-
-cd $(dirname $0)
-
-# Rational:
-# Test that useradd can add an user and userdel removes it.
-
-save()
-{
-	[ ! -d tmp ] && mkdir tmp
-	for i in passwd group shadow gshadow
-	do
-		[ -f /etc/$i  ] && cp /etc/$i  tmp/$i
-	done
-
-	true
-}
-
-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
-
-cp data/{passwd,shadow,group,gshadow} /etc/
-
-lines_passwd=$(wc -l /etc/passwd | cut -f1 -d" ")
-lines_shadow=$(wc -l /etc/shadow | cut -f1 -d" ")
-lines_group=$(wc -l /etc/group | cut -f1 -d" ")
-lines_gshadow=$(wc -l /etc/gshadow | cut -f1 -d" ")
-
-echo -n "Create user test1..."
-useradd test1
-echo "OK"
-
-echo "test if the user was added"
-echo -n "  passwd..."
-getent passwd test1 |
-	egrep "^test1:x:([0-9]+):\\1::/home/test1:/bin/sh$"
-echo "  OK"
-uid=$(getent passwd test1|sed -ne "s/test1:x:\([0-9]*\):.*/\\1/p")
-# uid must be greater than UID_MIN (in login.defs)
-echo -n "  uid: $uid < 1000..."
-test $uid -ge 1000
-echo "  OK"
-echo -n "  group..."
-getent group test1  | egrep "^test1:x:$uid:$"
-echo "  OK"
-echo -n "  shadow..."
-getent shadow test1 | egrep "^test1:!:[0-9]+:0:99999:7:::$"
-echo "  OK"
-echo -n "  gshadow..."
-egrep "^test1:!::$" /etc/gshadow
-echo "  OK"
-# the home directory should not exist
-echo -n "  no homedir..."
-test -d /home/test1 && exit 1 || true
-echo "  OK"
-echo -n "  number of lines"
-test $(( lines_passwd  + 1 )) = $(wc -l /etc/passwd | cut -f1 -d" ")
-echo -n "."
-test $(( lines_group   + 1 )) = $(wc -l /etc/group | cut -f1 -d" ")
-echo -n "."
-test $(( lines_shadow  + 1 )) = $(wc -l /etc/shadow | cut -f1 -d" ")
-echo -n "."
-test $(( lines_gshadow + 1 )) = $(wc -l /etc/gshadow | cut -f1 -d" ")
-echo -n "."
-echo "  OK"
-
-echo -n "delete this user..."
-userdel test1
-echo "OK"
-
-echo "check if the user was deleted"
-echo -n "  no entries..."
-egrep "^test1:" \
-      /etc/passwd /etc/group /etc/shadow /etc/gshadow && exit 1 || true
-echo "  OK"
-echo -n "  no homedir..."
-test -d /home/test1 && exit 1 || true
-echo "  OK"
-echo -n "  number of lines"
-test $lines_passwd  = $(wc -l /etc/passwd | cut -f1 -d" ")
-echo -n "."
-test $lines_group   = $(wc -l /etc/group | cut -f1 -d" ")
-echo -n "."
-test $lines_shadow  = $(wc -l /etc/shadow | cut -f1 -d" ")
-echo -n "."
-test $lines_gshadow = $(wc -l /etc/gshadow | cut -f1 -d" ")
-echo -n "."
-echo "  OK"
-

Deleted: debian/trunk/tests/usertools/01/run10
===================================================================
--- debian/trunk/tests/usertools/01/run10	2008-01-12 15:08:54 UTC (rev 1708)
+++ debian/trunk/tests/usertools/01/run10	2008-01-12 15:10:58 UTC (rev 1709)
@@ -1,86 +0,0 @@
-#!/bin/sh
-
-set -e
-
-cd $(dirname $0)
-
-# Rational:
-# Check that usermod can rename an user
-
-save()
-{
-	[ ! -d tmp ] && mkdir tmp
-	for i in passwd group shadow gshadow
-	do
-		[ -f /etc/$i  ] && cp /etc/$i  tmp/$i
-	done
-
-	true
-}
-
-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
-
-cp data/{passwd,shadow,group,gshadow} /etc/
-
-lines_passwd=$(wc -l /etc/passwd | cut -f1 -d" ")
-lines_shadow=$(wc -l /etc/shadow | cut -f1 -d" ")
-lines_group=$(wc -l /etc/group | cut -f1 -d" ")
-lines_gshadow=$(wc -l /etc/gshadow | cut -f1 -d" ")
-
-echo -n "Create user test1..."
-useradd test1
-echo "OK"
-
-uid=$(getent passwd test1|sed -ne "s/test1:x:\([0-9]*\):.*/\\1/p")
-
-echo -n "Rename user test1..."
-usermod -l test2 test1
-echo "OK"
-
-echo "test if the user was changed"
-echo -n "  passwd no user test1..."
-getent passwd test1 && exit 1 || true
-echo "  OK"
-echo -n "  passwd user test2..."
-getent passwd test2 |
-	egrep "^test2:x:$uid:$uid::/home/test1:/bin/sh$"
-echo "  OK"
-echo -n "  group..."
-getent group test1  | egrep "^test1:x:$uid:$"
-echo "  OK"
-echo -n "  shadow no user test1..."
-getent shadow test1 && exit 1 || true
-echo "  OK"
-echo -n "  shadow user test2..."
-getent shadow test2 | egrep "^test2:!:[0-9]+:0:99999:7:::$"
-echo "  OK"
-echo -n "  gshadow..."
-egrep "^test1:!::$" /etc/gshadow
-echo "  OK"
-# the home directory should not exist
-echo -n "  no homedir..."
-test -d /home/test1 && exit 1 || true
-echo "  OK"
-echo -n "  number of lines"
-test $(( lines_passwd  + 1 )) = $(wc -l /etc/passwd | cut -f1 -d" ")
-echo -n "."
-test $(( lines_group   + 1 )) = $(wc -l /etc/group | cut -f1 -d" ")
-echo -n "."
-test $(( lines_shadow  + 1 )) = $(wc -l /etc/shadow | cut -f1 -d" ")
-echo -n "."
-test $(( lines_gshadow + 1 )) = $(wc -l /etc/gshadow | cut -f1 -d" ")
-echo -n "."
-echo "  OK"
-

Deleted: debian/trunk/tests/usertools/01/run11
===================================================================
--- debian/trunk/tests/usertools/01/run11	2008-01-12 15:08:54 UTC (rev 1708)
+++ debian/trunk/tests/usertools/01/run11	2008-01-12 15:10:58 UTC (rev 1709)
@@ -1,147 +0,0 @@
-#!/bin/sh
-
-set -e
-
-cd $(dirname $0)
-
-# Rational:
-# Check that usermod can change, lock or unlock an user's password
-
-save()
-{
-	[ ! -d tmp ] && mkdir tmp
-	for i in passwd group shadow gshadow
-	do
-		[ -f /etc/$i  ] && cp /etc/$i  tmp/$i
-	done
-
-	true
-}
-
-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
-
-cp data/{passwd,shadow,group,gshadow} /etc/
-
-lines_passwd=$(wc -l /etc/passwd | cut -f1 -d" ")
-lines_shadow=$(wc -l /etc/shadow | cut -f1 -d" ")
-lines_group=$(wc -l /etc/group | cut -f1 -d" ")
-lines_gshadow=$(wc -l /etc/gshadow | cut -f1 -d" ")
-
-echo -n "Create user test1..."
-useradd test1
-echo "OK"
-
-uid=$(getent passwd test1|sed -ne "s/test1:x:\([0-9]*\):.*/\\1/p")
-
-echo -n "Change user's password..."
-usermod -p '$1$12345678$0jEt1CYOyE.5NxWFMZyZy1' test1
-# (test1F00barbaz)
-echo "OK"
-
-echo "test if the user was changed"
-echo -n "  passwd..."
-getent passwd test1 |
-	egrep "^test1:x:$uid:$uid::/home/test1:/bin/sh$"
-echo "  OK"
-echo -n "  group..."
-getent group test1  | egrep "^test1:x:$uid:$"
-echo "  OK"
-echo -n "  shadow..."
-getent shadow test1 | egrep "^test1:\\\$1\\\$12345678\\\$0jEt1CYOyE\.5NxWFMZyZy1:[0-9]+:0:99999:7:::$"
-echo "  OK"
-echo -n "  gshadow..."
-egrep "^test1:!::$" /etc/gshadow
-echo "  OK"
-# the home directory should not exist
-echo -n "  no homedir..."
-test -d /home/test1 && exit 1 || true
-echo "  OK"
-echo -n "  number of lines"
-test $(( lines_passwd  + 1 )) = $(wc -l /etc/passwd | cut -f1 -d" ")
-echo -n "."
-test $(( lines_group   + 1 )) = $(wc -l /etc/group | cut -f1 -d" ")
-echo -n "."
-test $(( lines_shadow  + 1 )) = $(wc -l /etc/shadow | cut -f1 -d" ")
-echo -n "."
-test $(( lines_gshadow + 1 )) = $(wc -l /etc/gshadow | cut -f1 -d" ")
-echo -n "."
-echo "  OK"
-
-echo -n "Lock user's password..."
-usermod -L test1
-echo "OK"
-
-echo "test if the user was changed"
-echo -n "  passwd..."
-getent passwd test1 |
-	egrep "^test1:x:$uid:$uid::/home/test1:/bin/sh$"
-echo "  OK"
-echo -n "  group..."
-getent group test1  | egrep "^test1:x:$uid:$"
-echo "  OK"
-echo -n "  shadow..."
-getent shadow test1 | egrep "^test1:\!\\\$1\\\$12345678\\\$0jEt1CYOyE\.5NxWFMZyZy1:[0-9]+:0:99999:7:::$"
-echo "  OK"
-echo -n "  gshadow..."
-egrep "^test1:!::$" /etc/gshadow
-echo "  OK"
-# the home directory should not exist
-echo -n "  no homedir..."
-test -d /home/test1 && exit 1 || true
-echo "  OK"
-echo -n "  number of lines"
-test $(( lines_passwd  + 1 )) = $(wc -l /etc/passwd | cut -f1 -d" ")
-echo -n "."
-test $(( lines_group   + 1 )) = $(wc -l /etc/group | cut -f1 -d" ")
-echo -n "."
-test $(( lines_shadow  + 1 )) = $(wc -l /etc/shadow | cut -f1 -d" ")
-echo -n "."
-test $(( lines_gshadow + 1 )) = $(wc -l /etc/gshadow | cut -f1 -d" ")
-echo -n "."
-echo "  OK"
-
-echo -n "Unlock user's password..."
-usermod --unlock test1
-echo "OK"
-
-echo "test if the user was changed"
-echo -n "  passwd..."
-getent passwd test1 |
-	egrep "^test1:x:$uid:$uid::/home/test1:/bin/sh$"
-echo "  OK"
-echo -n "  group..."
-getent group test1  | egrep "^test1:x:$uid:$"
-echo "  OK"
-echo -n "  shadow..."
-getent shadow test1 | egrep "^test1:\\\$1\\\$12345678\\\$0jEt1CYOyE\.5NxWFMZyZy1:[0-9]+:0:99999:7:::$"
-echo "  OK"
-echo -n "  gshadow..."
-egrep "^test1:!::$" /etc/gshadow
-echo "  OK"
-# the home directory should not exist
-echo -n "  no homedir..."
-test -d /home/test1 && exit 1 || true
-echo "  OK"
-echo -n "  number of lines"
-test $(( lines_passwd  + 1 )) = $(wc -l /etc/passwd | cut -f1 -d" ")
-echo -n "."
-test $(( lines_group   + 1 )) = $(wc -l /etc/group | cut -f1 -d" ")
-echo -n "."
-test $(( lines_shadow  + 1 )) = $(wc -l /etc/shadow | cut -f1 -d" ")
-echo -n "."
-test $(( lines_gshadow + 1 )) = $(wc -l /etc/gshadow | cut -f1 -d" ")
-echo -n "."
-echo "  OK"
-

Deleted: debian/trunk/tests/usertools/01/run12
===================================================================
--- debian/trunk/tests/usertools/01/run12	2008-01-12 15:08:54 UTC (rev 1708)
+++ debian/trunk/tests/usertools/01/run12	2008-01-12 15:10:58 UTC (rev 1709)
@@ -1,81 +0,0 @@
-#!/bin/sh
-
-set -e
-
-cd $(dirname $0)
-
-# Rational:
-# Test that usermod can change the group of an user
-# (-g with non-numerical GID)
-
-save()
-{
-	[ ! -d tmp ] && mkdir tmp
-	for i in passwd group shadow gshadow
-	do
-		[ -f /etc/$i  ] && cp /etc/$i  tmp/$i
-	done
-
-	true
-}
-
-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
-
-cp data/{passwd,shadow,group,gshadow} /etc/
-
-lines_passwd=$(wc -l /etc/passwd | cut -f1 -d" ")
-lines_shadow=$(wc -l /etc/shadow | cut -f1 -d" ")
-lines_group=$(wc -l /etc/group | cut -f1 -d" ")
-lines_gshadow=$(wc -l /etc/gshadow | cut -f1 -d" ")
-
-echo -n "Create user test1..."
-useradd test1
-echo "OK"
-
-uid=$(getent passwd test1|sed -ne "s/test1:x:\([0-9]*\):.*/\\1/p")
-
-echo -n "Change user test1..."
-usermod -g bin test1
-echo "OK"
-
-echo "test if the user was changed"
-echo -n "  passwd..."
-getent passwd test1 |
-	egrep "^test1:x:$uid:2::/home/test1:/bin/sh$"
-echo "  OK"
-echo -n "  group..."
-getent group test1  | egrep "^test1:x:$uid:$"
-echo "  OK"
-echo -n "  shadow..."
-getent shadow test1 | egrep "^test1:!:[0-9]+:0:99999:7:::$"
-echo "  OK"
-echo -n "  gshadow..."
-egrep "^test1:!::$" /etc/gshadow
-echo "  OK"
-# the home directory should not exist
-echo -n "  no homedir..."
-test -d /home/test1 && exit 1 || true
-echo "  OK"
-echo -n "  number of lines"
-test $(( lines_passwd  + 1 )) = $(wc -l /etc/passwd | cut -f1 -d" ")
-echo -n "."
-test $(( lines_group   + 1 )) = $(wc -l /etc/group | cut -f1 -d" ")
-echo -n "."
-test $(( lines_shadow  + 1 )) = $(wc -l /etc/shadow | cut -f1 -d" ")
-echo -n "."
-test $(( lines_gshadow + 1 )) = $(wc -l /etc/gshadow | cut -f1 -d" ")
-echo -n "."
-echo "  OK"
-

Deleted: debian/trunk/tests/usertools/01/run13
===================================================================
--- debian/trunk/tests/usertools/01/run13	2008-01-12 15:08:54 UTC (rev 1708)
+++ debian/trunk/tests/usertools/01/run13	2008-01-12 15:10:58 UTC (rev 1709)
@@ -1,74 +0,0 @@
-#!/bin/sh
-
-set -e
-
-cd $(dirname $0)
-
-# Rational:
-# Test that useradd do not accept negative UID
-
-save()
-{
-	[ ! -d tmp ] && mkdir tmp
-	for i in passwd group shadow gshadow
-	do
-		[ -f /etc/$i  ] && cp /etc/$i  tmp/$i
-	done
-
-	true
-}
-
-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
-
-cp data/{passwd,shadow,group,gshadow} /etc/
-
-lines_passwd=$(wc -l /etc/passwd | cut -f1 -d" ")
-lines_shadow=$(wc -l /etc/shadow | cut -f1 -d" ")
-lines_group=$(wc -l /etc/group | cut -f1 -d" ")
-lines_gshadow=$(wc -l /etc/gshadow | cut -f1 -d" ")
-
-echo -n "Create user test1 with a negative UID..."
-msg=$(useradd -u -1 test1 2>&1) && exit 1 || test "$?" = "3"
-test "$msg" = "useradd: invalid numeric argument '-1'"
-echo "OK"
-
-echo "check that the user was not added"
-echo -n "  passwd..."
-getent passwd test1 && exit 1 || true
-echo "  OK"
-echo -n "  group..."
-getent group test1 && exit 1 || true
-echo "  OK"
-echo -n "  shadow..."
-getent shadow test1 && exit 1 || true
-echo "  OK"
-echo -n "  gshadow..."
-egrep "^test1:!::$" /etc/gshadow && exit 1 || true
-echo "  OK"
-# the home directory should not exist
-echo -n "  no homedir..."
-test -d /home/test1 && exit 1 || true
-echo "  OK"
-echo -n "  number of lines"
-test $(( lines_passwd  )) = $(wc -l /etc/passwd | cut -f1 -d" ")
-echo -n "."
-test $(( lines_group   )) = $(wc -l /etc/group | cut -f1 -d" ")
-echo -n "."
-test $(( lines_shadow  )) = $(wc -l /etc/shadow | cut -f1 -d" ")
-echo -n "."
-test $(( lines_gshadow )) = $(wc -l /etc/gshadow | cut -f1 -d" ")
-echo -n "."
-echo "  OK"
-

Deleted: debian/trunk/tests/usertools/01/run14
===================================================================
--- debian/trunk/tests/usertools/01/run14	2008-01-12 15:08:54 UTC (rev 1708)
+++ debian/trunk/tests/usertools/01/run14	2008-01-12 15:10:58 UTC (rev 1709)
@@ -1,74 +0,0 @@
-#!/bin/sh
-
-set -e
-
-cd $(dirname $0)
-
-# Rational:
-# Test that useradd do not accept UID that will cause overflow
-
-save()
-{
-	[ ! -d tmp ] && mkdir tmp
-	for i in passwd group shadow gshadow
-	do
-		[ -f /etc/$i  ] && cp /etc/$i  tmp/$i
-	done
-
-	true
-}
-
-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
-
-cp data/{passwd,shadow,group,gshadow} /etc/
-
-lines_passwd=$(wc -l /etc/passwd | cut -f1 -d" ")
-lines_shadow=$(wc -l /etc/shadow | cut -f1 -d" ")
-lines_group=$(wc -l /etc/group | cut -f1 -d" ")
-lines_gshadow=$(wc -l /etc/gshadow | cut -f1 -d" ")
-
-echo -n "Create user test1 with UID 2147483648..."
-msg=$(useradd -u 2147483648 test1 2>&1) && exit 1 || test "$?" = "3"
-test "$msg" = "useradd: invalid numeric argument '2147483648'"
-echo "OK"
-
-echo "check that the user was not added"
-echo -n "  passwd..."
-getent passwd test1 && exit 1 || true
-echo "  OK"
-echo -n "  group..."
-getent group test1 && exit 1 || true
-echo "  OK"
-echo -n "  shadow..."
-getent shadow test1 && exit 1 || true
-echo "  OK"
-echo -n "  gshadow..."
-egrep "^test1:!::$" /etc/gshadow && exit 1 || true
-echo "  OK"
-# the home directory should not exist
-echo -n "  no homedir..."
-test -d /home/test1 && exit 1 || true
-echo "  OK"
-echo -n "  number of lines"
-test $(( lines_passwd  )) = $(wc -l /etc/passwd | cut -f1 -d" ")
-echo -n "."
-test $(( lines_group   )) = $(wc -l /etc/group | cut -f1 -d" ")
-echo -n "."
-test $(( lines_shadow  )) = $(wc -l /etc/shadow | cut -f1 -d" ")
-echo -n "."
-test $(( lines_gshadow )) = $(wc -l /etc/gshadow | cut -f1 -d" ")
-echo -n "."
-echo "  OK"
-

Deleted: debian/trunk/tests/usertools/01/run15
===================================================================
--- debian/trunk/tests/usertools/01/run15	2008-01-12 15:08:54 UTC (rev 1708)
+++ debian/trunk/tests/usertools/01/run15	2008-01-12 15:10:58 UTC (rev 1709)
@@ -1,98 +0,0 @@
-#!/bin/sh
-
-set -e
-
-cd $(dirname $0)
-
-# Rational:
-# Test that useradd can add an user with an high UID
-
-save()
-{
-	[ ! -d tmp ] && mkdir tmp
-	for i in passwd group shadow gshadow
-	do
-		[ -f /etc/$i  ] && cp /etc/$i  tmp/$i
-	done
-
-	true
-}
-
-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
-
-cp data/{passwd,shadow,group,gshadow} /etc/
-
-lines_passwd=$(wc -l /etc/passwd | cut -f1 -d" ")
-lines_shadow=$(wc -l /etc/shadow | cut -f1 -d" ")
-lines_group=$(wc -l /etc/group | cut -f1 -d" ")
-lines_gshadow=$(wc -l /etc/gshadow | cut -f1 -d" ")
-
-echo -n "Create user test1..."
-uid=2147483647
-useradd -u $uid test1
-echo "OK"
-
-echo "test if the user was added"
-echo -n "  passwd..."
-getent passwd test1 |
-	egrep "^test1:x:$uid:$uid::/home/test1:/bin/sh$"
-echo "  OK"
-echo -n "  group..."
-getent group test1  | egrep "^test1:x:$uid:$"
-echo "  OK"
-echo -n "  shadow..."
-getent shadow test1 | egrep "^test1:!:[0-9]+:0:99999:7:::$"
-echo "  OK"
-echo -n "  gshadow..."
-egrep "^test1:!::$" /etc/gshadow
-echo "  OK"
-# the home directory should not exist
-echo -n "  no homedir..."
-test -d /home/test1 && exit 1 || true
-echo "  OK"
-echo -n "  number of lines"
-test $(( lines_passwd  + 1 )) = $(wc -l /etc/passwd | cut -f1 -d" ")
-echo -n "."
-test $(( lines_group   + 1 )) = $(wc -l /etc/group | cut -f1 -d" ")
-echo -n "."
-test $(( lines_shadow  + 1 )) = $(wc -l /etc/shadow | cut -f1 -d" ")
-echo -n "."
-test $(( lines_gshadow + 1 )) = $(wc -l /etc/gshadow | cut -f1 -d" ")
-echo -n "."
-echo "  OK"
-
-echo -n "delete this user..."
-userdel test1
-echo "OK"
-
-echo "check if the user was deleted"
-echo -n "  no entries..."
-egrep "^test1:" \
-      /etc/passwd /etc/group /etc/shadow /etc/gshadow && exit 1 || true
-echo "  OK"
-echo -n "  no homedir..."
-test -d /home/test1 && exit 1 || true
-echo "  OK"
-echo -n "  number of lines"
-test $lines_passwd  = $(wc -l /etc/passwd | cut -f1 -d" ")
-echo -n "."
-test $lines_group   = $(wc -l /etc/group | cut -f1 -d" ")
-echo -n "."
-test $lines_shadow  = $(wc -l /etc/shadow | cut -f1 -d" ")
-echo -n "."
-test $lines_gshadow = $(wc -l /etc/gshadow | cut -f1 -d" ")
-echo -n "."
-echo "  OK"
-

Deleted: debian/trunk/tests/usertools/01/run2
===================================================================
--- debian/trunk/tests/usertools/01/run2	2008-01-12 15:08:54 UTC (rev 1708)
+++ debian/trunk/tests/usertools/01/run2	2008-01-12 15:10:58 UTC (rev 1709)
@@ -1,159 +0,0 @@
-#!/bin/sh
-
-set -e
-
-cd $(dirname $0)
-
-# Rational:
-# Test that if a user is created, removed and another user is created, the
-# UID of the first user is reused.
-
-save()
-{
-	[ ! -d tmp ] && mkdir tmp
-	for i in passwd group shadow gshadow
-	do
-		[ -f /etc/$i  ] && cp /etc/$i  tmp/$i
-	done
-
-	true
-}
-
-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
-
-cp data/{passwd,shadow,group,gshadow} /etc/
-
-lines_passwd=$(wc -l /etc/passwd | cut -f1 -d" ")
-lines_shadow=$(wc -l /etc/shadow | cut -f1 -d" ")
-lines_group=$(wc -l /etc/group | cut -f1 -d" ")
-lines_gshadow=$(wc -l /etc/gshadow | cut -f1 -d" ")
-
-echo -n "Create user test1..."
-useradd test1
-echo "OK"
-
-echo "test if the user was added"
-echo -n "  passwd..."
-getent passwd test1 |
-	egrep "^test1:x:([0-9]+):\\1::/home/test1:/bin/sh$"
-echo "  OK"
-uid=$(getent passwd test1|sed -ne "s/test1:x:\([0-9]*\):.*/\\1/p")
-# uid must be greater than UID_MIN (in login.defs)
-echo -n "  uid: $uid < 1000..."
-test $uid -ge 1000
-echo "  OK"
-echo -n "  group..."
-getent group test1  | egrep "^test1:x:$uid:$"
-echo "  OK"
-echo -n "  shadow..."
-getent shadow test1 | egrep "^test1:!:[0-9]+:0:99999:7:::$"
-echo "  OK"
-echo -n "  gshadow..."
-egrep "^test1:!::$" /etc/gshadow
-echo "  OK"
-# the home directory should not exist
-echo -n "  no homedir..."
-test -d /home/test1 && exit 1 || true
-echo "  OK"
-echo -n "  number of lines"
-test $(( lines_passwd  + 1 )) = $(wc -l /etc/passwd | cut -f1 -d" ")
-echo -n "."
-test $(( lines_group   + 1 )) = $(wc -l /etc/group | cut -f1 -d" ")
-echo -n "."
-test $(( lines_shadow  + 1 )) = $(wc -l /etc/shadow | cut -f1 -d" ")
-echo -n "."
-test $(( lines_gshadow + 1 )) = $(wc -l /etc/gshadow | cut -f1 -d" ")
-echo -n "."
-echo "  OK"
-
-echo -n "delete this user..."
-userdel test1
-echo "OK"
-
-echo "check if the user was deleted"
-echo -n "  no entries..."
-egrep "^test1:" \
-      /etc/passwd /etc/group /etc/shadow /etc/gshadow && exit 1 || true
-echo "  OK"
-echo -n "  no homedir..."
-test -d /home/test1 && exit 1 || true
-echo "  OK"
-echo -n "  number of lines"
-test $lines_passwd  = $(wc -l /etc/passwd | cut -f1 -d" ")
-echo -n "."
-test $lines_group   = $(wc -l /etc/group | cut -f1 -d" ")
-echo -n "."
-test $lines_shadow  = $(wc -l /etc/shadow | cut -f1 -d" ")
-echo -n "."
-test $lines_gshadow = $(wc -l /etc/gshadow | cut -f1 -d" ")
-echo -n "."
-echo "  OK"
-
-echo -n "Create user test2..."
-useradd test2
-echo "OK"
-
-echo "test if the user was added with the same uid"
-echo -n "  passwd..."
-getent passwd test2 |
-	egrep "^test2:x:$uid:$uid::/home/test2:/bin/sh$"
-echo "  OK"
-echo -n "  group..."
-getent group test2  | egrep "^test2:x:$uid:$"
-echo "  OK"
-echo -n "  shadow..."
-getent shadow test2 | egrep "^test2:!:[0-9]+:0:99999:7:::$"
-echo "  OK"
-echo -n "  gshadow..."
-egrep "^test2:!::$" /etc/gshadow
-echo "  OK"
-# the home directory should not exist
-echo -n "  no homedir..."
-test -d /home/test2 && exit 1 || true
-echo "  OK"
-echo -n "  number of lines"
-test $(( lines_passwd  + 1 )) = $(wc -l /etc/passwd | cut -f1 -d" ")
-echo -n "."
-test $(( lines_group   + 1 )) = $(wc -l /etc/group | cut -f1 -d" ")
-echo -n "."
-test $(( lines_shadow  + 1 )) = $(wc -l /etc/shadow | cut -f1 -d" ")
-echo -n "."
-test $(( lines_gshadow + 1 )) = $(wc -l /etc/gshadow | cut -f1 -d" ")
-echo -n "."
-echo "  OK"
-
-echo -n "delete this user..."
-userdel test2
-echo "OK"
-
-echo "check if the user was deleted"
-echo -n "  no entries..."
-egrep "^test2:" \
-      /etc/passwd /etc/group /etc/shadow /etc/gshadow && exit 1 || true
-echo "  OK"
-echo -n "  no homedir..."
-test -d /home/test2 && exit 1 || true
-echo "  OK"
-echo -n "  number of lines"
-test $lines_passwd  = $(wc -l /etc/passwd | cut -f1 -d" ")
-echo -n "."
-test $lines_group   = $(wc -l /etc/group | cut -f1 -d" ")
-echo -n "."
-test $lines_shadow  = $(wc -l /etc/shadow | cut -f1 -d" ")
-echo -n "."
-test $lines_gshadow = $(wc -l /etc/gshadow | cut -f1 -d" ")
-echo -n "."
-echo "  OK"
-

Deleted: debian/trunk/tests/usertools/01/run3
===================================================================
--- debian/trunk/tests/usertools/01/run3	2008-01-12 15:08:54 UTC (rev 1708)
+++ debian/trunk/tests/usertools/01/run3	2008-01-12 15:10:58 UTC (rev 1709)
@@ -1,107 +0,0 @@
-#!/bin/sh
-
-set -e
-
-cd $(dirname $0)
-
-# Rational:
-# Test the options used to provide information on the user
-# (--comment, --expiredate, --shell, --inactive, --home-dir)
-
-save()
-{
-	[ ! -d tmp ] && mkdir tmp
-	for i in passwd group shadow gshadow
-	do
-		[ -f /etc/$i  ] && cp /etc/$i  tmp/$i
-	done
-
-	true
-}
-
-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
-
-cp data/{passwd,shadow,group,gshadow} /etc/
-
-lines_passwd=$(wc -l /etc/passwd | cut -f1 -d" ")
-lines_shadow=$(wc -l /etc/shadow | cut -f1 -d" ")
-lines_group=$(wc -l /etc/group | cut -f1 -d" ")
-lines_gshadow=$(wc -l /etc/gshadow | cut -f1 -d" ")
-
-echo -n "Create user test3, using options..."
-useradd --comment "comment test3" \
-	--expiredate "2006-02-04" \
-	--shell "/bin/bash" \
-	--inactive "12" \
-	--home-dir "/nonexistenthomedir" \
-	test3
-echo "OK"
-
-echo "test if the user was added with the same uid"
-echo -n "  passwd..."
-getent passwd test3 |
-	egrep "^test3:x:([0-9]+):\\1:comment test3:/nonexistenthomedir:/bin/bash$"
-echo "  OK"
-uid=$(getent passwd test3|sed -ne "s/test3:x:\([0-9]*\):.*/\\1/p")
-# uid must be greater than UID_MIN (in login.defs)
-echo -n "  uid: $uid < 1000..."
-test $uid -ge 1000
-echo -n "  group..."
-getent group test3  | egrep "^test3:x:$uid:$"
-echo "  OK"
-echo -n "  shadow..."
-getent shadow test3 | egrep "^test3:!:[0-9]+:0:99999:7:12:13183:$"
-echo "  OK"
-echo -n "  gshadow..."
-egrep "^test3:!::$" /etc/gshadow
-echo "  OK"
-# the home directory should not exist
-echo -n "  no homedir..."
-test -d /home/test3 && exit 1 || true
-echo "  OK"
-echo -n "  number of lines"
-test $(( lines_passwd  + 1 )) = $(wc -l /etc/passwd | cut -f1 -d" ")
-echo -n "."
-test $(( lines_group   + 1 )) = $(wc -l /etc/group | cut -f1 -d" ")
-echo -n "."
-test $(( lines_shadow  + 1 )) = $(wc -l /etc/shadow | cut -f1 -d" ")
-echo -n "."
-test $(( lines_gshadow + 1 )) = $(wc -l /etc/gshadow | cut -f1 -d" ")
-echo -n "."
-echo "  OK"
-
-echo -n "delete this user..."
-userdel test3
-echo "OK"
-
-echo "check if the user was deleted"
-echo -n "  no entries..."
-egrep "^test3:" \
-      /etc/passwd /etc/group /etc/shadow /etc/gshadow && exit 1 || true
-echo "  OK"
-echo -n "  no homedir..."
-test -d /home/test3 && exit 1 || true
-echo "  OK"
-echo -n "  number of lines"
-test $lines_passwd  = $(wc -l /etc/passwd | cut -f1 -d" ")
-echo -n "."
-test $lines_group   = $(wc -l /etc/group | cut -f1 -d" ")
-echo -n "."
-test $lines_shadow  = $(wc -l /etc/shadow | cut -f1 -d" ")
-echo -n "."
-test $lines_gshadow = $(wc -l /etc/gshadow | cut -f1 -d" ")
-echo -n "."
-echo "  OK"
-

Deleted: debian/trunk/tests/usertools/01/run4
===================================================================
--- debian/trunk/tests/usertools/01/run4	2008-01-12 15:08:54 UTC (rev 1708)
+++ debian/trunk/tests/usertools/01/run4	2008-01-12 15:10:58 UTC (rev 1709)
@@ -1,180 +0,0 @@
-#!/bin/sh
-
-set -e
-
-cd $(dirname $0)
-
-# Rational:
-# Test the -u option of useradd (we can specify the new user UID)
-# Check that we can't create an user with the same UID without the -o
-# option.
-
-save()
-{
-	[ ! -d tmp ] && mkdir tmp
-	for i in passwd group shadow gshadow
-	do
-		[ -f /etc/$i  ] && cp /etc/$i  tmp/$i
-	done
-
-	true
-}
-
-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
-
-cp data/{passwd,shadow,group,gshadow} /etc/
-
-lines_passwd=$(wc -l /etc/passwd | cut -f1 -d" ")
-lines_shadow=$(wc -l /etc/shadow | cut -f1 -d" ")
-lines_group=$(wc -l /etc/group | cut -f1 -d" ")
-lines_gshadow=$(wc -l /etc/gshadow | cut -f1 -d" ")
-
-echo -n "Create user test4..."
-useradd -u 4242 test4
-echo "OK"
-
-echo "test if the user was added with the right uid"
-echo -n "  passwd..."
-getent passwd test4 |
-	egrep "^test4:x:4242:4242::/home/test4:/bin/sh$"
-echo "  OK"
-echo -n "  group..."
-getent group test4 | egrep "^test4:x:4242:$"
-echo "  OK"
-echo -n "  shadow..."
-getent shadow test4 | egrep "^test4:!:[0-9]+:0:99999:7:::$"
-echo "  OK"
-echo -n "  gshadow..."
-egrep "^test4:!::$" /etc/gshadow
-echo "  OK"
-# the home directory should not exist
-echo -n "  no homedir..."
-test -d /home/test4 && exit 1 || true
-echo "  OK"
-echo -n "  number of lines"
-test $(( lines_passwd  + 1 )) = $(wc -l /etc/passwd | cut -f1 -d" ")
-echo -n "."
-test $(( lines_group   + 1 )) = $(wc -l /etc/group | cut -f1 -d" ")
-echo -n "."
-test $(( lines_shadow  + 1 )) = $(wc -l /etc/shadow | cut -f1 -d" ")
-echo -n "."
-test $(( lines_gshadow + 1 )) = $(wc -l /etc/gshadow | cut -f1 -d" ")
-echo -n "."
-echo "  OK"
-
-echo "do NOT delete this user"
-
-echo -n "Create user test5 with the same uid..."
-useradd -u 4242 test5 && exit 1 || true
-echo "All right, useradd return an error."
-
-echo "This user should not exist"
-echo -n "  no entries..."
-egrep "^test5:" \
-      /etc/passwd /etc/group /etc/shadow /etc/gshadow && exit 1 || true
-echo "  OK"
-echo -n "  no homedir..."
-test -d /home/test5 && exit 1 || true
-echo "  OK"
-echo -n "  number of lines"
-test $(( lines_passwd  + 1 )) = $(wc -l /etc/passwd | cut -f1 -d" ")
-echo -n "."
-test $(( lines_group   + 1 )) = $(wc -l /etc/group | cut -f1 -d" ")
-echo -n "."
-test $(( lines_shadow  + 1 )) = $(wc -l /etc/shadow | cut -f1 -d" ")
-echo -n "."
-test $(( lines_gshadow + 1 )) = $(wc -l /etc/gshadow | cut -f1 -d" ")
-echo -n "."
-echo "  OK"
-
-echo -n "Create user test6 with the same uid..."
-useradd -o -u 4242 test6
-echo "OK"
-
-echo "test if the user was added with the right uid"
-echo -n "  passwd..."
-getent passwd test6 |
-	egrep "^test6:x:4242:4243::/home/test6:/bin/sh$"
-echo "  OK"
-echo -n "  group..."
-getent group test6 | egrep "^test6:x:4243:$"
-echo "  OK"
-echo -n "  shadow..."
-getent shadow test6 | egrep "^test6:!:[0-9]+:0:99999:7:::$"
-echo "  OK"
-echo -n "  gshadow..."
-egrep "^test6:!::$" /etc/gshadow
-echo "  OK"
-# the home directory should not exist
-echo -n "  no homedir..."
-test -d /home/test6 && exit 1 || true
-echo "  OK"
-echo -n "  number of lines"
-test $(( lines_passwd  + 2 )) = $(wc -l /etc/passwd | cut -f1 -d" ")
-echo -n "."
-test $(( lines_group   + 2 )) = $(wc -l /etc/group | cut -f1 -d" ")
-echo -n "."
-test $(( lines_shadow  + 2 )) = $(wc -l /etc/shadow | cut -f1 -d" ")
-echo -n "."
-test $(( lines_gshadow + 2 )) = $(wc -l /etc/gshadow | cut -f1 -d" ")
-echo -n "."
-echo "  OK"
-
-echo -n "delete user test4..."
-userdel test4
-echo "OK"
-
-echo "check if the user was deleted"
-echo -n "  no entries..."
-egrep "^test4:" \
-      /etc/passwd /etc/group /etc/shadow /etc/gshadow && exit 1 || true
-echo "  OK"
-echo -n "  no homedir..."
-test -d /home/test4 && exit 1 || true
-echo "  OK"
-echo -n "  number of lines"
-test $(( lines_passwd  + 1 )) = $(wc -l /etc/passwd | cut -f1 -d" ")
-echo -n "."
-test $(( lines_group   + 1 )) = $(wc -l /etc/group | cut -f1 -d" ")
-echo -n "."
-test $(( lines_shadow  + 1 )) = $(wc -l /etc/shadow | cut -f1 -d" ")
-echo -n "."
-test $(( lines_gshadow + 1 )) = $(wc -l /etc/gshadow | cut -f1 -d" ")
-echo -n "."
-echo "  OK"
-
-echo -n "delete user test6..."
-userdel test6
-echo "OK"
-
-echo "check if the user was deleted"
-echo -n "  no entries..."
-egrep "^test6:" \
-      /etc/passwd /etc/group /etc/shadow /etc/gshadow && exit 1 || true
-echo "  OK"
-echo -n "  no homedir..."
-test -d /home/test6 && exit 1 || true
-echo "  OK"
-echo -n "  number of lines"
-test $lines_passwd  = $(wc -l /etc/passwd | cut -f1 -d" ")
-echo -n "."
-test $lines_group   = $(wc -l /etc/group | cut -f1 -d" ")
-echo -n "."
-test $lines_shadow  = $(wc -l /etc/shadow | cut -f1 -d" ")
-echo -n "."
-test $lines_gshadow = $(wc -l /etc/gshadow | cut -f1 -d" ")
-echo -n "."
-echo "  OK"
-

Deleted: debian/trunk/tests/usertools/01/run5
===================================================================
--- debian/trunk/tests/usertools/01/run5	2008-01-12 15:08:54 UTC (rev 1708)
+++ debian/trunk/tests/usertools/01/run5	2008-01-12 15:10:58 UTC (rev 1709)
@@ -1,53 +0,0 @@
-#!/bin/sh
-
-set -e
-
-cd $(dirname $0)
-
-# Rational:
-# Test useradd -g rejects negative GID
-# (In fact useradd fall back to a textual match)
-
-save()
-{
-	[ ! -d tmp ] && mkdir tmp
-	for i in passwd group shadow gshadow
-	do
-		[ -f /etc/$i  ] && cp /etc/$i  tmp/$i
-	done
-
-	true
-}
-
-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
-
-cp data/{passwd,shadow,group,gshadow} /etc/
-
-lines_passwd=$(wc -l /etc/passwd | cut -f1 -d" ")
-lines_shadow=$(wc -l /etc/shadow | cut -f1 -d" ")
-lines_group=$(wc -l /etc/group | cut -f1 -d" ")
-lines_gshadow=$(wc -l /etc/gshadow | cut -f1 -d" ")
-
-################################################################################
-echo -n "Create user test1 in the non existent group -1..."
-msg=$(useradd test1 -g -1 2>&1) && exit 1 || {
-	status=$?
-	echo status: $status
-	test "$status" = "6"
-}
-echo msg: $msg
-test "$msg" = "useradd: unknown group -1"
-echo "OK"
-

Deleted: debian/trunk/tests/usertools/01/run6
===================================================================
--- debian/trunk/tests/usertools/01/run6	2008-01-12 15:08:54 UTC (rev 1708)
+++ debian/trunk/tests/usertools/01/run6	2008-01-12 15:10:58 UTC (rev 1709)
@@ -1,51 +0,0 @@
-#!/bin/sh
-
-set -e
-
-cd $(dirname $0)
-
-# Rational:
-# Test useradd -g checks that the given group exists
-
-save()
-{
-	[ ! -d tmp ] && mkdir tmp
-	for i in passwd group shadow gshadow
-	do
-		[ -f /etc/$i  ] && cp /etc/$i  tmp/$i
-	done
-
-	true
-}
-
-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
-
-cp data/{passwd,shadow,group,gshadow} /etc/
-
-lines_passwd=$(wc -l /etc/passwd | cut -f1 -d" ")
-lines_shadow=$(wc -l /etc/shadow | cut -f1 -d" ")
-lines_group=$(wc -l /etc/group | cut -f1 -d" ")
-lines_gshadow=$(wc -l /etc/gshadow | cut -f1 -d" ")
-
-################################################################################
-echo -n "Create user test2 in the non existent group nekral..."
-msg=$(useradd test2 -g nekral 2>&1) && exit 1 || {
-	status=$?
-	echo status: $status
-	test "$status" = "6"
-}
-echo msg: $msg
-test "$msg" = "useradd: unknown group nekral"
-echo "OK"

Deleted: debian/trunk/tests/usertools/01/run7
===================================================================
--- debian/trunk/tests/usertools/01/run7	2008-01-12 15:08:54 UTC (rev 1708)
+++ debian/trunk/tests/usertools/01/run7	2008-01-12 15:10:58 UTC (rev 1709)
@@ -1,79 +0,0 @@
-#!/bin/sh
-
-set -e
-
-cd $(dirname $0)
-
-# Rational:
-# Test useradd -g accepts numerical groups
-
-save()
-{
-	[ ! -d tmp ] && mkdir tmp
-	for i in passwd group shadow gshadow
-	do
-		[ -f /etc/$i  ] && cp /etc/$i  tmp/$i
-	done
-
-	true
-}
-
-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
-
-cp data/{passwd,shadow,group,gshadow} /etc/
-
-lines_passwd=$(wc -l /etc/passwd | cut -f1 -d" ")
-lines_shadow=$(wc -l /etc/shadow | cut -f1 -d" ")
-lines_group=$(wc -l /etc/group | cut -f1 -d" ")
-lines_gshadow=$(wc -l /etc/gshadow | cut -f1 -d" ")
-
-################################################################################
-echo -n "Create user test3 in group daemon (1)..."
-useradd test3 -g 1
-
-echo "test if the user was added"
-echo -n "  passwd..."
-getent passwd test3 |
-	egrep "^test3:x:([0-9]+):1::/home/test3:/bin/sh$"
-echo "  OK"
-uid=$(getent passwd test3|sed -ne "s/test3:x:\([0-9]*\):.*/\\1/p")
-# uid must be greater than UID_MIN (in login.defs)
-echo -n "  uid: $uid < 1000..."
-test $uid -ge 1000
-echo "  OK"
-echo -n "  no group test3..."
-getent group test3  | egrep "^test3:x:$uid:$" && false || true
-echo "  OK"
-echo -n "  shadow..."
-getent shadow test3 | egrep "^test3:!:[0-9]+:0:99999:7:::$"
-echo "  OK"
-echo -n "  no group test3 in gshadow..."
-egrep "^test3:!::$" /etc/gshadow && false || true
-echo "  OK"
-# the home directory should not exist
-echo -n "  no homedir..."
-test -d /home/test3 && exit 1 || true
-echo "  OK"
-echo -n "  number of lines"
-test $(( lines_passwd  + 1 )) = $(wc -l /etc/passwd | cut -f1 -d" ")
-echo -n "."
-test $(( lines_group       )) = $(wc -l /etc/group | cut -f1 -d" ")
-echo -n "."
-test $(( lines_shadow  + 1 )) = $(wc -l /etc/shadow | cut -f1 -d" ")
-echo -n "."
-test $(( lines_gshadow     )) = $(wc -l /etc/gshadow | cut -f1 -d" ")
-echo -n "."
-echo "  OK"
-

Deleted: debian/trunk/tests/usertools/01/run8
===================================================================
--- debian/trunk/tests/usertools/01/run8	2008-01-12 15:08:54 UTC (rev 1708)
+++ debian/trunk/tests/usertools/01/run8	2008-01-12 15:10:58 UTC (rev 1709)
@@ -1,85 +0,0 @@
-#!/bin/sh
-
-set -e
-
-cd $(dirname $0)
-
-# Rational:
-# Test useradd -g accepts textual groups
-
-save()
-{
-	[ ! -d tmp ] && mkdir tmp
-	for i in passwd group shadow gshadow
-	do
-		[ -f /etc/$i  ] && cp /etc/$i  tmp/$i
-	done
-
-	true
-}
-
-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
-
-cp data/{passwd,shadow,group,gshadow} /etc/
-
-lines_passwd=$(wc -l /etc/passwd | cut -f1 -d" ")
-lines_shadow=$(wc -l /etc/shadow | cut -f1 -d" ")
-lines_group=$(wc -l /etc/group | cut -f1 -d" ")
-lines_gshadow=$(wc -l /etc/gshadow | cut -f1 -d" ")
-
-################################################################################
-echo -n "Create user test4 in group nogroup..."
-useradd test4 -g nogroup
-
-echo "test if the user was added"
-echo -n "  passwd..."
-getent passwd test4 |
-	egrep "^test4:x:([0-9]+):65534::/home/test4:/bin/sh$"
-echo "  OK"
-uid=$(getent passwd test4|sed -ne "s/test4:x:\([0-9]*\):.*/\\1/p")
-# uid must be greater than UID_MIN (in login.defs)
-echo -n "  uid: $uid < 1000..."
-test $uid -ge 1000
-echo "  OK"
-echo -n "  no group test4..."
-getent group test4  | egrep "^test4:x:$uid:$" && false || true
-echo "  OK"
-echo -n "  test4 in group nogroup..."
-egrep "^nogroup:x:65534:$" /etc/group
-echo "  OK"
-echo -n "  shadow..."
-getent shadow test4 | egrep "^test4:!:[0-9]+:0:99999:7:::$"
-echo "  OK"
-echo -n "  no group test4 in gshadow..."
-egrep "^test4:!::$" /etc/gshadow && false || true
-echo "  OK"
-echo -n "  test4 in group nogroup (in gshadow)..."
-egrep "^nogroup:\*::$" /etc/gshadow
-echo "  OK"
-# the home directory should not exist
-echo -n "  no homedir..."
-test -d /home/test4 && exit 1 || true
-echo "  OK"
-echo -n "  number of lines"
-test $(( lines_passwd  + 1 )) = $(wc -l /etc/passwd | cut -f1 -d" ")
-echo -n "."
-test $(( lines_group       )) = $(wc -l /etc/group | cut -f1 -d" ")
-echo -n "."
-test $(( lines_shadow  + 1 )) = $(wc -l /etc/shadow | cut -f1 -d" ")
-echo -n "."
-test $(( lines_gshadow     )) = $(wc -l /etc/gshadow | cut -f1 -d" ")
-echo -n "."
-echo "  OK"
-

Deleted: debian/trunk/tests/usertools/01/run9
===================================================================
--- debian/trunk/tests/usertools/01/run9	2008-01-12 15:08:54 UTC (rev 1708)
+++ debian/trunk/tests/usertools/01/run9	2008-01-12 15:10:58 UTC (rev 1709)
@@ -1,80 +0,0 @@
-#!/bin/sh
-
-set -e
-
-cd $(dirname $0)
-
-# Rational:
-# Test that usermod can change the informations on an user
-
-save()
-{
-	[ ! -d tmp ] && mkdir tmp
-	for i in passwd group shadow gshadow
-	do
-		[ -f /etc/$i  ] && cp /etc/$i  tmp/$i
-	done
-
-	true
-}
-
-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
-
-cp data/{passwd,shadow,group,gshadow} /etc/
-
-lines_passwd=$(wc -l /etc/passwd | cut -f1 -d" ")
-lines_shadow=$(wc -l /etc/shadow | cut -f1 -d" ")
-lines_group=$(wc -l /etc/group | cut -f1 -d" ")
-lines_gshadow=$(wc -l /etc/gshadow | cut -f1 -d" ")
-
-echo -n "Create user test1..."
-useradd test1
-echo "OK"
-
-uid=$(getent passwd test1|sed -ne "s/test1:x:\([0-9]*\):.*/\\1/p")
-
-echo -n "Change user test1..."
-usermod -g 1 --comment "comment" -e 2000-01-01 -f 17 -s /bin/bash -d /tmp test1
-echo "OK"
-
-echo "test if the user was changed"
-echo -n "  passwd..."
-getent passwd test1 |
-	egrep "^test1:x:$uid:1:comment:/tmp:/bin/bash$"
-echo "  OK"
-echo -n "  group..."
-getent group test1  | egrep "^test1:x:$uid:$"
-echo "  OK"
-echo -n "  shadow..."
-getent shadow test1 | egrep "^test1:!:[0-9]+:0:99999:7:17:10957:$"
-echo "  OK"
-echo -n "  gshadow..."
-egrep "^test1:!::$" /etc/gshadow
-echo "  OK"
-# the home directory should not exist
-echo -n "  no homedir..."
-test -d /home/test1 && exit 1 || true
-echo "  OK"
-echo -n "  number of lines"
-test $(( lines_passwd  + 1 )) = $(wc -l /etc/passwd | cut -f1 -d" ")
-echo -n "."
-test $(( lines_group   + 1 )) = $(wc -l /etc/group | cut -f1 -d" ")
-echo -n "."
-test $(( lines_shadow  + 1 )) = $(wc -l /etc/shadow | cut -f1 -d" ")
-echo -n "."
-test $(( lines_gshadow + 1 )) = $(wc -l /etc/gshadow | cut -f1 -d" ")
-echo -n "."
-echo "  OK"
-




More information about the Pkg-shadow-commits mailing list