[Pkg-shadow-commits] r3622 - in debian/trunk/tests/cktools: grpck grpck/37_grpck_invalid_option grpck/37_grpck_invalid_option/config grpck/37_grpck_invalid_option/config/etc grpck/37_grpck_invalid_option/data pwck pwck/22_pwck_usage pwck/22_pwck_usage/config pwck/22_pwck_usage/config/etc pwck/22_pwck_usage/data pwck/23_pwck_locked_passwd pwck/23_pwck_locked_passwd/config pwck/23_pwck_locked_passwd/config/etc pwck/23_pwck_locked_passwd/data pwck/24_pwck_locked_shadow pwck/24_pwck_locked_shadow/config pwck/24_pwck_locked_shadow/config/etc pwck/24_pwck_locked_shadow/data pwck/25_pwck_usage_invalid_option pwck/25_pwck_usage_invalid_option/config pwck/25_pwck_usage_invalid_option/config/etc pwck/25_pwck_usage_invalid_option/data pwck/26_pwck_usage-s-r pwck/26_pwck_usage-s-r/config pwck/26_pwck_usage-s-r/config/etc pwck/26_pwck_usage-s-r/data pwck/27_pwck_usage_3_files pwck/27_pwck_usage_3_files/config pwck/27_pwck_usage_3_files/config/etc pwck/27_pwck_usage_3_files/data pwck/28_pwck_no_shadow_file pwck/28_pwck_no_shadow_file/config pwck/28_pwck_no_shadow_file/config/etc pwck/28_pwck_no_shadow_file/data pwck/29_pwck_password_change_in_future pwck/29_pwck_password_change_in_future/config pwck/29_pwck_password_change_in_future/config/etc pwck/29_pwck_password_change_in_future/data pwck/30_pwck_NIS_entries pwck/30_pwck_NIS_entries/config pwck/30_pwck_NIS_entries/config/etc pwck/30_pwck_NIS_entries/data pwck/31_pwck_shadow_entry_passwd_no_x pwck/31_pwck_shadow_entry_passwd_no_x/config pwck/31_pwck_shadow_entry_passwd_no_x/config/etc pwck/31_pwck_shadow_entry_passwd_no_x/data pwck/32_pwck_quiet pwck/32_pwck_quiet/config pwck/32_pwck_quiet/config/etc pwck/32_pwck_quiet/data

Nicolas FRANÇOIS nekral-guest at alioth.debian.org
Mon Nov 14 23:09:10 UTC 2011


Author: nekral-guest
Date: 2011-11-14 23:09:09 +0000 (Mon, 14 Nov 2011)
New Revision: 3622

Added:
   debian/trunk/tests/cktools/grpck/37_grpck_invalid_option/
   debian/trunk/tests/cktools/grpck/37_grpck_invalid_option/config.txt
   debian/trunk/tests/cktools/grpck/37_grpck_invalid_option/config/
   debian/trunk/tests/cktools/grpck/37_grpck_invalid_option/config/etc/
   debian/trunk/tests/cktools/grpck/37_grpck_invalid_option/config/etc/group
   debian/trunk/tests/cktools/grpck/37_grpck_invalid_option/config/etc/gshadow
   debian/trunk/tests/cktools/grpck/37_grpck_invalid_option/config/etc/passwd
   debian/trunk/tests/cktools/grpck/37_grpck_invalid_option/config/etc/shadow
   debian/trunk/tests/cktools/grpck/37_grpck_invalid_option/data/
   debian/trunk/tests/cktools/grpck/37_grpck_invalid_option/data/usage.out
   debian/trunk/tests/cktools/grpck/37_grpck_invalid_option/grpck.test
   debian/trunk/tests/cktools/pwck/22_pwck_usage/
   debian/trunk/tests/cktools/pwck/22_pwck_usage/config.txt
   debian/trunk/tests/cktools/pwck/22_pwck_usage/config/
   debian/trunk/tests/cktools/pwck/22_pwck_usage/config/etc/
   debian/trunk/tests/cktools/pwck/22_pwck_usage/config/etc/group
   debian/trunk/tests/cktools/pwck/22_pwck_usage/config/etc/gshadow
   debian/trunk/tests/cktools/pwck/22_pwck_usage/config/etc/passwd
   debian/trunk/tests/cktools/pwck/22_pwck_usage/config/etc/shadow
   debian/trunk/tests/cktools/pwck/22_pwck_usage/data/
   debian/trunk/tests/cktools/pwck/22_pwck_usage/data/usage.out
   debian/trunk/tests/cktools/pwck/22_pwck_usage/pwck.test
   debian/trunk/tests/cktools/pwck/23_pwck_locked_passwd/
   debian/trunk/tests/cktools/pwck/23_pwck_locked_passwd/config.txt
   debian/trunk/tests/cktools/pwck/23_pwck_locked_passwd/config/
   debian/trunk/tests/cktools/pwck/23_pwck_locked_passwd/config/etc/
   debian/trunk/tests/cktools/pwck/23_pwck_locked_passwd/config/etc/group
   debian/trunk/tests/cktools/pwck/23_pwck_locked_passwd/config/etc/gshadow
   debian/trunk/tests/cktools/pwck/23_pwck_locked_passwd/config/etc/passwd
   debian/trunk/tests/cktools/pwck/23_pwck_locked_passwd/config/etc/shadow
   debian/trunk/tests/cktools/pwck/23_pwck_locked_passwd/data/
   debian/trunk/tests/cktools/pwck/23_pwck_locked_passwd/data/pwck.err
   debian/trunk/tests/cktools/pwck/23_pwck_locked_passwd/pwck.test
   debian/trunk/tests/cktools/pwck/24_pwck_locked_shadow/
   debian/trunk/tests/cktools/pwck/24_pwck_locked_shadow/config.txt
   debian/trunk/tests/cktools/pwck/24_pwck_locked_shadow/config/
   debian/trunk/tests/cktools/pwck/24_pwck_locked_shadow/config/etc/
   debian/trunk/tests/cktools/pwck/24_pwck_locked_shadow/config/etc/group
   debian/trunk/tests/cktools/pwck/24_pwck_locked_shadow/config/etc/gshadow
   debian/trunk/tests/cktools/pwck/24_pwck_locked_shadow/config/etc/passwd
   debian/trunk/tests/cktools/pwck/24_pwck_locked_shadow/config/etc/shadow
   debian/trunk/tests/cktools/pwck/24_pwck_locked_shadow/data/
   debian/trunk/tests/cktools/pwck/24_pwck_locked_shadow/data/pwck.err
   debian/trunk/tests/cktools/pwck/24_pwck_locked_shadow/pwck.test
   debian/trunk/tests/cktools/pwck/25_pwck_usage_invalid_option/
   debian/trunk/tests/cktools/pwck/25_pwck_usage_invalid_option/config.txt
   debian/trunk/tests/cktools/pwck/25_pwck_usage_invalid_option/config/
   debian/trunk/tests/cktools/pwck/25_pwck_usage_invalid_option/config/etc/
   debian/trunk/tests/cktools/pwck/25_pwck_usage_invalid_option/config/etc/group
   debian/trunk/tests/cktools/pwck/25_pwck_usage_invalid_option/config/etc/gshadow
   debian/trunk/tests/cktools/pwck/25_pwck_usage_invalid_option/config/etc/passwd
   debian/trunk/tests/cktools/pwck/25_pwck_usage_invalid_option/config/etc/shadow
   debian/trunk/tests/cktools/pwck/25_pwck_usage_invalid_option/data/
   debian/trunk/tests/cktools/pwck/25_pwck_usage_invalid_option/data/pwck.err
   debian/trunk/tests/cktools/pwck/25_pwck_usage_invalid_option/pwck.test
   debian/trunk/tests/cktools/pwck/26_pwck_usage-s-r/
   debian/trunk/tests/cktools/pwck/26_pwck_usage-s-r/config.txt
   debian/trunk/tests/cktools/pwck/26_pwck_usage-s-r/config/
   debian/trunk/tests/cktools/pwck/26_pwck_usage-s-r/config/etc/
   debian/trunk/tests/cktools/pwck/26_pwck_usage-s-r/config/etc/group
   debian/trunk/tests/cktools/pwck/26_pwck_usage-s-r/config/etc/gshadow
   debian/trunk/tests/cktools/pwck/26_pwck_usage-s-r/config/etc/passwd
   debian/trunk/tests/cktools/pwck/26_pwck_usage-s-r/config/etc/shadow
   debian/trunk/tests/cktools/pwck/26_pwck_usage-s-r/data/
   debian/trunk/tests/cktools/pwck/26_pwck_usage-s-r/data/pwck.err
   debian/trunk/tests/cktools/pwck/26_pwck_usage-s-r/pwck.test
   debian/trunk/tests/cktools/pwck/27_pwck_usage_3_files/
   debian/trunk/tests/cktools/pwck/27_pwck_usage_3_files/config.txt
   debian/trunk/tests/cktools/pwck/27_pwck_usage_3_files/config/
   debian/trunk/tests/cktools/pwck/27_pwck_usage_3_files/config/etc/
   debian/trunk/tests/cktools/pwck/27_pwck_usage_3_files/config/etc/group
   debian/trunk/tests/cktools/pwck/27_pwck_usage_3_files/config/etc/gshadow
   debian/trunk/tests/cktools/pwck/27_pwck_usage_3_files/config/etc/passwd
   debian/trunk/tests/cktools/pwck/27_pwck_usage_3_files/config/etc/shadow
   debian/trunk/tests/cktools/pwck/27_pwck_usage_3_files/data/
   debian/trunk/tests/cktools/pwck/27_pwck_usage_3_files/data/pwck.err
   debian/trunk/tests/cktools/pwck/27_pwck_usage_3_files/pwck.test
   debian/trunk/tests/cktools/pwck/28_pwck_no_shadow_file/
   debian/trunk/tests/cktools/pwck/28_pwck_no_shadow_file/config.txt
   debian/trunk/tests/cktools/pwck/28_pwck_no_shadow_file/config/
   debian/trunk/tests/cktools/pwck/28_pwck_no_shadow_file/config/etc/
   debian/trunk/tests/cktools/pwck/28_pwck_no_shadow_file/config/etc/group
   debian/trunk/tests/cktools/pwck/28_pwck_no_shadow_file/config/etc/gshadow
   debian/trunk/tests/cktools/pwck/28_pwck_no_shadow_file/config/etc/passwd
   debian/trunk/tests/cktools/pwck/28_pwck_no_shadow_file/config/etc/shadow
   debian/trunk/tests/cktools/pwck/28_pwck_no_shadow_file/data/
   debian/trunk/tests/cktools/pwck/28_pwck_no_shadow_file/data/pwck.out
   debian/trunk/tests/cktools/pwck/28_pwck_no_shadow_file/pwck.test
   debian/trunk/tests/cktools/pwck/29_pwck_password_change_in_future/
   debian/trunk/tests/cktools/pwck/29_pwck_password_change_in_future/config.txt
   debian/trunk/tests/cktools/pwck/29_pwck_password_change_in_future/config/
   debian/trunk/tests/cktools/pwck/29_pwck_password_change_in_future/config/etc/
   debian/trunk/tests/cktools/pwck/29_pwck_password_change_in_future/config/etc/group
   debian/trunk/tests/cktools/pwck/29_pwck_password_change_in_future/config/etc/gshadow
   debian/trunk/tests/cktools/pwck/29_pwck_password_change_in_future/config/etc/passwd
   debian/trunk/tests/cktools/pwck/29_pwck_password_change_in_future/config/etc/shadow
   debian/trunk/tests/cktools/pwck/29_pwck_password_change_in_future/data/
   debian/trunk/tests/cktools/pwck/29_pwck_password_change_in_future/data/pwck.out
   debian/trunk/tests/cktools/pwck/29_pwck_password_change_in_future/pwck.test
   debian/trunk/tests/cktools/pwck/30_pwck_NIS_entries/
   debian/trunk/tests/cktools/pwck/30_pwck_NIS_entries/config.txt
   debian/trunk/tests/cktools/pwck/30_pwck_NIS_entries/config/
   debian/trunk/tests/cktools/pwck/30_pwck_NIS_entries/config/etc/
   debian/trunk/tests/cktools/pwck/30_pwck_NIS_entries/config/etc/group
   debian/trunk/tests/cktools/pwck/30_pwck_NIS_entries/config/etc/gshadow
   debian/trunk/tests/cktools/pwck/30_pwck_NIS_entries/config/etc/passwd
   debian/trunk/tests/cktools/pwck/30_pwck_NIS_entries/config/etc/shadow
   debian/trunk/tests/cktools/pwck/30_pwck_NIS_entries/data/
   debian/trunk/tests/cktools/pwck/30_pwck_NIS_entries/data/pwck.out
   debian/trunk/tests/cktools/pwck/30_pwck_NIS_entries/pwck.test
   debian/trunk/tests/cktools/pwck/31_pwck_shadow_entry_passwd_no_x/
   debian/trunk/tests/cktools/pwck/31_pwck_shadow_entry_passwd_no_x/config.txt
   debian/trunk/tests/cktools/pwck/31_pwck_shadow_entry_passwd_no_x/config/
   debian/trunk/tests/cktools/pwck/31_pwck_shadow_entry_passwd_no_x/config/etc/
   debian/trunk/tests/cktools/pwck/31_pwck_shadow_entry_passwd_no_x/config/etc/group
   debian/trunk/tests/cktools/pwck/31_pwck_shadow_entry_passwd_no_x/config/etc/gshadow
   debian/trunk/tests/cktools/pwck/31_pwck_shadow_entry_passwd_no_x/config/etc/passwd
   debian/trunk/tests/cktools/pwck/31_pwck_shadow_entry_passwd_no_x/config/etc/shadow
   debian/trunk/tests/cktools/pwck/31_pwck_shadow_entry_passwd_no_x/data/
   debian/trunk/tests/cktools/pwck/31_pwck_shadow_entry_passwd_no_x/data/pwck.out
   debian/trunk/tests/cktools/pwck/31_pwck_shadow_entry_passwd_no_x/pwck.test
   debian/trunk/tests/cktools/pwck/32_pwck_quiet/
   debian/trunk/tests/cktools/pwck/32_pwck_quiet/config.txt
   debian/trunk/tests/cktools/pwck/32_pwck_quiet/config/
   debian/trunk/tests/cktools/pwck/32_pwck_quiet/config/etc/
   debian/trunk/tests/cktools/pwck/32_pwck_quiet/config/etc/group
   debian/trunk/tests/cktools/pwck/32_pwck_quiet/config/etc/gshadow
   debian/trunk/tests/cktools/pwck/32_pwck_quiet/config/etc/passwd
   debian/trunk/tests/cktools/pwck/32_pwck_quiet/config/etc/shadow
   debian/trunk/tests/cktools/pwck/32_pwck_quiet/data/
   debian/trunk/tests/cktools/pwck/32_pwck_quiet/data/pwck.out
   debian/trunk/tests/cktools/pwck/32_pwck_quiet/pwck.test
Log:
Add tests
 * grpck (1)
 * pwck (11)


Added: debian/trunk/tests/cktools/grpck/37_grpck_invalid_option/config/etc/group
===================================================================
--- debian/trunk/tests/cktools/grpck/37_grpck_invalid_option/config/etc/group	                        (rev 0)
+++ debian/trunk/tests/cktools/grpck/37_grpck_invalid_option/config/etc/group	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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/cktools/grpck/37_grpck_invalid_option/config/etc/gshadow
===================================================================
--- debian/trunk/tests/cktools/grpck/37_grpck_invalid_option/config/etc/gshadow	                        (rev 0)
+++ debian/trunk/tests/cktools/grpck/37_grpck_invalid_option/config/etc/gshadow	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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/cktools/grpck/37_grpck_invalid_option/config/etc/passwd
===================================================================
--- debian/trunk/tests/cktools/grpck/37_grpck_invalid_option/config/etc/passwd	                        (rev 0)
+++ debian/trunk/tests/cktools/grpck/37_grpck_invalid_option/config/etc/passwd	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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/cktools/grpck/37_grpck_invalid_option/config/etc/shadow
===================================================================
--- debian/trunk/tests/cktools/grpck/37_grpck_invalid_option/config/etc/shadow	                        (rev 0)
+++ debian/trunk/tests/cktools/grpck/37_grpck_invalid_option/config/etc/shadow	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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/cktools/grpck/37_grpck_invalid_option/config.txt
===================================================================
--- debian/trunk/tests/cktools/grpck/37_grpck_invalid_option/config.txt	                        (rev 0)
+++ debian/trunk/tests/cktools/grpck/37_grpck_invalid_option/config.txt	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,10 @@
+# no testsuite password
+# root password: rootF00barbaz
+# myuser password: myuserF00barbaz
+
+user foo, in group users (only in /etc/group)
+user foo, in group tty (only in /etc/gshadow)
+user foo, in group floppy
+user foo, admin of group disk
+user foo, admin and member of group fax
+user foo, admin and member of group cdrom (only in /etc/gshadow)

Added: debian/trunk/tests/cktools/grpck/37_grpck_invalid_option/data/usage.out
===================================================================
--- debian/trunk/tests/cktools/grpck/37_grpck_invalid_option/data/usage.out	                        (rev 0)
+++ debian/trunk/tests/cktools/grpck/37_grpck_invalid_option/data/usage.out	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,10 @@
+grpck: unrecognized option '--invalid'
+Usage: grpck [options] [group [gshadow]]
+
+Options:
+  -h, --help                    display this help message and exit
+  -r, --read-only               display errors and warnings
+                                but do not change files
+  -R, --root CHROOT_DIR         directory to chroot into
+  -s, --sort                    sort entries by UID
+

Added: debian/trunk/tests/cktools/grpck/37_grpck_invalid_option/grpck.test
===================================================================
--- debian/trunk/tests/cktools/grpck/37_grpck_invalid_option/grpck.test	                        (rev 0)
+++ debian/trunk/tests/cktools/grpck/37_grpck_invalid_option/grpck.test	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../../common/config.sh
+. ../../../common/log.sh
+
+log_start "$0" "grpck reports usage when called withan invalid option"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Call grpck with an invalid option (grpck --invalid)..."
+grpck --invalid 2>tmp/usage.out && exit 1 || {
+	status=$?
+}
+echo "OK"
+
+echo -n "Check returned status ($status)..."
+test "$status" = "1"
+echo "OK"
+
+echo "grpck reported:"
+echo "======================================================================="
+cat tmp/usage.out
+echo "======================================================================="
+echo -n "Check the usage message..."
+diff -au data/usage.out tmp/usage.out
+echo "usage message OK."
+rm -f tmp/usage.out
+
+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"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/cktools/grpck/37_grpck_invalid_option/grpck.test
___________________________________________________________________
Added: svn:executable
   + *

Added: debian/trunk/tests/cktools/pwck/22_pwck_usage/config/etc/group
===================================================================
--- debian/trunk/tests/cktools/pwck/22_pwck_usage/config/etc/group	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/22_pwck_usage/config/etc/group	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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/cktools/pwck/22_pwck_usage/config/etc/gshadow
===================================================================
--- debian/trunk/tests/cktools/pwck/22_pwck_usage/config/etc/gshadow	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/22_pwck_usage/config/etc/gshadow	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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/cktools/pwck/22_pwck_usage/config/etc/passwd
===================================================================
--- debian/trunk/tests/cktools/pwck/22_pwck_usage/config/etc/passwd	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/22_pwck_usage/config/etc/passwd	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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/cktools/pwck/22_pwck_usage/config/etc/shadow
===================================================================
--- debian/trunk/tests/cktools/pwck/22_pwck_usage/config/etc/shadow	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/22_pwck_usage/config/etc/shadow	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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/cktools/pwck/22_pwck_usage/config.txt
===================================================================
--- debian/trunk/tests/cktools/pwck/22_pwck_usage/config.txt	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/22_pwck_usage/config.txt	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,10 @@
+# no testsuite password
+# root password: rootF00barbaz
+# myuser password: myuserF00barbaz
+
+user foo, in group users (only in /etc/group)
+user foo, in group tty (only in /etc/gshadow)
+user foo, in group floppy
+user foo, admin of group disk
+user foo, admin and member of group fax
+user foo, admin and member of group cdrom (only in /etc/gshadow)

Added: debian/trunk/tests/cktools/pwck/22_pwck_usage/data/usage.out
===================================================================
--- debian/trunk/tests/cktools/pwck/22_pwck_usage/data/usage.out	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/22_pwck_usage/data/usage.out	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,10 @@
+Usage: pwck [options] [passwd [shadow]]
+
+Options:
+  -h, --help                    display this help message and exit
+  -q, --quiet                   report errors only
+  -r, --read-only               display errors and warnings
+                                but do not change files
+  -R, --root CHROOT_DIR         directory to chroot into
+  -s, --sort                    sort entries by UID
+

Added: debian/trunk/tests/cktools/pwck/22_pwck_usage/pwck.test
===================================================================
--- debian/trunk/tests/cktools/pwck/22_pwck_usage/pwck.test	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/22_pwck_usage/pwck.test	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../../common/config.sh
+. ../../../common/log.sh
+
+log_start "$0" "pwck can display its usage message"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Get pwck usage (pwck -h)..."
+pwck -h >tmp/usage.out
+
+echo "pwck reported:"
+echo "======================================================================="
+cat tmp/usage.out
+echo "======================================================================="
+echo -n "Check the usage message..."
+diff -au data/usage.out tmp/usage.out
+echo "usage message OK."
+rm -f tmp/usage.out
+
+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"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/cktools/pwck/22_pwck_usage/pwck.test
___________________________________________________________________
Added: svn:executable
   + *

Added: debian/trunk/tests/cktools/pwck/23_pwck_locked_passwd/config/etc/group
===================================================================
--- debian/trunk/tests/cktools/pwck/23_pwck_locked_passwd/config/etc/group	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/23_pwck_locked_passwd/config/etc/group	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,42 @@
+root:x:0:
+daemon:x:1:
+bin:x:2:
+sys:x:3:root
+adm:x:4:root,foo
+tty:x:5:
+disk:x:6:
+lp:x:7:foo,root
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:foo
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:foo
+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:foo
+nogroup:x:65534:
+crontab:x:101:
+Debian-exim:x:102:
+foo:x:1000:

Added: debian/trunk/tests/cktools/pwck/23_pwck_locked_passwd/config/etc/gshadow
===================================================================
--- debian/trunk/tests/cktools/pwck/23_pwck_locked_passwd/config/etc/gshadow	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/23_pwck_locked_passwd/config/etc/gshadow	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,42 @@
+root:*::
+daemon:*::
+bin:*::
+sys:*::root
+adm:*::root,foo
+tty:*::foo
+disk:*:foo:
+lp:*::foo,root
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*:foo:foo
+voice:*::
+cdrom:*:foo:foo
+floppy:*::foo
+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::
+foo:*::

Added: debian/trunk/tests/cktools/pwck/23_pwck_locked_passwd/config/etc/passwd
===================================================================
--- debian/trunk/tests/cktools/pwck/23_pwck_locked_passwd/config/etc/passwd	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/23_pwck_locked_passwd/config/etc/passwd	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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
+foo:x:1000:1000::/home/foo:/bin/false

Added: debian/trunk/tests/cktools/pwck/23_pwck_locked_passwd/config/etc/shadow
===================================================================
--- debian/trunk/tests/cktools/pwck/23_pwck_locked_passwd/config/etc/shadow	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/23_pwck_locked_passwd/config/etc/shadow	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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:::
+foo:!:12977:0:99999:7:::

Added: debian/trunk/tests/cktools/pwck/23_pwck_locked_passwd/config.txt
===================================================================
Added: debian/trunk/tests/cktools/pwck/23_pwck_locked_passwd/data/pwck.err
===================================================================
--- debian/trunk/tests/cktools/pwck/23_pwck_locked_passwd/data/pwck.err	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/23_pwck_locked_passwd/data/pwck.err	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,2 @@
+pwck: existing lock file /etc/passwd.lock without a PID
+pwck: cannot lock /etc/passwd; try again later.

Added: debian/trunk/tests/cktools/pwck/23_pwck_locked_passwd/pwck.test
===================================================================
--- debian/trunk/tests/cktools/pwck/23_pwck_locked_passwd/pwck.test	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/23_pwck_locked_passwd/pwck.test	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,60 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../../common/config.sh
+. ../../../common/log.sh
+
+log_start "$0" "pwck checks if the passwd file is locked"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config; rm -f /etc/passwd.lock' 0
+
+change_config
+
+echo -n "Create lock file for /etc/passwd..."
+touch /etc/passwd.lock
+echo "done"
+
+echo -n "Check user database (pwck)..."
+pwck 2>tmp/pwck.err && exit 1 || {
+	status=$?
+}
+echo "OK"
+
+rm -f /etc/passwd.lock
+
+echo -n "Check returned status ($status)..."
+test "$status" = "4"
+echo "OK"
+
+echo "pwck reported:"
+echo "======================================================================="
+cat tmp/pwck.err
+echo "======================================================================="
+echo -n "Check that there were a failure message..."
+diff -au data/pwck.err tmp/pwck.err
+echo "error message OK."
+rm -f tmp/pwck.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"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/cktools/pwck/23_pwck_locked_passwd/pwck.test
___________________________________________________________________
Added: svn:executable
   + *

Added: debian/trunk/tests/cktools/pwck/24_pwck_locked_shadow/config/etc/group
===================================================================
--- debian/trunk/tests/cktools/pwck/24_pwck_locked_shadow/config/etc/group	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/24_pwck_locked_shadow/config/etc/group	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,42 @@
+root:x:0:
+daemon:x:1:
+bin:x:2:
+sys:x:3:root
+adm:x:4:root,foo
+tty:x:5:
+disk:x:6:
+lp:x:7:foo,root
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:foo
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:foo
+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:foo
+nogroup:x:65534:
+crontab:x:101:
+Debian-exim:x:102:
+foo:x:1000:

Added: debian/trunk/tests/cktools/pwck/24_pwck_locked_shadow/config/etc/gshadow
===================================================================
--- debian/trunk/tests/cktools/pwck/24_pwck_locked_shadow/config/etc/gshadow	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/24_pwck_locked_shadow/config/etc/gshadow	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,42 @@
+root:*::
+daemon:*::
+bin:*::
+sys:*::root
+adm:*::root,foo
+tty:*::foo
+disk:*:foo:
+lp:*::foo,root
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*:foo:foo
+voice:*::
+cdrom:*:foo:foo
+floppy:*::foo
+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::
+foo:*::

Added: debian/trunk/tests/cktools/pwck/24_pwck_locked_shadow/config/etc/passwd
===================================================================
--- debian/trunk/tests/cktools/pwck/24_pwck_locked_shadow/config/etc/passwd	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/24_pwck_locked_shadow/config/etc/passwd	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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
+foo:x:1000:1000::/home/foo:/bin/false

Added: debian/trunk/tests/cktools/pwck/24_pwck_locked_shadow/config/etc/shadow
===================================================================
--- debian/trunk/tests/cktools/pwck/24_pwck_locked_shadow/config/etc/shadow	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/24_pwck_locked_shadow/config/etc/shadow	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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:::
+foo:!:12977:0:99999:7:::

Added: debian/trunk/tests/cktools/pwck/24_pwck_locked_shadow/config.txt
===================================================================
Added: debian/trunk/tests/cktools/pwck/24_pwck_locked_shadow/data/pwck.err
===================================================================
--- debian/trunk/tests/cktools/pwck/24_pwck_locked_shadow/data/pwck.err	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/24_pwck_locked_shadow/data/pwck.err	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,2 @@
+pwck: existing lock file /etc/shadow.lock without a PID
+pwck: cannot lock /etc/shadow; try again later.

Added: debian/trunk/tests/cktools/pwck/24_pwck_locked_shadow/pwck.test
===================================================================
--- debian/trunk/tests/cktools/pwck/24_pwck_locked_shadow/pwck.test	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/24_pwck_locked_shadow/pwck.test	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,60 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../../common/config.sh
+. ../../../common/log.sh
+
+log_start "$0" "pwck checks if the shadow file is locked"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config; rm -f /etc/shadow.lock' 0
+
+change_config
+
+echo -n "Create lock file for /etc/shadow..."
+touch /etc/shadow.lock
+echo "done"
+
+echo -n "Check user database (pwck)..."
+pwck 2>tmp/pwck.err && exit 1 || {
+	status=$?
+}
+echo "OK"
+
+rm -f /etc/shadow.lock
+
+echo -n "Check returned status ($status)..."
+test "$status" = "4"
+echo "OK"
+
+echo "pwck reported:"
+echo "======================================================================="
+cat tmp/pwck.err
+echo "======================================================================="
+echo -n "Check that there were a failure message..."
+diff -au data/pwck.err tmp/pwck.err
+echo "error message OK."
+rm -f tmp/pwck.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"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/cktools/pwck/24_pwck_locked_shadow/pwck.test
___________________________________________________________________
Added: svn:executable
   + *

Added: debian/trunk/tests/cktools/pwck/25_pwck_usage_invalid_option/config/etc/group
===================================================================
--- debian/trunk/tests/cktools/pwck/25_pwck_usage_invalid_option/config/etc/group	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/25_pwck_usage_invalid_option/config/etc/group	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,42 @@
+root:x:0:
+daemon:x:1:
+bin:x:2:
+sys:x:3:root
+adm:x:4:root,foo
+tty:x:5:
+disk:x:6:
+lp:x:7:foo,root
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:foo
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:foo
+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:foo
+nogroup:x:65534:
+crontab:x:101:
+Debian-exim:x:102:
+foo:x:1000:

Added: debian/trunk/tests/cktools/pwck/25_pwck_usage_invalid_option/config/etc/gshadow
===================================================================
--- debian/trunk/tests/cktools/pwck/25_pwck_usage_invalid_option/config/etc/gshadow	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/25_pwck_usage_invalid_option/config/etc/gshadow	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,42 @@
+root:*::
+daemon:*::
+bin:*::
+sys:*::root
+adm:*::root,foo
+tty:*::foo
+disk:*:foo:
+lp:*::foo,root
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*:foo:foo
+voice:*::
+cdrom:*:foo:foo
+floppy:*::foo
+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::
+foo:*::

Added: debian/trunk/tests/cktools/pwck/25_pwck_usage_invalid_option/config/etc/passwd
===================================================================
--- debian/trunk/tests/cktools/pwck/25_pwck_usage_invalid_option/config/etc/passwd	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/25_pwck_usage_invalid_option/config/etc/passwd	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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
+foo:x:1000:1000::/home/foo:/bin/false

Added: debian/trunk/tests/cktools/pwck/25_pwck_usage_invalid_option/config/etc/shadow
===================================================================
--- debian/trunk/tests/cktools/pwck/25_pwck_usage_invalid_option/config/etc/shadow	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/25_pwck_usage_invalid_option/config/etc/shadow	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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:::
+foo:!:12977:0:99999:7:::

Added: debian/trunk/tests/cktools/pwck/25_pwck_usage_invalid_option/config.txt
===================================================================
Added: debian/trunk/tests/cktools/pwck/25_pwck_usage_invalid_option/data/pwck.err
===================================================================
--- debian/trunk/tests/cktools/pwck/25_pwck_usage_invalid_option/data/pwck.err	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/25_pwck_usage_invalid_option/data/pwck.err	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,11 @@
+pwck: invalid option -- 'Z'
+Usage: pwck [options] [passwd [shadow]]
+
+Options:
+  -h, --help                    display this help message and exit
+  -q, --quiet                   report errors only
+  -r, --read-only               display errors and warnings
+                                but do not change files
+  -R, --root CHROOT_DIR         directory to chroot into
+  -s, --sort                    sort entries by UID
+

Added: debian/trunk/tests/cktools/pwck/25_pwck_usage_invalid_option/pwck.test
===================================================================
--- debian/trunk/tests/cktools/pwck/25_pwck_usage_invalid_option/pwck.test	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/25_pwck_usage_invalid_option/pwck.test	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../../common/config.sh
+. ../../../common/log.sh
+
+log_start "$0" "pwck displays its usage message when called with an invalid option"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Call pwck with an invalid option (pwck -Z)..."
+pwck -Z 2>tmp/pwck.err && exit 1 || {
+	status=$?
+}
+echo "OK"
+
+rm -f /etc/passwd.lock
+
+echo -n "Check returned status ($status)..."
+test "$status" = "1"
+echo "OK"
+
+echo "pwck reported:"
+echo "======================================================================="
+cat tmp/pwck.err
+echo "======================================================================="
+echo -n "Check that there were a failure message..."
+diff -au data/pwck.err tmp/pwck.err
+echo "error message OK."
+rm -f tmp/pwck.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"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/cktools/pwck/25_pwck_usage_invalid_option/pwck.test
___________________________________________________________________
Added: svn:executable
   + *

Added: debian/trunk/tests/cktools/pwck/26_pwck_usage-s-r/config/etc/group
===================================================================
--- debian/trunk/tests/cktools/pwck/26_pwck_usage-s-r/config/etc/group	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/26_pwck_usage-s-r/config/etc/group	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,42 @@
+root:x:0:
+daemon:x:1:
+bin:x:2:
+sys:x:3:root
+adm:x:4:root,foo
+tty:x:5:
+disk:x:6:
+lp:x:7:foo,root
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:foo
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:foo
+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:foo
+nogroup:x:65534:
+crontab:x:101:
+Debian-exim:x:102:
+foo:x:1000:

Added: debian/trunk/tests/cktools/pwck/26_pwck_usage-s-r/config/etc/gshadow
===================================================================
--- debian/trunk/tests/cktools/pwck/26_pwck_usage-s-r/config/etc/gshadow	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/26_pwck_usage-s-r/config/etc/gshadow	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,42 @@
+root:*::
+daemon:*::
+bin:*::
+sys:*::root
+adm:*::root,foo
+tty:*::foo
+disk:*:foo:
+lp:*::foo,root
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*:foo:foo
+voice:*::
+cdrom:*:foo:foo
+floppy:*::foo
+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::
+foo:*::

Added: debian/trunk/tests/cktools/pwck/26_pwck_usage-s-r/config/etc/passwd
===================================================================
--- debian/trunk/tests/cktools/pwck/26_pwck_usage-s-r/config/etc/passwd	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/26_pwck_usage-s-r/config/etc/passwd	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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
+foo:x:1000:1000::/home/foo:/bin/false

Added: debian/trunk/tests/cktools/pwck/26_pwck_usage-s-r/config/etc/shadow
===================================================================
--- debian/trunk/tests/cktools/pwck/26_pwck_usage-s-r/config/etc/shadow	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/26_pwck_usage-s-r/config/etc/shadow	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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:::
+foo:!:12977:0:99999:7:::

Added: debian/trunk/tests/cktools/pwck/26_pwck_usage-s-r/config.txt
===================================================================
Added: debian/trunk/tests/cktools/pwck/26_pwck_usage-s-r/data/pwck.err
===================================================================
--- debian/trunk/tests/cktools/pwck/26_pwck_usage-s-r/data/pwck.err	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/26_pwck_usage-s-r/data/pwck.err	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1 @@
+pwck: -s and -r are incompatible

Added: debian/trunk/tests/cktools/pwck/26_pwck_usage-s-r/pwck.test
===================================================================
--- debian/trunk/tests/cktools/pwck/26_pwck_usage-s-r/pwck.test	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/26_pwck_usage-s-r/pwck.test	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../../common/config.sh
+. ../../../common/log.sh
+
+log_start "$0" "pwck warns that -r and -s are exclusive"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Call pwck with the -r and -s options (pwck -r -s)..."
+pwck -r -s 2>tmp/pwck.err && exit 1 || {
+	status=$?
+}
+echo "OK"
+
+rm -f /etc/passwd.lock
+
+echo -n "Check returned status ($status)..."
+test "$status" = "1"
+echo "OK"
+
+echo "pwck reported:"
+echo "======================================================================="
+cat tmp/pwck.err
+echo "======================================================================="
+echo -n "Check that there were a failure message..."
+diff -au data/pwck.err tmp/pwck.err
+echo "error message OK."
+rm -f tmp/pwck.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"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/cktools/pwck/26_pwck_usage-s-r/pwck.test
___________________________________________________________________
Added: svn:executable
   + *

Added: debian/trunk/tests/cktools/pwck/27_pwck_usage_3_files/config/etc/group
===================================================================
--- debian/trunk/tests/cktools/pwck/27_pwck_usage_3_files/config/etc/group	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/27_pwck_usage_3_files/config/etc/group	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,42 @@
+root:x:0:
+daemon:x:1:
+bin:x:2:
+sys:x:3:root
+adm:x:4:root,foo
+tty:x:5:
+disk:x:6:
+lp:x:7:foo,root
+mail:x:8:
+news:x:9:
+uucp:x:10:
+man:x:12:
+proxy:x:13:
+kmem:x:15:
+dialout:x:20:
+fax:x:21:foo
+voice:x:22:
+cdrom:x:24:
+floppy:x:25:foo
+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:foo
+nogroup:x:65534:
+crontab:x:101:
+Debian-exim:x:102:
+foo:x:1000:

Added: debian/trunk/tests/cktools/pwck/27_pwck_usage_3_files/config/etc/gshadow
===================================================================
--- debian/trunk/tests/cktools/pwck/27_pwck_usage_3_files/config/etc/gshadow	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/27_pwck_usage_3_files/config/etc/gshadow	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,42 @@
+root:*::
+daemon:*::
+bin:*::
+sys:*::root
+adm:*::root,foo
+tty:*::foo
+disk:*:foo:
+lp:*::foo,root
+mail:*::
+news:*::
+uucp:*::
+man:*::
+proxy:*::
+kmem:*::
+dialout:*::
+fax:*:foo:foo
+voice:*::
+cdrom:*:foo:foo
+floppy:*::foo
+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::
+foo:*::

Added: debian/trunk/tests/cktools/pwck/27_pwck_usage_3_files/config/etc/passwd
===================================================================
--- debian/trunk/tests/cktools/pwck/27_pwck_usage_3_files/config/etc/passwd	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/27_pwck_usage_3_files/config/etc/passwd	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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
+foo:x:1000:1000::/home/foo:/bin/false

Added: debian/trunk/tests/cktools/pwck/27_pwck_usage_3_files/config/etc/shadow
===================================================================
--- debian/trunk/tests/cktools/pwck/27_pwck_usage_3_files/config/etc/shadow	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/27_pwck_usage_3_files/config/etc/shadow	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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:::
+foo:!:12977:0:99999:7:::

Added: debian/trunk/tests/cktools/pwck/27_pwck_usage_3_files/config.txt
===================================================================
Added: debian/trunk/tests/cktools/pwck/27_pwck_usage_3_files/data/pwck.err
===================================================================
--- debian/trunk/tests/cktools/pwck/27_pwck_usage_3_files/data/pwck.err	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/27_pwck_usage_3_files/data/pwck.err	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,10 @@
+Usage: pwck [options] [passwd [shadow]]
+
+Options:
+  -h, --help                    display this help message and exit
+  -q, --quiet                   report errors only
+  -r, --read-only               display errors and warnings
+                                but do not change files
+  -R, --root CHROOT_DIR         directory to chroot into
+  -s, --sort                    sort entries by UID
+

Added: debian/trunk/tests/cktools/pwck/27_pwck_usage_3_files/pwck.test
===================================================================
--- debian/trunk/tests/cktools/pwck/27_pwck_usage_3_files/pwck.test	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/27_pwck_usage_3_files/pwck.test	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../../common/config.sh
+. ../../../common/log.sh
+
+log_start "$0" "pwck displays its usage message when called with 3 files"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Call pwck with 3 files (pwck data/passwd data/shadow data/foo)..."
+pwck data/passwd data/shadow data/foo 2>tmp/pwck.err && exit 1 || {
+	status=$?
+}
+echo "OK"
+
+rm -f /etc/passwd.lock
+
+echo -n "Check returned status ($status)..."
+test "$status" = "1"
+echo "OK"
+
+echo "pwck reported:"
+echo "======================================================================="
+cat tmp/pwck.err
+echo "======================================================================="
+echo -n "Check that there were a failure message..."
+diff -au data/pwck.err tmp/pwck.err
+echo "error message OK."
+rm -f tmp/pwck.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"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/cktools/pwck/27_pwck_usage_3_files/pwck.test
___________________________________________________________________
Added: svn:executable
   + *

Added: debian/trunk/tests/cktools/pwck/28_pwck_no_shadow_file/config/etc/group
===================================================================
--- debian/trunk/tests/cktools/pwck/28_pwck_no_shadow_file/config/etc/group	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/28_pwck_no_shadow_file/config/etc/group	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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:
+foo:x:1000:

Added: debian/trunk/tests/cktools/pwck/28_pwck_no_shadow_file/config/etc/gshadow
===================================================================
--- debian/trunk/tests/cktools/pwck/28_pwck_no_shadow_file/config/etc/gshadow	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/28_pwck_no_shadow_file/config/etc/gshadow	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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::
+foo:x::

Added: debian/trunk/tests/cktools/pwck/28_pwck_no_shadow_file/config/etc/passwd
===================================================================
--- debian/trunk/tests/cktools/pwck/28_pwck_no_shadow_file/config/etc/passwd	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/28_pwck_no_shadow_file/config/etc/passwd	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,23 @@
+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:/tmp:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/tmp:/bin/sh
+uucp:x:10:10:uucp:/tmp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/tmp:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/tmp:/bin/sh
+irc:x:39:39:ircd:/tmp:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/tmp:/bin/sh
+nobody:x:65534:65534:nobody:/tmp:/bin/sh
+Debian-exim:x:102:102::/tmp:/bin/false
+foo:pass:1000:1000::/home/foo:/bin/sh
+foo:pass:1001:1000::/tmp:/bin/sh
+foo2:pass:1000:1000::/tmp:/bin/shs
+foo3:x:1000:1000::/tmp:

Added: debian/trunk/tests/cktools/pwck/28_pwck_no_shadow_file/config/etc/shadow
===================================================================
--- debian/trunk/tests/cktools/pwck/28_pwck_no_shadow_file/config/etc/shadow	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/28_pwck_no_shadow_file/config/etc/shadow	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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:::
+foo:!:12977:0:99999:7:::

Added: debian/trunk/tests/cktools/pwck/28_pwck_no_shadow_file/config.txt
===================================================================
--- debian/trunk/tests/cktools/pwck/28_pwck_no_shadow_file/config.txt	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/28_pwck_no_shadow_file/config.txt	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,10 @@
+# no testsuite password
+# root password: rootF00barbaz
+# myuser password: myuserF00barbaz
+
+user foo, in group users (only in /etc/group)
+user foo, in group tty (only in /etc/gshadow)
+user foo, in group floppy
+user foo, admin of group disk
+user foo, admin and member of group fax
+user foo, admin and member of group cdrom (only in /etc/gshadow)

Added: debian/trunk/tests/cktools/pwck/28_pwck_no_shadow_file/data/pwck.out
===================================================================
--- debian/trunk/tests/cktools/pwck/28_pwck_no_shadow_file/data/pwck.out	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/28_pwck_no_shadow_file/data/pwck.out	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,7 @@
+duplicate password entry
+delete line 'foo:pass:1000:1000::/home/foo:/bin/sh'? No
+user 'foo': directory '/home/foo' does not exist
+duplicate password entry
+delete line 'foo:pass:1001:1000::/tmp:/bin/sh'? No
+user 'foo2': program '/bin/shs' does not exist
+pwck: no changes

Added: debian/trunk/tests/cktools/pwck/28_pwck_no_shadow_file/pwck.test
===================================================================
--- debian/trunk/tests/cktools/pwck/28_pwck_no_shadow_file/pwck.test	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/28_pwck_no_shadow_file/pwck.test	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,58 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../../common/config.sh
+. ../../../common/log.sh
+
+log_start "$0" "pwck report issues when the shadow file does not exist"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Remove /etc/shadow..."
+rm -f /etc/shadow
+echo "OK"
+
+echo -n "Check user database (pwck -r)..."
+pwck -r >tmp/pwck.out && exit 1 || {
+        status=$?
+}
+echo "OK"
+
+echo -n "Check returned status ($status)..."
+test "$status" = "2"
+echo "OK"
+
+echo "pwck reported:"
+echo "======================================================================="
+cat tmp/pwck.out
+echo "======================================================================="
+echo -n "Check the report..."
+diff -au data/pwck.out tmp/pwck.out
+echo "report OK."
+rm -f tmp/pwck.out
+
+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..."
+test ! -f /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../../common/compare_file.pl config/etc/gshadow /etc/gshadow
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/cktools/pwck/28_pwck_no_shadow_file/pwck.test
___________________________________________________________________
Added: svn:executable
   + *

Added: debian/trunk/tests/cktools/pwck/29_pwck_password_change_in_future/config/etc/group
===================================================================
--- debian/trunk/tests/cktools/pwck/29_pwck_password_change_in_future/config/etc/group	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/29_pwck_password_change_in_future/config/etc/group	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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:
+foo:x:1000:

Added: debian/trunk/tests/cktools/pwck/29_pwck_password_change_in_future/config/etc/gshadow
===================================================================
--- debian/trunk/tests/cktools/pwck/29_pwck_password_change_in_future/config/etc/gshadow	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/29_pwck_password_change_in_future/config/etc/gshadow	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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::
+foo:x::

Added: debian/trunk/tests/cktools/pwck/29_pwck_password_change_in_future/config/etc/passwd
===================================================================
--- debian/trunk/tests/cktools/pwck/29_pwck_password_change_in_future/config/etc/passwd	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/29_pwck_password_change_in_future/config/etc/passwd	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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:/tmp:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/tmp:/bin/sh
+uucp:x:10:10:uucp:/tmp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/tmp:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/tmp:/bin/sh
+irc:x:39:39:ircd:/tmp:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/tmp:/bin/sh
+nobody:x:65534:65534:nobody:/tmp:/bin/sh
+Debian-exim:x:102:102::/tmp:/bin/false
+foo:x:1000:1000::/home:/bin/sh

Added: debian/trunk/tests/cktools/pwck/29_pwck_password_change_in_future/config/etc/shadow
===================================================================
--- debian/trunk/tests/cktools/pwck/29_pwck_password_change_in_future/config/etc/shadow	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/29_pwck_password_change_in_future/config/etc/shadow	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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:::
+foo:!:99997:0:99999:7:::

Added: debian/trunk/tests/cktools/pwck/29_pwck_password_change_in_future/config.txt
===================================================================
--- debian/trunk/tests/cktools/pwck/29_pwck_password_change_in_future/config.txt	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/29_pwck_password_change_in_future/config.txt	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,10 @@
+# no testsuite password
+# root password: rootF00barbaz
+# myuser password: myuserF00barbaz
+
+user foo, in group users (only in /etc/group)
+user foo, in group tty (only in /etc/gshadow)
+user foo, in group floppy
+user foo, admin of group disk
+user foo, admin and member of group fax
+user foo, admin and member of group cdrom (only in /etc/gshadow)

Added: debian/trunk/tests/cktools/pwck/29_pwck_password_change_in_future/data/pwck.out
===================================================================
--- debian/trunk/tests/cktools/pwck/29_pwck_password_change_in_future/data/pwck.out	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/29_pwck_password_change_in_future/data/pwck.out	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,2 @@
+user foo: last password change in the future
+pwck: no changes

Added: debian/trunk/tests/cktools/pwck/29_pwck_password_change_in_future/pwck.test
===================================================================
--- debian/trunk/tests/cktools/pwck/29_pwck_password_change_in_future/pwck.test	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/29_pwck_password_change_in_future/pwck.test	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../../common/config.sh
+. ../../../common/log.sh
+
+log_start "$0" "pwck checks that the password was set in the past"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Check user database (pwck -r)..."
+pwck -r >tmp/pwck.out && exit 1 || {
+        status=$?
+}
+echo "OK"
+
+echo -n "Check returned status ($status)..."
+test "$status" = "2"
+echo "OK"
+
+echo "pwck reported:"
+echo "======================================================================="
+cat tmp/pwck.out
+echo "======================================================================="
+echo -n "Check the report..."
+diff -au data/pwck.out tmp/pwck.out
+echo "report OK."
+rm -f tmp/pwck.out
+
+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"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/cktools/pwck/29_pwck_password_change_in_future/pwck.test
___________________________________________________________________
Added: svn:executable
   + *

Added: debian/trunk/tests/cktools/pwck/30_pwck_NIS_entries/config/etc/group
===================================================================
--- debian/trunk/tests/cktools/pwck/30_pwck_NIS_entries/config/etc/group	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/30_pwck_NIS_entries/config/etc/group	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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:
+foo:x:1000:

Added: debian/trunk/tests/cktools/pwck/30_pwck_NIS_entries/config/etc/gshadow
===================================================================
--- debian/trunk/tests/cktools/pwck/30_pwck_NIS_entries/config/etc/gshadow	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/30_pwck_NIS_entries/config/etc/gshadow	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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::
+foo:x::

Added: debian/trunk/tests/cktools/pwck/30_pwck_NIS_entries/config/etc/passwd
===================================================================
--- debian/trunk/tests/cktools/pwck/30_pwck_NIS_entries/config/etc/passwd	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/30_pwck_NIS_entries/config/etc/passwd	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,23 @@
+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:/tmp:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/tmp:/bin/sh
+uucp:x:10:10:uucp:/tmp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/tmp:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/tmp:/bin/sh
+irc:x:39:39:ircd:/tmp:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/tmp:/bin/sh
+nobody:x:65534:65534:nobody:/tmp:/bin/sh
+Debian-exim:x:102:102::/tmp:/bin/false
+foo:x:1000:1000::/home:/bin/sh
++::::::
+-bar::::::
+foo:x:1001:1000::/home:/bin/sh

Added: debian/trunk/tests/cktools/pwck/30_pwck_NIS_entries/config/etc/shadow
===================================================================
--- debian/trunk/tests/cktools/pwck/30_pwck_NIS_entries/config/etc/shadow	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/30_pwck_NIS_entries/config/etc/shadow	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,23 @@
+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:::
+foo:!:99997:0:99999:7:::
++::::::::
+-bar::::::::
+Debian-exim:!:12977:0:99999:7:::

Added: debian/trunk/tests/cktools/pwck/30_pwck_NIS_entries/config.txt
===================================================================
--- debian/trunk/tests/cktools/pwck/30_pwck_NIS_entries/config.txt	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/30_pwck_NIS_entries/config.txt	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,10 @@
+# no testsuite password
+# root password: rootF00barbaz
+# myuser password: myuserF00barbaz
+
+user foo, in group users (only in /etc/group)
+user foo, in group tty (only in /etc/gshadow)
+user foo, in group floppy
+user foo, admin of group disk
+user foo, admin and member of group fax
+user foo, admin and member of group cdrom (only in /etc/gshadow)

Added: debian/trunk/tests/cktools/pwck/30_pwck_NIS_entries/data/pwck.out
===================================================================
--- debian/trunk/tests/cktools/pwck/30_pwck_NIS_entries/data/pwck.out	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/30_pwck_NIS_entries/data/pwck.out	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,10 @@
+duplicate password entry
+delete line 'foo:x:1000:1000::/home:/bin/sh'? No
+duplicate password entry
+delete line 'foo:x:1001:1000::/home:/bin/sh'? No
+duplicate shadow password entry
+delete line 'Debian-exim:!:12977:0:99999:7:::'? No
+user foo: last password change in the future
+duplicate shadow password entry
+delete line 'Debian-exim:!:12977:0:99999:7:::'? No
+pwck: no changes

Added: debian/trunk/tests/cktools/pwck/30_pwck_NIS_entries/pwck.test
===================================================================
--- debian/trunk/tests/cktools/pwck/30_pwck_NIS_entries/pwck.test	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/30_pwck_NIS_entries/pwck.test	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../../common/config.sh
+. ../../../common/log.sh
+
+log_start "$0" "pwck ignores NIS lines silently"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Check user database (pwck -r)..."
+pwck -r >tmp/pwck.out && exit 1 || {
+        status=$?
+}
+echo "OK"
+
+echo -n "Check returned status ($status)..."
+test "$status" = "2"
+echo "OK"
+
+echo "pwck reported:"
+echo "======================================================================="
+cat tmp/pwck.out
+echo "======================================================================="
+echo -n "Check the report..."
+diff -au data/pwck.out tmp/pwck.out
+echo "report OK."
+rm -f tmp/pwck.out
+
+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"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/cktools/pwck/30_pwck_NIS_entries/pwck.test
___________________________________________________________________
Added: svn:executable
   + *

Added: debian/trunk/tests/cktools/pwck/31_pwck_shadow_entry_passwd_no_x/config/etc/group
===================================================================
--- debian/trunk/tests/cktools/pwck/31_pwck_shadow_entry_passwd_no_x/config/etc/group	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/31_pwck_shadow_entry_passwd_no_x/config/etc/group	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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:
+foo:x:1000:

Added: debian/trunk/tests/cktools/pwck/31_pwck_shadow_entry_passwd_no_x/config/etc/gshadow
===================================================================
--- debian/trunk/tests/cktools/pwck/31_pwck_shadow_entry_passwd_no_x/config/etc/gshadow	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/31_pwck_shadow_entry_passwd_no_x/config/etc/gshadow	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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::
+foo:x::

Added: debian/trunk/tests/cktools/pwck/31_pwck_shadow_entry_passwd_no_x/config/etc/passwd
===================================================================
--- debian/trunk/tests/cktools/pwck/31_pwck_shadow_entry_passwd_no_x/config/etc/passwd	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/31_pwck_shadow_entry_passwd_no_x/config/etc/passwd	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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:/tmp:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/tmp:/bin/sh
+uucp:x:10:10:uucp:/tmp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/tmp:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/tmp:/bin/sh
+irc:x:39:39:ircd:/tmp:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/tmp:/bin/sh
+nobody:x:65534:65534:nobody:/tmp:/bin/sh
+Debian-exim:x:102:102::/tmp:/bin/false
+foo:pass:1000:1000::/home:/bin/sh

Added: debian/trunk/tests/cktools/pwck/31_pwck_shadow_entry_passwd_no_x/config/etc/shadow
===================================================================
--- debian/trunk/tests/cktools/pwck/31_pwck_shadow_entry_passwd_no_x/config/etc/shadow	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/31_pwck_shadow_entry_passwd_no_x/config/etc/shadow	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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:::
+foo:!:12977:0:99999:7:::

Added: debian/trunk/tests/cktools/pwck/31_pwck_shadow_entry_passwd_no_x/config.txt
===================================================================
--- debian/trunk/tests/cktools/pwck/31_pwck_shadow_entry_passwd_no_x/config.txt	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/31_pwck_shadow_entry_passwd_no_x/config.txt	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,10 @@
+# no testsuite password
+# root password: rootF00barbaz
+# myuser password: myuserF00barbaz
+
+user foo, in group users (only in /etc/group)
+user foo, in group tty (only in /etc/gshadow)
+user foo, in group floppy
+user foo, admin of group disk
+user foo, admin and member of group fax
+user foo, admin and member of group cdrom (only in /etc/gshadow)

Added: debian/trunk/tests/cktools/pwck/31_pwck_shadow_entry_passwd_no_x/data/pwck.out
===================================================================
--- debian/trunk/tests/cktools/pwck/31_pwck_shadow_entry_passwd_no_x/data/pwck.out	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/31_pwck_shadow_entry_passwd_no_x/data/pwck.out	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,2 @@
+user foo has an entry in /etc/shadow, but its password field in /etc/passwd is not set to 'x'
+pwck: no changes

Added: debian/trunk/tests/cktools/pwck/31_pwck_shadow_entry_passwd_no_x/pwck.test
===================================================================
--- debian/trunk/tests/cktools/pwck/31_pwck_shadow_entry_passwd_no_x/pwck.test	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/31_pwck_shadow_entry_passwd_no_x/pwck.test	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../../common/config.sh
+. ../../../common/log.sh
+
+log_start "$0" "pwck checks that the password is set to x if there is a shadow entry"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Check user database (pwck -r)..."
+pwck -r >tmp/pwck.out && exit 1 || {
+        status=$?
+}
+echo "OK"
+
+echo -n "Check returned status ($status)..."
+test "$status" = "2"
+echo "OK"
+
+echo "pwck reported:"
+echo "======================================================================="
+cat tmp/pwck.out
+echo "======================================================================="
+echo -n "Check the report..."
+diff -au data/pwck.out tmp/pwck.out
+echo "report OK."
+rm -f tmp/pwck.out
+
+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"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/cktools/pwck/31_pwck_shadow_entry_passwd_no_x/pwck.test
___________________________________________________________________
Added: svn:executable
   + *

Added: debian/trunk/tests/cktools/pwck/32_pwck_quiet/config/etc/group
===================================================================
--- debian/trunk/tests/cktools/pwck/32_pwck_quiet/config/etc/group	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/32_pwck_quiet/config/etc/group	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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/cktools/pwck/32_pwck_quiet/config/etc/gshadow
===================================================================
--- debian/trunk/tests/cktools/pwck/32_pwck_quiet/config/etc/gshadow	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/32_pwck_quiet/config/etc/gshadow	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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/cktools/pwck/32_pwck_quiet/config/etc/passwd
===================================================================
--- debian/trunk/tests/cktools/pwck/32_pwck_quiet/config/etc/passwd	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/32_pwck_quiet/config/etc/passwd	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,22 @@
+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
+Debian-exim:x:103:102::/var/spool/exim4:/bin/false
+Debian-exim2:x:104:103::/var/spool/exim4:/bin/false
+Debian-exim3:x:102:103::/var/spool/exim4:/bin/false

Added: debian/trunk/tests/cktools/pwck/32_pwck_quiet/config/etc/shadow
===================================================================
--- debian/trunk/tests/cktools/pwck/32_pwck_quiet/config/etc/shadow	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/32_pwck_quiet/config/etc/shadow	2011-11-14 23:09:09 UTC (rev 3622)
@@ -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/cktools/pwck/32_pwck_quiet/config.txt
===================================================================
--- debian/trunk/tests/cktools/pwck/32_pwck_quiet/config.txt	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/32_pwck_quiet/config.txt	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,10 @@
+# no testsuite password
+# root password: rootF00barbaz
+# myuser password: myuserF00barbaz
+
+user foo, in group users (only in /etc/group)
+user foo, in group tty (only in /etc/gshadow)
+user foo, in group floppy
+user foo, admin of group disk
+user foo, admin and member of group fax
+user foo, admin and member of group cdrom (only in /etc/gshadow)

Added: debian/trunk/tests/cktools/pwck/32_pwck_quiet/data/pwck.out
===================================================================
--- debian/trunk/tests/cktools/pwck/32_pwck_quiet/data/pwck.out	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/32_pwck_quiet/data/pwck.out	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,9 @@
+duplicate password entry
+delete line 'Debian-exim:x:102:102::/var/spool/exim4:/bin/false'? No
+duplicate password entry
+delete line 'Debian-exim:x:103:102::/var/spool/exim4:/bin/false'? No
+no matching password file entry in /etc/shadow
+add user 'Debian-exim2' in /etc/shadow? No
+no matching password file entry in /etc/shadow
+add user 'Debian-exim3' in /etc/shadow? No
+pwck: no changes

Added: debian/trunk/tests/cktools/pwck/32_pwck_quiet/pwck.test
===================================================================
--- debian/trunk/tests/cktools/pwck/32_pwck_quiet/pwck.test	                        (rev 0)
+++ debian/trunk/tests/cktools/pwck/32_pwck_quiet/pwck.test	2011-11-14 23:09:09 UTC (rev 3622)
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../../common/config.sh
+. ../../../common/log.sh
+
+log_start "$0" "pwck can display its usage message"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Get pwck usage (pwck -q -r)..."
+pwck -q -r >tmp/pwck.out && exit 1 || {
+        status=$?
+}
+echo "OK"
+
+echo -n "Check returned status ($status)..."
+test "$status" = "2"
+echo "OK"
+
+echo "pwck reported:"
+echo "======================================================================="
+cat tmp/pwck.out
+echo "======================================================================="
+echo -n "Check the report..."
+diff -au data/pwck.out tmp/pwck.out
+echo "report OK."
+rm -f tmp/pwck.out
+
+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"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/cktools/pwck/32_pwck_quiet/pwck.test
___________________________________________________________________
Added: svn:executable
   + *




More information about the Pkg-shadow-commits mailing list