[Pkg-shadow-commits] r3512 - in debian/trunk/tests/cptools: . 02_cppw_usage 02_cppw_usage/config 02_cppw_usage/config/etc 02_cppw_usage/data 03_cppw_usage_invalid_option 03_cppw_usage_invalid_option/config 03_cppw_usage_invalid_option/config/etc 03_cppw_usage_invalid_option/data 04_cppw_no_file_argument 04_cppw_no_file_argument/config 04_cppw_no_file_argument/config/etc 04_cppw_no_file_argument/data 05_cppw_2_files 05_cppw_2_files/config 05_cppw_2_files/config/etc 05_cppw_2_files/data 06_cppw_no_file 06_cppw_no_file/config 06_cppw_no_file/config/etc 06_cppw_no_file/data 07_cppw_locked_passwd 07_cppw_locked_passwd/config 07_cppw_locked_passwd/config/etc 07_cppw_locked_passwd/data 08_cppw-p 08_cppw-p/config 08_cppw-p/config/etc 08_cppw-p/data 09_cppw-g 09_cppw-g/config 09_cppw-g/config/etc 09_cppw-g/data 10_cppw-g-s 10_cppw-g-s/config 10_cppw-g-s/config/etc 10_cppw-g-s/data 11_cppw-p-s 11_cppw-p-s/config 11_cppw-p-s/config/etc 11_cppw-p-s/data
Nicolas FRANÇOIS
nekral-guest at alioth.debian.org
Sun Oct 16 14:32:35 UTC 2011
Author: nekral-guest
Date: 2011-10-16 14:32:34 +0000 (Sun, 16 Oct 2011)
New Revision: 3512
Added:
debian/trunk/tests/cptools/02_cppw_usage/
debian/trunk/tests/cptools/02_cppw_usage/config.txt
debian/trunk/tests/cptools/02_cppw_usage/config/
debian/trunk/tests/cptools/02_cppw_usage/config/etc/
debian/trunk/tests/cptools/02_cppw_usage/config/etc/group
debian/trunk/tests/cptools/02_cppw_usage/config/etc/gshadow
debian/trunk/tests/cptools/02_cppw_usage/config/etc/passwd
debian/trunk/tests/cptools/02_cppw_usage/config/etc/shadow
debian/trunk/tests/cptools/02_cppw_usage/cppw.test
debian/trunk/tests/cptools/02_cppw_usage/data/
debian/trunk/tests/cptools/02_cppw_usage/data/usage.out
debian/trunk/tests/cptools/03_cppw_usage_invalid_option/
debian/trunk/tests/cptools/03_cppw_usage_invalid_option/config.txt
debian/trunk/tests/cptools/03_cppw_usage_invalid_option/config/
debian/trunk/tests/cptools/03_cppw_usage_invalid_option/config/etc/
debian/trunk/tests/cptools/03_cppw_usage_invalid_option/config/etc/group
debian/trunk/tests/cptools/03_cppw_usage_invalid_option/config/etc/gshadow
debian/trunk/tests/cptools/03_cppw_usage_invalid_option/config/etc/passwd
debian/trunk/tests/cptools/03_cppw_usage_invalid_option/config/etc/shadow
debian/trunk/tests/cptools/03_cppw_usage_invalid_option/cppw.test
debian/trunk/tests/cptools/03_cppw_usage_invalid_option/data/
debian/trunk/tests/cptools/03_cppw_usage_invalid_option/data/usage.out
debian/trunk/tests/cptools/04_cppw_no_file_argument/
debian/trunk/tests/cptools/04_cppw_no_file_argument/config.txt
debian/trunk/tests/cptools/04_cppw_no_file_argument/config/
debian/trunk/tests/cptools/04_cppw_no_file_argument/config/etc/
debian/trunk/tests/cptools/04_cppw_no_file_argument/config/etc/group
debian/trunk/tests/cptools/04_cppw_no_file_argument/config/etc/gshadow
debian/trunk/tests/cptools/04_cppw_no_file_argument/config/etc/passwd
debian/trunk/tests/cptools/04_cppw_no_file_argument/config/etc/shadow
debian/trunk/tests/cptools/04_cppw_no_file_argument/cppw.test
debian/trunk/tests/cptools/04_cppw_no_file_argument/data/
debian/trunk/tests/cptools/04_cppw_no_file_argument/data/usage.out
debian/trunk/tests/cptools/05_cppw_2_files/
debian/trunk/tests/cptools/05_cppw_2_files/config.txt
debian/trunk/tests/cptools/05_cppw_2_files/config/
debian/trunk/tests/cptools/05_cppw_2_files/config/etc/
debian/trunk/tests/cptools/05_cppw_2_files/config/etc/group
debian/trunk/tests/cptools/05_cppw_2_files/config/etc/gshadow
debian/trunk/tests/cptools/05_cppw_2_files/config/etc/passwd
debian/trunk/tests/cptools/05_cppw_2_files/config/etc/shadow
debian/trunk/tests/cptools/05_cppw_2_files/cppw.test
debian/trunk/tests/cptools/05_cppw_2_files/data/
debian/trunk/tests/cptools/05_cppw_2_files/data/passwd
debian/trunk/tests/cptools/05_cppw_2_files/data/usage.out
debian/trunk/tests/cptools/06_cppw_no_file/
debian/trunk/tests/cptools/06_cppw_no_file/config.txt
debian/trunk/tests/cptools/06_cppw_no_file/config/
debian/trunk/tests/cptools/06_cppw_no_file/config/etc/
debian/trunk/tests/cptools/06_cppw_no_file/config/etc/group
debian/trunk/tests/cptools/06_cppw_no_file/config/etc/gshadow
debian/trunk/tests/cptools/06_cppw_no_file/config/etc/passwd
debian/trunk/tests/cptools/06_cppw_no_file/config/etc/shadow
debian/trunk/tests/cptools/06_cppw_no_file/cppw.test
debian/trunk/tests/cptools/06_cppw_no_file/data/
debian/trunk/tests/cptools/06_cppw_no_file/data/usage.out
debian/trunk/tests/cptools/07_cppw_locked_passwd/
debian/trunk/tests/cptools/07_cppw_locked_passwd/config.txt
debian/trunk/tests/cptools/07_cppw_locked_passwd/config/
debian/trunk/tests/cptools/07_cppw_locked_passwd/config/etc/
debian/trunk/tests/cptools/07_cppw_locked_passwd/config/etc/group
debian/trunk/tests/cptools/07_cppw_locked_passwd/config/etc/gshadow
debian/trunk/tests/cptools/07_cppw_locked_passwd/config/etc/passwd
debian/trunk/tests/cptools/07_cppw_locked_passwd/config/etc/shadow
debian/trunk/tests/cptools/07_cppw_locked_passwd/cppw.test
debian/trunk/tests/cptools/07_cppw_locked_passwd/data/
debian/trunk/tests/cptools/07_cppw_locked_passwd/data/passwd
debian/trunk/tests/cptools/07_cppw_locked_passwd/data/usage.out
debian/trunk/tests/cptools/08_cppw-p/
debian/trunk/tests/cptools/08_cppw-p/config.txt
debian/trunk/tests/cptools/08_cppw-p/config/
debian/trunk/tests/cptools/08_cppw-p/config/etc/
debian/trunk/tests/cptools/08_cppw-p/config/etc/group
debian/trunk/tests/cptools/08_cppw-p/config/etc/gshadow
debian/trunk/tests/cptools/08_cppw-p/config/etc/passwd
debian/trunk/tests/cptools/08_cppw-p/config/etc/shadow
debian/trunk/tests/cptools/08_cppw-p/cppw.test
debian/trunk/tests/cptools/08_cppw-p/data/
debian/trunk/tests/cptools/08_cppw-p/data/passwd
debian/trunk/tests/cptools/09_cppw-g/
debian/trunk/tests/cptools/09_cppw-g/config.txt
debian/trunk/tests/cptools/09_cppw-g/config/
debian/trunk/tests/cptools/09_cppw-g/config/etc/
debian/trunk/tests/cptools/09_cppw-g/config/etc/group
debian/trunk/tests/cptools/09_cppw-g/config/etc/gshadow
debian/trunk/tests/cptools/09_cppw-g/config/etc/passwd
debian/trunk/tests/cptools/09_cppw-g/config/etc/shadow
debian/trunk/tests/cptools/09_cppw-g/cppw.test
debian/trunk/tests/cptools/09_cppw-g/data/
debian/trunk/tests/cptools/09_cppw-g/data/group
debian/trunk/tests/cptools/10_cppw-g-s/
debian/trunk/tests/cptools/10_cppw-g-s/config.txt
debian/trunk/tests/cptools/10_cppw-g-s/config/
debian/trunk/tests/cptools/10_cppw-g-s/config/etc/
debian/trunk/tests/cptools/10_cppw-g-s/config/etc/group
debian/trunk/tests/cptools/10_cppw-g-s/config/etc/gshadow
debian/trunk/tests/cptools/10_cppw-g-s/config/etc/passwd
debian/trunk/tests/cptools/10_cppw-g-s/config/etc/shadow
debian/trunk/tests/cptools/10_cppw-g-s/cppw.test
debian/trunk/tests/cptools/10_cppw-g-s/data/
debian/trunk/tests/cptools/10_cppw-g-s/data/gshadow
debian/trunk/tests/cptools/11_cppw-p-s/
debian/trunk/tests/cptools/11_cppw-p-s/config.txt
debian/trunk/tests/cptools/11_cppw-p-s/config/
debian/trunk/tests/cptools/11_cppw-p-s/config/etc/
debian/trunk/tests/cptools/11_cppw-p-s/config/etc/group
debian/trunk/tests/cptools/11_cppw-p-s/config/etc/gshadow
debian/trunk/tests/cptools/11_cppw-p-s/config/etc/passwd
debian/trunk/tests/cptools/11_cppw-p-s/config/etc/shadow
debian/trunk/tests/cptools/11_cppw-p-s/cppw.test
debian/trunk/tests/cptools/11_cppw-p-s/data/
debian/trunk/tests/cptools/11_cppw-p-s/data/shadow
Log:
Add 10 tests for cppw.
Added: debian/trunk/tests/cptools/02_cppw_usage/config/etc/group
===================================================================
Added: debian/trunk/tests/cptools/02_cppw_usage/config/etc/gshadow
===================================================================
Added: debian/trunk/tests/cptools/02_cppw_usage/config/etc/passwd
===================================================================
Added: debian/trunk/tests/cptools/02_cppw_usage/config/etc/shadow
===================================================================
Added: debian/trunk/tests/cptools/02_cppw_usage/config.txt
===================================================================
Added: debian/trunk/tests/cptools/02_cppw_usage/cppw.test
===================================================================
--- debian/trunk/tests/cptools/02_cppw_usage/cppw.test (rev 0)
+++ debian/trunk/tests/cptools/02_cppw_usage/cppw.test 2011-10-16 14:32:34 UTC (rev 3512)
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "cppw can displays its usage message"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Get cppw usage (cppw -h)..."
+cppw -h >tmp/usage.out
+echo "OK"
+
+echo "cppw 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/cptools/02_cppw_usage/cppw.test
___________________________________________________________________
Added: svn:executable
+ *
Added: debian/trunk/tests/cptools/02_cppw_usage/data/usage.out
===================================================================
--- debian/trunk/tests/cptools/02_cppw_usage/data/usage.out (rev 0)
+++ debian/trunk/tests/cptools/02_cppw_usage/data/usage.out 2011-10-16 14:32:34 UTC (rev 3512)
@@ -0,0 +1,3 @@
+Usage:
+`cppw <file>' copys over /etc/passwd `cppw -s <file>' copys over /etc/shadow
+`cpgr <file>' copys over /etc/group `cpgr -s <file>' copys over /etc/gshadow
Added: debian/trunk/tests/cptools/03_cppw_usage_invalid_option/config/etc/group
===================================================================
Added: debian/trunk/tests/cptools/03_cppw_usage_invalid_option/config/etc/gshadow
===================================================================
Added: debian/trunk/tests/cptools/03_cppw_usage_invalid_option/config/etc/passwd
===================================================================
Added: debian/trunk/tests/cptools/03_cppw_usage_invalid_option/config/etc/shadow
===================================================================
Added: debian/trunk/tests/cptools/03_cppw_usage_invalid_option/config.txt
===================================================================
Added: debian/trunk/tests/cptools/03_cppw_usage_invalid_option/cppw.test
===================================================================
--- debian/trunk/tests/cptools/03_cppw_usage_invalid_option/cppw.test (rev 0)
+++ debian/trunk/tests/cptools/03_cppw_usage_invalid_option/cppw.test 2011-10-16 14:32:34 UTC (rev 3512)
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "cppw reports usage of invalid option"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Use wrong cppw option (cppw -Z)..."
+/usr/sbin/cppw -Z 2>tmp/usage.out && exit 1 || {
+ status=$?
+}
+echo "OK"
+
+echo -n "Check returned status ($status)..."
+test "$status" = "1"
+echo "OK"
+
+echo "cppw 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/cptools/03_cppw_usage_invalid_option/cppw.test
___________________________________________________________________
Added: svn:executable
+ *
Added: debian/trunk/tests/cptools/03_cppw_usage_invalid_option/data/usage.out
===================================================================
--- debian/trunk/tests/cptools/03_cppw_usage_invalid_option/data/usage.out (rev 0)
+++ debian/trunk/tests/cptools/03_cppw_usage_invalid_option/data/usage.out 2011-10-16 14:32:34 UTC (rev 3512)
@@ -0,0 +1 @@
+/usr/sbin/cppw: invalid option -- 'Z'
Added: debian/trunk/tests/cptools/04_cppw_no_file_argument/config/etc/group
===================================================================
Added: debian/trunk/tests/cptools/04_cppw_no_file_argument/config/etc/gshadow
===================================================================
Added: debian/trunk/tests/cptools/04_cppw_no_file_argument/config/etc/passwd
===================================================================
Added: debian/trunk/tests/cptools/04_cppw_no_file_argument/config/etc/shadow
===================================================================
Added: debian/trunk/tests/cptools/04_cppw_no_file_argument/config.txt
===================================================================
Added: debian/trunk/tests/cptools/04_cppw_no_file_argument/cppw.test
===================================================================
--- debian/trunk/tests/cptools/04_cppw_no_file_argument/cppw.test (rev 0)
+++ debian/trunk/tests/cptools/04_cppw_no_file_argument/cppw.test 2011-10-16 14:32:34 UTC (rev 3512)
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "cppw reports an error if no files are provided"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Use cppw without a file argument (cppw)..."
+cppw 2>tmp/usage.out && exit 1 || {
+ status=$?
+}
+echo "OK"
+
+echo -n "Check returned status ($status)..."
+test "$status" = "1"
+echo "OK"
+
+echo "cppw 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/cptools/04_cppw_no_file_argument/cppw.test
___________________________________________________________________
Added: svn:executable
+ *
Added: debian/trunk/tests/cptools/04_cppw_no_file_argument/data/usage.out
===================================================================
--- debian/trunk/tests/cptools/04_cppw_no_file_argument/data/usage.out (rev 0)
+++ debian/trunk/tests/cptools/04_cppw_no_file_argument/data/usage.out 2011-10-16 14:32:34 UTC (rev 3512)
@@ -0,0 +1,2 @@
+cppw: missing file argument, -h for usage
+cppw: /etc/passwd is unchanged
Added: debian/trunk/tests/cptools/05_cppw_2_files/config/etc/group
===================================================================
--- debian/trunk/tests/cptools/05_cppw_2_files/config/etc/group (rev 0)
+++ debian/trunk/tests/cptools/05_cppw_2_files/config/etc/group 2011-10-16 14:32:34 UTC (rev 3512)
@@ -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:
+myuser:x:424242:
Added: debian/trunk/tests/cptools/05_cppw_2_files/config/etc/gshadow
===================================================================
--- debian/trunk/tests/cptools/05_cppw_2_files/config/etc/gshadow (rev 0)
+++ debian/trunk/tests/cptools/05_cppw_2_files/config/etc/gshadow 2011-10-16 14:32:34 UTC (rev 3512)
@@ -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::
+myuser:x::
Added: debian/trunk/tests/cptools/05_cppw_2_files/config/etc/passwd
===================================================================
--- debian/trunk/tests/cptools/05_cppw_2_files/config/etc/passwd (rev 0)
+++ debian/trunk/tests/cptools/05_cppw_2_files/config/etc/passwd 2011-10-16 14:32:34 UTC (rev 3512)
@@ -0,0 +1,21 @@
+root:x:0:0:root:/root:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+bin:x:2:2:bin:/bin:/bin/sh
+sys:x:3:3:sys:/dev:/bin/sh
+sync:x:4:65534:sync:/bin:/bin/sync
+games:x:5:60:games:/usr/games:/bin/sh
+man:x:6:12:man:/var/cache/man:/bin/sh
+lp:x:7:7:lp:/var/spool/lpd:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/var/spool/news:/bin/sh
+uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/var/www:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/var/list:/bin/sh
+irc:x:39:39:ircd:/var/run/ircd:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
+nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
+Debian-exim:x:102:102::/var/spool/exim4:/bin/false
+myuser:x:424242:424242::/home:/bin/sh
+myuser2:x:424243:424242::/home:/bin/sh
Added: debian/trunk/tests/cptools/05_cppw_2_files/config/etc/shadow
===================================================================
--- debian/trunk/tests/cptools/05_cppw_2_files/config/etc/shadow (rev 0)
+++ debian/trunk/tests/cptools/05_cppw_2_files/config/etc/shadow 2011-10-16 14:32:34 UTC (rev 3512)
@@ -0,0 +1,21 @@
+root:$1$NBLBLIXb$WUgojj1bNuxWEADQGt1m9.:12991:0:99999:7:::
+daemon:*:12977:0:99999:7:::
+bin:*:12977:0:99999:7:::
+sys:*:12977:0:99999:7:::
+sync:*:12977:0:99999:7:::
+games:*:12977:0:99999:7:::
+man:*:12977:0:99999:7:::
+lp:*:12977:0:99999:7:::
+mail:*:12977:0:99999:7:::
+news:*:12977:0:99999:7:::
+uucp:*:12977:0:99999:7:::
+proxy:*:12977:0:99999:7:::
+www-data:*:12977:0:99999:7:::
+backup:*:12977:0:99999:7:::
+list:*:12977:0:99999:7:::
+irc:*:12977:0:99999:7:::
+gnats:*:12977:0:99999:7:::
+nobody:*:12977:0:99999:7:::
+Debian-exim:!:12977:0:99999:7:::
+myuser:$1$yQnIAZWV$gDAMB2IkqaONgrQiRdo4y.:12991:0:99999:7:::
+myuser2:$1$yQnIAZWV$gDAMB2IkqaONgrQiRdo4y.:12991:0:99999:7:::
Added: debian/trunk/tests/cptools/05_cppw_2_files/config.txt
===================================================================
Added: debian/trunk/tests/cptools/05_cppw_2_files/cppw.test
===================================================================
--- debian/trunk/tests/cptools/05_cppw_2_files/cppw.test (rev 0)
+++ debian/trunk/tests/cptools/05_cppw_2_files/cppw.test 2011-10-16 14:32:34 UTC (rev 3512)
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "cppw reports an error if 2 files are provided"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Use cppw with 2 users (cppw data/passwd data/passwd)..."
+cppw data/passwd data/passwd 2>tmp/usage.out && exit 1 || {
+ status=$?
+}
+echo "OK"
+
+echo -n "Check returned status ($status)..."
+test "$status" = "1"
+echo "OK"
+
+echo "cppw 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/cptools/05_cppw_2_files/cppw.test
___________________________________________________________________
Added: svn:executable
+ *
Added: debian/trunk/tests/cptools/05_cppw_2_files/data/passwd
===================================================================
--- debian/trunk/tests/cptools/05_cppw_2_files/data/passwd (rev 0)
+++ debian/trunk/tests/cptools/05_cppw_2_files/data/passwd 2011-10-16 14:32:34 UTC (rev 3512)
@@ -0,0 +1,17 @@
+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
Added: debian/trunk/tests/cptools/05_cppw_2_files/data/usage.out
===================================================================
--- debian/trunk/tests/cptools/05_cppw_2_files/data/usage.out (rev 0)
+++ debian/trunk/tests/cptools/05_cppw_2_files/data/usage.out 2011-10-16 14:32:34 UTC (rev 3512)
@@ -0,0 +1,2 @@
+cppw: missing file argument, -h for usage
+cppw: (null) is unchanged
Added: debian/trunk/tests/cptools/06_cppw_no_file/config/etc/group
===================================================================
Added: debian/trunk/tests/cptools/06_cppw_no_file/config/etc/gshadow
===================================================================
Added: debian/trunk/tests/cptools/06_cppw_no_file/config/etc/passwd
===================================================================
Added: debian/trunk/tests/cptools/06_cppw_no_file/config/etc/shadow
===================================================================
Added: debian/trunk/tests/cptools/06_cppw_no_file/config.txt
===================================================================
Added: debian/trunk/tests/cptools/06_cppw_no_file/cppw.test
===================================================================
--- debian/trunk/tests/cptools/06_cppw_no_file/cppw.test (rev 0)
+++ debian/trunk/tests/cptools/06_cppw_no_file/cppw.test 2011-10-16 14:32:34 UTC (rev 3512)
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "cppw reports an error if no files are provided"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Use cppw with a nonexistant file (cppw data/passwd)..."
+cppw data/passwd 2>tmp/usage.out && exit 1 || {
+ status=$?
+}
+echo "OK"
+
+echo -n "Check returned status ($status)..."
+test "$status" = "1"
+echo "OK"
+
+echo "cppw 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/cptools/06_cppw_no_file/cppw.test
___________________________________________________________________
Added: svn:executable
+ *
Added: debian/trunk/tests/cptools/06_cppw_no_file/data/usage.out
===================================================================
--- debian/trunk/tests/cptools/06_cppw_no_file/data/usage.out (rev 0)
+++ debian/trunk/tests/cptools/06_cppw_no_file/data/usage.out 2011-10-16 14:32:34 UTC (rev 3512)
@@ -0,0 +1,2 @@
+cppw: data/passwd: No such file or directory
+cppw: /etc/passwd is unchanged
Added: debian/trunk/tests/cptools/07_cppw_locked_passwd/config/etc/group
===================================================================
Added: debian/trunk/tests/cptools/07_cppw_locked_passwd/config/etc/gshadow
===================================================================
Added: debian/trunk/tests/cptools/07_cppw_locked_passwd/config/etc/passwd
===================================================================
Added: debian/trunk/tests/cptools/07_cppw_locked_passwd/config/etc/shadow
===================================================================
Added: debian/trunk/tests/cptools/07_cppw_locked_passwd/config.txt
===================================================================
Added: debian/trunk/tests/cptools/07_cppw_locked_passwd/cppw.test
===================================================================
--- debian/trunk/tests/cptools/07_cppw_locked_passwd/cppw.test (rev 0)
+++ debian/trunk/tests/cptools/07_cppw_locked_passwd/cppw.test 2011-10-16 14:32:34 UTC (rev 3512)
@@ -0,0 +1,60 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "cppw reports an error if no files are provided"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Create lock file for /etc/passwd..."
+touch /etc/passwd.lock
+echo "done"
+
+echo -n "Use cppw (cppw data/passwd)..."
+cppw data/passwd 2>tmp/usage.out && exit 1 || {
+ status=$?
+}
+echo "OK"
+
+rm -f /etc/passwd.lock
+
+echo -n "Check returned status ($status)..."
+test "$status" = "5"
+echo "OK"
+
+echo "cppw 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/cptools/07_cppw_locked_passwd/cppw.test
___________________________________________________________________
Added: svn:executable
+ *
Added: debian/trunk/tests/cptools/07_cppw_locked_passwd/data/passwd
===================================================================
Added: debian/trunk/tests/cptools/07_cppw_locked_passwd/data/usage.out
===================================================================
--- debian/trunk/tests/cptools/07_cppw_locked_passwd/data/usage.out (rev 0)
+++ debian/trunk/tests/cptools/07_cppw_locked_passwd/data/usage.out 2011-10-16 14:32:34 UTC (rev 3512)
@@ -0,0 +1,3 @@
+cppw: existing lock file /etc/passwd.lock without a PID
+cppw: Couldn't lock file
+cppw: /etc/passwd is unchanged
Added: debian/trunk/tests/cptools/08_cppw-p/config/etc/group
===================================================================
Added: debian/trunk/tests/cptools/08_cppw-p/config/etc/gshadow
===================================================================
Added: debian/trunk/tests/cptools/08_cppw-p/config/etc/passwd
===================================================================
Added: debian/trunk/tests/cptools/08_cppw-p/config/etc/shadow
===================================================================
Added: debian/trunk/tests/cptools/08_cppw-p/config.txt
===================================================================
Added: debian/trunk/tests/cptools/08_cppw-p/cppw.test
===================================================================
--- debian/trunk/tests/cptools/08_cppw-p/cppw.test (rev 0)
+++ debian/trunk/tests/cptools/08_cppw-p/cppw.test 2011-10-16 14:32:34 UTC (rev 3512)
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "cppw -p option"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Use cppw -p (cppw -p data/passwd)..."
+cppw -p data/passwd
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl data/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/cptools/08_cppw-p/cppw.test
___________________________________________________________________
Added: svn:executable
+ *
Added: debian/trunk/tests/cptools/08_cppw-p/data/passwd
===================================================================
Added: debian/trunk/tests/cptools/09_cppw-g/config/etc/group
===================================================================
--- debian/trunk/tests/cptools/09_cppw-g/config/etc/group (rev 0)
+++ debian/trunk/tests/cptools/09_cppw-g/config/etc/group 2011-10-16 14:32:34 UTC (rev 3512)
@@ -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/cptools/09_cppw-g/config/etc/gshadow
===================================================================
--- debian/trunk/tests/cptools/09_cppw-g/config/etc/gshadow (rev 0)
+++ debian/trunk/tests/cptools/09_cppw-g/config/etc/gshadow 2011-10-16 14:32:34 UTC (rev 3512)
@@ -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/cptools/09_cppw-g/config/etc/passwd
===================================================================
--- debian/trunk/tests/cptools/09_cppw-g/config/etc/passwd (rev 0)
+++ debian/trunk/tests/cptools/09_cppw-g/config/etc/passwd 2011-10-16 14:32:34 UTC (rev 3512)
@@ -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:blahblahblah:1000:1000::/home/foo:/bin/false
Added: debian/trunk/tests/cptools/09_cppw-g/config/etc/shadow
===================================================================
--- debian/trunk/tests/cptools/09_cppw-g/config/etc/shadow (rev 0)
+++ debian/trunk/tests/cptools/09_cppw-g/config/etc/shadow 2011-10-16 14:32:34 UTC (rev 3512)
@@ -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/cptools/09_cppw-g/config.txt
===================================================================
Added: debian/trunk/tests/cptools/09_cppw-g/cppw.test
===================================================================
--- debian/trunk/tests/cptools/09_cppw-g/cppw.test (rev 0)
+++ debian/trunk/tests/cptools/09_cppw-g/cppw.test 2011-10-16 14:32:34 UTC (rev 3512)
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "cppw can copy the group file"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Use cppw -g (cppw -g data/group)..."
+cppw -g data/group
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl config/etc/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl data/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/cptools/09_cppw-g/cppw.test
___________________________________________________________________
Added: svn:executable
+ *
Added: debian/trunk/tests/cptools/09_cppw-g/data/group
===================================================================
--- debian/trunk/tests/cptools/09_cppw-g/data/group (rev 0)
+++ debian/trunk/tests/cptools/09_cppw-g/data/group 2011-10-16 14:32:34 UTC (rev 3512)
@@ -0,0 +1,39 @@
+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:
Added: debian/trunk/tests/cptools/10_cppw-g-s/config/etc/group
===================================================================
--- debian/trunk/tests/cptools/10_cppw-g-s/config/etc/group (rev 0)
+++ debian/trunk/tests/cptools/10_cppw-g-s/config/etc/group 2011-10-16 14:32:34 UTC (rev 3512)
@@ -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/cptools/10_cppw-g-s/config/etc/gshadow
===================================================================
--- debian/trunk/tests/cptools/10_cppw-g-s/config/etc/gshadow (rev 0)
+++ debian/trunk/tests/cptools/10_cppw-g-s/config/etc/gshadow 2011-10-16 14:32:34 UTC (rev 3512)
@@ -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/cptools/10_cppw-g-s/config/etc/passwd
===================================================================
--- debian/trunk/tests/cptools/10_cppw-g-s/config/etc/passwd (rev 0)
+++ debian/trunk/tests/cptools/10_cppw-g-s/config/etc/passwd 2011-10-16 14:32:34 UTC (rev 3512)
@@ -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:blahblahblah:1000:1000::/home/foo:/bin/false
Added: debian/trunk/tests/cptools/10_cppw-g-s/config/etc/shadow
===================================================================
--- debian/trunk/tests/cptools/10_cppw-g-s/config/etc/shadow (rev 0)
+++ debian/trunk/tests/cptools/10_cppw-g-s/config/etc/shadow 2011-10-16 14:32:34 UTC (rev 3512)
@@ -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/cptools/10_cppw-g-s/config.txt
===================================================================
Added: debian/trunk/tests/cptools/10_cppw-g-s/cppw.test
===================================================================
--- debian/trunk/tests/cptools/10_cppw-g-s/cppw.test (rev 0)
+++ debian/trunk/tests/cptools/10_cppw-g-s/cppw.test 2011-10-16 14:32:34 UTC (rev 3512)
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "cppw can copy the gshadow file"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Use cppw -g -s (cppw -g -s data/gshadow)..."
+cppw -g -s data/gshadow
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl config/etc/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl config/etc/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl config/etc/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl data/gshadow /etc/gshadow
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+
Property changes on: debian/trunk/tests/cptools/10_cppw-g-s/cppw.test
___________________________________________________________________
Added: svn:executable
+ *
Added: debian/trunk/tests/cptools/10_cppw-g-s/data/gshadow
===================================================================
--- debian/trunk/tests/cptools/10_cppw-g-s/data/gshadow (rev 0)
+++ debian/trunk/tests/cptools/10_cppw-g-s/data/gshadow 2011-10-16 14:32:34 UTC (rev 3512)
@@ -0,0 +1,39 @@
+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:*::
Added: debian/trunk/tests/cptools/11_cppw-p-s/config/etc/group
===================================================================
--- debian/trunk/tests/cptools/11_cppw-p-s/config/etc/group (rev 0)
+++ debian/trunk/tests/cptools/11_cppw-p-s/config/etc/group 2011-10-16 14:32:34 UTC (rev 3512)
@@ -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/cptools/11_cppw-p-s/config/etc/gshadow
===================================================================
--- debian/trunk/tests/cptools/11_cppw-p-s/config/etc/gshadow (rev 0)
+++ debian/trunk/tests/cptools/11_cppw-p-s/config/etc/gshadow 2011-10-16 14:32:34 UTC (rev 3512)
@@ -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/cptools/11_cppw-p-s/config/etc/passwd
===================================================================
--- debian/trunk/tests/cptools/11_cppw-p-s/config/etc/passwd (rev 0)
+++ debian/trunk/tests/cptools/11_cppw-p-s/config/etc/passwd 2011-10-16 14:32:34 UTC (rev 3512)
@@ -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:blahblahblah:1000:1000::/home/foo:/bin/false
Added: debian/trunk/tests/cptools/11_cppw-p-s/config/etc/shadow
===================================================================
--- debian/trunk/tests/cptools/11_cppw-p-s/config/etc/shadow (rev 0)
+++ debian/trunk/tests/cptools/11_cppw-p-s/config/etc/shadow 2011-10-16 14:32:34 UTC (rev 3512)
@@ -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/cptools/11_cppw-p-s/config.txt
===================================================================
Added: debian/trunk/tests/cptools/11_cppw-p-s/cppw.test
===================================================================
--- debian/trunk/tests/cptools/11_cppw-p-s/cppw.test (rev 0)
+++ debian/trunk/tests/cptools/11_cppw-p-s/cppw.test 2011-10-16 14:32:34 UTC (rev 3512)
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "cppw can copy the shadow file"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Use cppw -p -s (cppw -p -s data/shadow)..."
+cppw -p -s data/shadow
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl config/etc/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl config/etc/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl data/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/cptools/11_cppw-p-s/cppw.test
___________________________________________________________________
Added: svn:executable
+ *
Added: debian/trunk/tests/cptools/11_cppw-p-s/data/shadow
===================================================================
--- debian/trunk/tests/cptools/11_cppw-p-s/data/shadow (rev 0)
+++ debian/trunk/tests/cptools/11_cppw-p-s/data/shadow 2011-10-16 14:32:34 UTC (rev 3512)
@@ -0,0 +1,16 @@
+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:::
+Debian-exim:!:12977:0:99999:7:::
+foo:!:12977:0:99999:7:::
More information about the Pkg-shadow-commits
mailing list