[Pkg-shadow-commits] r3507 - in debian/trunk/tests/chsh: . 02_chsh_usage 02_chsh_usage/config 02_chsh_usage/config/etc 02_chsh_usage/data 03_chsh_usage_invalid_option 03_chsh_usage_invalid_option/config 03_chsh_usage_invalid_option/config/etc 03_chsh_usage_invalid_option/data 04_chsh_usage_2_users 04_chsh_usage_2_users/config 04_chsh_usage_2_users/config/etc 04_chsh_usage_2_users/data 05_chsh_myuser_restricted_shell 05_chsh_myuser_restricted_shell/config 05_chsh_myuser_restricted_shell/config/etc 06_chsh_myuser_non_restricted_shell 06_chsh_myuser_non_restricted_shell/config 06_chsh_myuser_non_restricted_shell/config/etc 06_chsh_myuser_non_restricted_shell/data 07_chsh_usage_invalid_user 07_chsh_usage_invalid_user/config 07_chsh_usage_invalid_user/config/etc 07_chsh_usage_invalid_user/data 08_chsh_myuser_to_restricted_shell 08_chsh_myuser_to_restricted_shell/config 08_chsh_myuser_to_restricted_shell/config/etc 08_chsh_myuser_to_restricted_shell/data 09_chsh_myuser_to_missing_shell 09_chsh_myuser_to_missing_shell/config 09_chsh_myuser_to_missing_shell/config/etc 09_chsh_myuser_to_missing_shell/data 10_chsh_myuser_to_non_executable_shell 10_chsh_myuser_to_non_executable_shell/config 10_chsh_myuser_to_non_executable_shell/config/etc 10_chsh_myuser_to_non_executable_shell/data 11_chsh_auth_failure 11_chsh_auth_failure/config 11_chsh_auth_failure/config/etc 11_chsh_auth_failure/data 12_chsh_warning_missing_shell 12_chsh_warning_missing_shell/config 12_chsh_warning_missing_shell/config/etc 12_chsh_warning_missing_shell/config/etc/pam.d 12_chsh_warning_missing_shell/data 13_chsh_warning_non_executable 13_chsh_warning_non_executable/config 13_chsh_warning_non_executable/config/etc 13_chsh_warning_non_executable/config/etc/pam.d 13_chsh_warning_non_executable/data

Nicolas FRANÇOIS nekral-guest at alioth.debian.org
Sun Sep 25 13:53:11 UTC 2011


Author: nekral-guest
Date: 2011-09-25 13:53:11 +0000 (Sun, 25 Sep 2011)
New Revision: 3507

Added:
   debian/trunk/tests/chsh/02_chsh_usage/
   debian/trunk/tests/chsh/02_chsh_usage/chsh.test
   debian/trunk/tests/chsh/02_chsh_usage/config.txt
   debian/trunk/tests/chsh/02_chsh_usage/config/
   debian/trunk/tests/chsh/02_chsh_usage/config/etc/
   debian/trunk/tests/chsh/02_chsh_usage/config/etc/group
   debian/trunk/tests/chsh/02_chsh_usage/config/etc/gshadow
   debian/trunk/tests/chsh/02_chsh_usage/config/etc/passwd
   debian/trunk/tests/chsh/02_chsh_usage/config/etc/shadow
   debian/trunk/tests/chsh/02_chsh_usage/data/
   debian/trunk/tests/chsh/02_chsh_usage/data/usage.out
   debian/trunk/tests/chsh/03_chsh_usage_invalid_option/
   debian/trunk/tests/chsh/03_chsh_usage_invalid_option/chsh.test
   debian/trunk/tests/chsh/03_chsh_usage_invalid_option/config.txt
   debian/trunk/tests/chsh/03_chsh_usage_invalid_option/config/
   debian/trunk/tests/chsh/03_chsh_usage_invalid_option/config/etc/
   debian/trunk/tests/chsh/03_chsh_usage_invalid_option/config/etc/group
   debian/trunk/tests/chsh/03_chsh_usage_invalid_option/config/etc/gshadow
   debian/trunk/tests/chsh/03_chsh_usage_invalid_option/config/etc/passwd
   debian/trunk/tests/chsh/03_chsh_usage_invalid_option/config/etc/shadow
   debian/trunk/tests/chsh/03_chsh_usage_invalid_option/data/
   debian/trunk/tests/chsh/03_chsh_usage_invalid_option/data/usage.out
   debian/trunk/tests/chsh/04_chsh_usage_2_users/
   debian/trunk/tests/chsh/04_chsh_usage_2_users/chsh.test
   debian/trunk/tests/chsh/04_chsh_usage_2_users/config.txt
   debian/trunk/tests/chsh/04_chsh_usage_2_users/config/
   debian/trunk/tests/chsh/04_chsh_usage_2_users/config/etc/
   debian/trunk/tests/chsh/04_chsh_usage_2_users/config/etc/group
   debian/trunk/tests/chsh/04_chsh_usage_2_users/config/etc/gshadow
   debian/trunk/tests/chsh/04_chsh_usage_2_users/config/etc/passwd
   debian/trunk/tests/chsh/04_chsh_usage_2_users/config/etc/shadow
   debian/trunk/tests/chsh/04_chsh_usage_2_users/data/
   debian/trunk/tests/chsh/04_chsh_usage_2_users/data/usage.out
   debian/trunk/tests/chsh/05_chsh_myuser_restricted_shell/
   debian/trunk/tests/chsh/05_chsh_myuser_restricted_shell/chsh.test
   debian/trunk/tests/chsh/05_chsh_myuser_restricted_shell/config.txt
   debian/trunk/tests/chsh/05_chsh_myuser_restricted_shell/config/
   debian/trunk/tests/chsh/05_chsh_myuser_restricted_shell/config/etc/
   debian/trunk/tests/chsh/05_chsh_myuser_restricted_shell/config/etc/group
   debian/trunk/tests/chsh/05_chsh_myuser_restricted_shell/config/etc/gshadow
   debian/trunk/tests/chsh/05_chsh_myuser_restricted_shell/config/etc/passwd
   debian/trunk/tests/chsh/05_chsh_myuser_restricted_shell/config/etc/shadow
   debian/trunk/tests/chsh/05_chsh_myuser_restricted_shell/config/etc/shells
   debian/trunk/tests/chsh/05_chsh_myuser_restricted_shell/data/
   debian/trunk/tests/chsh/05_chsh_myuser_restricted_shell/run.exp
   debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/
   debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/chsh.test
   debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/config.txt
   debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/config/
   debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/config/etc/
   debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/config/etc/group
   debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/config/etc/gshadow
   debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/config/etc/passwd
   debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/config/etc/shadow
   debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/config/etc/shells
   debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/data/
   debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/data/passwd
   debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/run.exp
   debian/trunk/tests/chsh/07_chsh_usage_invalid_user/
   debian/trunk/tests/chsh/07_chsh_usage_invalid_user/chsh.test
   debian/trunk/tests/chsh/07_chsh_usage_invalid_user/config.txt
   debian/trunk/tests/chsh/07_chsh_usage_invalid_user/config/
   debian/trunk/tests/chsh/07_chsh_usage_invalid_user/config/etc/
   debian/trunk/tests/chsh/07_chsh_usage_invalid_user/config/etc/group
   debian/trunk/tests/chsh/07_chsh_usage_invalid_user/config/etc/gshadow
   debian/trunk/tests/chsh/07_chsh_usage_invalid_user/config/etc/passwd
   debian/trunk/tests/chsh/07_chsh_usage_invalid_user/config/etc/shadow
   debian/trunk/tests/chsh/07_chsh_usage_invalid_user/data/
   debian/trunk/tests/chsh/07_chsh_usage_invalid_user/data/usage.out
   debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/
   debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/chsh.test
   debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/config.txt
   debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/config/
   debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/config/etc/
   debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/config/etc/group
   debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/config/etc/gshadow
   debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/config/etc/passwd
   debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/config/etc/shadow
   debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/config/etc/shells
   debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/data/
   debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/data/passwd
   debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/run.exp
   debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/
   debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/chsh.test
   debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/config.txt
   debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/config/
   debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/config/etc/
   debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/config/etc/group
   debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/config/etc/gshadow
   debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/config/etc/passwd
   debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/config/etc/shadow
   debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/config/etc/shells
   debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/data/
   debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/data/passwd
   debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/run.exp
   debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/
   debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/chsh.test
   debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/config.txt
   debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/config/
   debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/config/etc/
   debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/config/etc/group
   debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/config/etc/gshadow
   debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/config/etc/passwd
   debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/config/etc/shadow
   debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/config/etc/shells
   debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/data/
   debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/data/passwd
   debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/run.exp
   debian/trunk/tests/chsh/11_chsh_auth_failure/
   debian/trunk/tests/chsh/11_chsh_auth_failure/chsh.test
   debian/trunk/tests/chsh/11_chsh_auth_failure/config.txt
   debian/trunk/tests/chsh/11_chsh_auth_failure/config/
   debian/trunk/tests/chsh/11_chsh_auth_failure/config/etc/
   debian/trunk/tests/chsh/11_chsh_auth_failure/config/etc/group
   debian/trunk/tests/chsh/11_chsh_auth_failure/config/etc/gshadow
   debian/trunk/tests/chsh/11_chsh_auth_failure/config/etc/passwd
   debian/trunk/tests/chsh/11_chsh_auth_failure/config/etc/shadow
   debian/trunk/tests/chsh/11_chsh_auth_failure/config/etc/shells
   debian/trunk/tests/chsh/11_chsh_auth_failure/data/
   debian/trunk/tests/chsh/11_chsh_auth_failure/data/passwd
   debian/trunk/tests/chsh/11_chsh_auth_failure/run.exp
   debian/trunk/tests/chsh/12_chsh_warning_missing_shell/
   debian/trunk/tests/chsh/12_chsh_warning_missing_shell/chsh.test
   debian/trunk/tests/chsh/12_chsh_warning_missing_shell/config.txt
   debian/trunk/tests/chsh/12_chsh_warning_missing_shell/config/
   debian/trunk/tests/chsh/12_chsh_warning_missing_shell/config/etc/
   debian/trunk/tests/chsh/12_chsh_warning_missing_shell/config/etc/group
   debian/trunk/tests/chsh/12_chsh_warning_missing_shell/config/etc/gshadow
   debian/trunk/tests/chsh/12_chsh_warning_missing_shell/config/etc/pam.d/
   debian/trunk/tests/chsh/12_chsh_warning_missing_shell/config/etc/pam.d/chsh
   debian/trunk/tests/chsh/12_chsh_warning_missing_shell/config/etc/passwd
   debian/trunk/tests/chsh/12_chsh_warning_missing_shell/config/etc/shadow
   debian/trunk/tests/chsh/12_chsh_warning_missing_shell/config/etc/shells
   debian/trunk/tests/chsh/12_chsh_warning_missing_shell/data/
   debian/trunk/tests/chsh/12_chsh_warning_missing_shell/data/chsh.err
   debian/trunk/tests/chsh/12_chsh_warning_missing_shell/data/passwd
   debian/trunk/tests/chsh/13_chsh_warning_non_executable/
   debian/trunk/tests/chsh/13_chsh_warning_non_executable/chsh.test
   debian/trunk/tests/chsh/13_chsh_warning_non_executable/config.txt
   debian/trunk/tests/chsh/13_chsh_warning_non_executable/config/
   debian/trunk/tests/chsh/13_chsh_warning_non_executable/config/etc/
   debian/trunk/tests/chsh/13_chsh_warning_non_executable/config/etc/group
   debian/trunk/tests/chsh/13_chsh_warning_non_executable/config/etc/gshadow
   debian/trunk/tests/chsh/13_chsh_warning_non_executable/config/etc/pam.d/
   debian/trunk/tests/chsh/13_chsh_warning_non_executable/config/etc/pam.d/chsh
   debian/trunk/tests/chsh/13_chsh_warning_non_executable/config/etc/passwd
   debian/trunk/tests/chsh/13_chsh_warning_non_executable/config/etc/shadow
   debian/trunk/tests/chsh/13_chsh_warning_non_executable/config/etc/shells
   debian/trunk/tests/chsh/13_chsh_warning_non_executable/data/
   debian/trunk/tests/chsh/13_chsh_warning_non_executable/data/chsh.err
   debian/trunk/tests/chsh/13_chsh_warning_non_executable/data/passwd
Log:
Add 12 tests for chsh.


Added: debian/trunk/tests/chsh/02_chsh_usage/chsh.test
===================================================================
--- debian/trunk/tests/chsh/02_chsh_usage/chsh.test	                        (rev 0)
+++ debian/trunk/tests/chsh/02_chsh_usage/chsh.test	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "chsh 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 chsh usage (chsh -h)..."
+chsh -h >tmp/usage.out
+echo "OK"
+
+echo "chsh 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/chsh/02_chsh_usage/chsh.test
___________________________________________________________________
Added: svn:executable
   + *

Added: debian/trunk/tests/chsh/02_chsh_usage/config/etc/group
===================================================================
Added: debian/trunk/tests/chsh/02_chsh_usage/config/etc/gshadow
===================================================================
Added: debian/trunk/tests/chsh/02_chsh_usage/config/etc/passwd
===================================================================
Added: debian/trunk/tests/chsh/02_chsh_usage/config/etc/shadow
===================================================================
Added: debian/trunk/tests/chsh/02_chsh_usage/config.txt
===================================================================
Added: debian/trunk/tests/chsh/02_chsh_usage/data/usage.out
===================================================================
--- debian/trunk/tests/chsh/02_chsh_usage/data/usage.out	                        (rev 0)
+++ debian/trunk/tests/chsh/02_chsh_usage/data/usage.out	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1,6 @@
+Usage: chsh [options] [LOGIN]
+
+Options:
+  -h, --help                    display this help message and exit
+  -s, --shell SHELL             new login shell for the user account
+

Added: debian/trunk/tests/chsh/03_chsh_usage_invalid_option/chsh.test
===================================================================
--- debian/trunk/tests/chsh/03_chsh_usage_invalid_option/chsh.test	                        (rev 0)
+++ debian/trunk/tests/chsh/03_chsh_usage_invalid_option/chsh.test	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "chsh displays its usage message is case of invalid option"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Use wrong chsh option (chsh -Z)..."
+chsh -Z 2>tmp/usage.out && exit 1 || {
+	status=$?
+}
+echo "OK"
+
+echo -n "Check returned status ($status)..."
+test "$status" = "2"
+echo "OK"
+
+echo "chsh 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/chsh/03_chsh_usage_invalid_option/chsh.test
___________________________________________________________________
Added: svn:executable
   + *

Added: debian/trunk/tests/chsh/03_chsh_usage_invalid_option/config/etc/group
===================================================================
Added: debian/trunk/tests/chsh/03_chsh_usage_invalid_option/config/etc/gshadow
===================================================================
Added: debian/trunk/tests/chsh/03_chsh_usage_invalid_option/config/etc/passwd
===================================================================
Added: debian/trunk/tests/chsh/03_chsh_usage_invalid_option/config/etc/shadow
===================================================================
Added: debian/trunk/tests/chsh/03_chsh_usage_invalid_option/config.txt
===================================================================
Added: debian/trunk/tests/chsh/03_chsh_usage_invalid_option/data/usage.out
===================================================================
--- debian/trunk/tests/chsh/03_chsh_usage_invalid_option/data/usage.out	                        (rev 0)
+++ debian/trunk/tests/chsh/03_chsh_usage_invalid_option/data/usage.out	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1,7 @@
+chsh: invalid option -- 'Z'
+Usage: chsh [options] [LOGIN]
+
+Options:
+  -h, --help                    display this help message and exit
+  -s, --shell SHELL             new login shell for the user account
+

Added: debian/trunk/tests/chsh/04_chsh_usage_2_users/chsh.test
===================================================================
--- debian/trunk/tests/chsh/04_chsh_usage_2_users/chsh.test	                        (rev 0)
+++ debian/trunk/tests/chsh/04_chsh_usage_2_users/chsh.test	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "chsh displays its usage message is case multiple users are provided"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Use chsh with 2 users (chsh -s /bin/sh root bin)..."
+chsh -s /bin/sh root bin 2>tmp/usage.out && exit 1 || {
+	status=$?
+}
+echo "OK"
+
+echo -n "Check returned status ($status)..."
+test "$status" = "2"
+echo "OK"
+
+echo "chsh 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/chsh/04_chsh_usage_2_users/chsh.test
___________________________________________________________________
Added: svn:executable
   + *

Added: debian/trunk/tests/chsh/04_chsh_usage_2_users/config/etc/group
===================================================================
Added: debian/trunk/tests/chsh/04_chsh_usage_2_users/config/etc/gshadow
===================================================================
Added: debian/trunk/tests/chsh/04_chsh_usage_2_users/config/etc/passwd
===================================================================
Added: debian/trunk/tests/chsh/04_chsh_usage_2_users/config/etc/shadow
===================================================================
Added: debian/trunk/tests/chsh/04_chsh_usage_2_users/config.txt
===================================================================
Added: debian/trunk/tests/chsh/04_chsh_usage_2_users/data/usage.out
===================================================================
--- debian/trunk/tests/chsh/04_chsh_usage_2_users/data/usage.out	                        (rev 0)
+++ debian/trunk/tests/chsh/04_chsh_usage_2_users/data/usage.out	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1,6 @@
+Usage: chsh [options] [LOGIN]
+
+Options:
+  -h, --help                    display this help message and exit
+  -s, --shell SHELL             new login shell for the user account
+

Added: debian/trunk/tests/chsh/05_chsh_myuser_restricted_shell/chsh.test
===================================================================
--- debian/trunk/tests/chsh/05_chsh_myuser_restricted_shell/chsh.test	                        (rev 0)
+++ debian/trunk/tests/chsh/05_chsh_myuser_restricted_shell/chsh.test	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "chsh can displays its usage message"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+chmod a+w tmp
+
+echo -n "execute chsh..."
+su myuser -c "./run.exp /bin/sh"
+echo "OK"
+
+echo -n "Check the passwd file..."
+../../common/compare_file.pl config/etc/passwd /etc/passwd
+echo "OK"
+echo -n "Check the group file..."
+../../common/compare_file.pl config/etc/group /etc/group
+echo "OK"
+echo -n "Check the shadow file..."
+../../common/compare_file.pl config/etc/shadow /etc/shadow
+echo "OK"
+echo -n "Check the gshadow file..."
+../../common/compare_file.pl config/etc/gshadow /etc/gshadow
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/chsh/05_chsh_myuser_restricted_shell/chsh.test
___________________________________________________________________
Added: svn:executable
   + *

Added: debian/trunk/tests/chsh/05_chsh_myuser_restricted_shell/config/etc/group
===================================================================
--- debian/trunk/tests/chsh/05_chsh_myuser_restricted_shell/config/etc/group	                        (rev 0)
+++ debian/trunk/tests/chsh/05_chsh_myuser_restricted_shell/config/etc/group	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/05_chsh_myuser_restricted_shell/config/etc/gshadow
===================================================================
--- debian/trunk/tests/chsh/05_chsh_myuser_restricted_shell/config/etc/gshadow	                        (rev 0)
+++ debian/trunk/tests/chsh/05_chsh_myuser_restricted_shell/config/etc/gshadow	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/05_chsh_myuser_restricted_shell/config/etc/passwd
===================================================================
--- debian/trunk/tests/chsh/05_chsh_myuser_restricted_shell/config/etc/passwd	                        (rev 0)
+++ debian/trunk/tests/chsh/05_chsh_myuser_restricted_shell/config/etc/passwd	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/bash
+myuser2:x:424243:424242::/home:/bin/sh

Added: debian/trunk/tests/chsh/05_chsh_myuser_restricted_shell/config/etc/shadow
===================================================================
--- debian/trunk/tests/chsh/05_chsh_myuser_restricted_shell/config/etc/shadow	                        (rev 0)
+++ debian/trunk/tests/chsh/05_chsh_myuser_restricted_shell/config/etc/shadow	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/05_chsh_myuser_restricted_shell/config/etc/shells
===================================================================
--- debian/trunk/tests/chsh/05_chsh_myuser_restricted_shell/config/etc/shells	                        (rev 0)
+++ debian/trunk/tests/chsh/05_chsh_myuser_restricted_shell/config/etc/shells	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1,15 @@
+# /etc/shells: valid login shells
+/bin/ash
+/bin/csh
+/bin/sh
+/usr/bin/es
+/usr/bin/ksh
+/bin/ksh
+/usr/bin/rc
+/usr/bin/tcsh
+/bin/tcsh
+/usr/bin/zsh
+/bin/sash
+#/bin/zsh
+/usr/bin/esh
+/bin/rbash

Added: debian/trunk/tests/chsh/05_chsh_myuser_restricted_shell/config.txt
===================================================================
Added: debian/trunk/tests/chsh/05_chsh_myuser_restricted_shell/run.exp
===================================================================
--- debian/trunk/tests/chsh/05_chsh_myuser_restricted_shell/run.exp	                        (rev 0)
+++ debian/trunk/tests/chsh/05_chsh_myuser_restricted_shell/run.exp	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1,34 @@
+#!/usr/bin/expect
+
+set timeout 5
+
+if {$argc < 1} {
+	puts "usage: run.exp \[shell] \[user]"
+	exit 1
+}
+set shell     [lindex $argv 0]
+
+if {$argc == 2} {
+	spawn /usr/bin/chsh [lindex $argv 1]
+} else {
+	spawn /usr/bin/chsh
+}
+
+expect "You may not change the shell for 'myuser'.\r\n"
+expect {
+	eof {
+		if ([string compare $expect_out(buffer) ""]) {
+			set fp [open "tmp/out" w]
+			puts $fp "$expect_out(buffer)"
+			puts "\nFAIL"
+			exit 1
+		}
+	} default {
+		puts "\nFAIL"
+		exit 1
+	}
+}
+
+puts "\nPASS"
+exit 0
+


Property changes on: debian/trunk/tests/chsh/05_chsh_myuser_restricted_shell/run.exp
___________________________________________________________________
Added: svn:executable
   + *

Added: debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/chsh.test
===================================================================
--- debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/chsh.test	                        (rev 0)
+++ debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/chsh.test	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "chsh can displays its usage message"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+chmod a+w tmp
+
+echo -n "execute chsh..."
+su myuser -c "./run.exp /bin/sh"
+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/chsh/06_chsh_myuser_non_restricted_shell/chsh.test
___________________________________________________________________
Added: svn:executable
   + *

Added: debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/config/etc/group
===================================================================
--- debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/config/etc/group	                        (rev 0)
+++ debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/config/etc/group	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/06_chsh_myuser_non_restricted_shell/config/etc/gshadow
===================================================================
--- debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/config/etc/gshadow	                        (rev 0)
+++ debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/config/etc/gshadow	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/06_chsh_myuser_non_restricted_shell/config/etc/passwd
===================================================================
--- debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/config/etc/passwd	                        (rev 0)
+++ debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/config/etc/passwd	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/bash
+myuser2:x:424243:424242::/home:/bin/sh

Added: debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/config/etc/shadow
===================================================================
--- debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/config/etc/shadow	                        (rev 0)
+++ debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/config/etc/shadow	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/06_chsh_myuser_non_restricted_shell/config/etc/shells
===================================================================
--- debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/config/etc/shells	                        (rev 0)
+++ debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/config/etc/shells	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1,16 @@
+# /etc/shells: valid login shells
+/bin/ash
+/bin/csh
+/bin/sh
+/usr/bin/es
+/usr/bin/ksh
+/bin/ksh
+/usr/bin/rc
+/usr/bin/tcsh
+/bin/tcsh
+/usr/bin/zsh
+/bin/sash
+#/bin/zsh
+/usr/bin/esh
+/bin/bash
+/bin/rbash

Added: debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/config.txt
===================================================================
Added: debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/data/passwd
===================================================================
--- debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/data/passwd	                        (rev 0)
+++ debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/data/passwd	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/06_chsh_myuser_non_restricted_shell/run.exp
===================================================================
--- debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/run.exp	                        (rev 0)
+++ debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/run.exp	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1,40 @@
+#!/usr/bin/expect
+
+set timeout 5
+
+if {$argc < 1} {
+	puts "usage: run.exp \[shell] \[user]"
+	exit 1
+}
+set shell     [lindex $argv 0]
+
+if {$argc == 2} {
+	spawn /usr/bin/chsh [lindex $argv 1]
+} else {
+	spawn /usr/bin/chsh
+}
+
+expect "Password: "
+send "myuserF00barbaz\r"
+expect "Changing the login shell for myuser"
+expect "Enter the new value, or press ENTER for the default"
+expect -re "Login Shell .*\]: "
+send "$shell\r"
+expect "$shell\r\n"
+expect {
+	eof {
+		if ([string compare $expect_out(buffer) ""]) {
+			set fp [open "tmp/out" w]
+			puts $fp "$expect_out(buffer)"
+			puts "\nFAIL"
+			exit 1
+		}
+	} default {
+		puts "\nFAIL"
+		exit 1
+	}
+}
+
+puts "\nPASS"
+exit 0
+


Property changes on: debian/trunk/tests/chsh/06_chsh_myuser_non_restricted_shell/run.exp
___________________________________________________________________
Added: svn:executable
   + *

Added: debian/trunk/tests/chsh/07_chsh_usage_invalid_user/chsh.test
===================================================================
--- debian/trunk/tests/chsh/07_chsh_usage_invalid_user/chsh.test	                        (rev 0)
+++ debian/trunk/tests/chsh/07_chsh_usage_invalid_user/chsh.test	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "chsh checks that the user exist"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Use chsh for an invalid user (chsh wronguser)..."
+chsh wronguser 2>tmp/usage.out && exit 1 || {
+	status=$?
+}
+echo "OK"
+
+echo -n "Check returned status ($status)..."
+test "$status" = "1"
+echo "OK"
+
+echo "chsh 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/chsh/07_chsh_usage_invalid_user/chsh.test
___________________________________________________________________
Added: svn:executable
   + *

Added: debian/trunk/tests/chsh/07_chsh_usage_invalid_user/config/etc/group
===================================================================
Added: debian/trunk/tests/chsh/07_chsh_usage_invalid_user/config/etc/gshadow
===================================================================
Added: debian/trunk/tests/chsh/07_chsh_usage_invalid_user/config/etc/passwd
===================================================================
Added: debian/trunk/tests/chsh/07_chsh_usage_invalid_user/config/etc/shadow
===================================================================
Added: debian/trunk/tests/chsh/07_chsh_usage_invalid_user/config.txt
===================================================================
Added: debian/trunk/tests/chsh/07_chsh_usage_invalid_user/data/usage.out
===================================================================
--- debian/trunk/tests/chsh/07_chsh_usage_invalid_user/data/usage.out	                        (rev 0)
+++ debian/trunk/tests/chsh/07_chsh_usage_invalid_user/data/usage.out	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1 @@
+chsh: user 'wronguser' does not exist

Added: debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/chsh.test
===================================================================
--- debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/chsh.test	                        (rev 0)
+++ debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/chsh.test	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "chsh can displays its usage message"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+chmod a+w tmp
+
+echo -n "execute chsh..."
+su myuser -c "./run.exp /bin/bash"
+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/chsh/08_chsh_myuser_to_restricted_shell/chsh.test
___________________________________________________________________
Added: svn:executable
   + *

Added: debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/config/etc/group
===================================================================
--- debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/config/etc/group	                        (rev 0)
+++ debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/config/etc/group	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/08_chsh_myuser_to_restricted_shell/config/etc/gshadow
===================================================================
--- debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/config/etc/gshadow	                        (rev 0)
+++ debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/config/etc/gshadow	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/08_chsh_myuser_to_restricted_shell/config/etc/passwd
===================================================================
--- debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/config/etc/passwd	                        (rev 0)
+++ debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/config/etc/passwd	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/08_chsh_myuser_to_restricted_shell/config/etc/shadow
===================================================================
--- debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/config/etc/shadow	                        (rev 0)
+++ debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/config/etc/shadow	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/08_chsh_myuser_to_restricted_shell/config/etc/shells
===================================================================
--- debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/config/etc/shells	                        (rev 0)
+++ debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/config/etc/shells	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1,15 @@
+# /etc/shells: valid login shells
+/bin/ash
+/bin/csh
+/bin/sh
+/usr/bin/es
+/usr/bin/ksh
+/bin/ksh
+/usr/bin/rc
+/usr/bin/tcsh
+/bin/tcsh
+/usr/bin/zsh
+/bin/sash
+#/bin/zsh
+/usr/bin/esh
+/bin/rbash

Added: debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/config.txt
===================================================================
Added: debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/data/passwd
===================================================================
--- debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/data/passwd	                        (rev 0)
+++ debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/data/passwd	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/08_chsh_myuser_to_restricted_shell/run.exp
===================================================================
--- debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/run.exp	                        (rev 0)
+++ debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/run.exp	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1,41 @@
+#!/usr/bin/expect
+
+set timeout 5
+
+if {$argc < 1} {
+	puts "usage: run.exp \[shell] \[user]"
+	exit 1
+}
+set shell     [lindex $argv 0]
+
+if {$argc == 2} {
+	spawn /usr/bin/chsh [lindex $argv 1]
+} else {
+	spawn /usr/bin/chsh
+}
+
+expect "Password: "
+send "myuserF00barbaz\r"
+expect "Changing the login shell for myuser"
+expect "Enter the new value, or press ENTER for the default"
+expect -re "Login Shell .*\]: "
+send "$shell\r"
+expect "$shell\r\n"
+expect "chsh: $shell is an invalid shell\r\n"
+expect {
+	eof {
+		if ([string compare $expect_out(buffer) ""]) {
+			set fp [open "tmp/out" w]
+			puts $fp "$expect_out(buffer)"
+			puts "\nFAIL"
+			exit 1
+		}
+	} default {
+		puts "\nFAIL"
+		exit 1
+	}
+}
+
+puts "\nPASS"
+exit 0
+


Property changes on: debian/trunk/tests/chsh/08_chsh_myuser_to_restricted_shell/run.exp
___________________________________________________________________
Added: svn:executable
   + *

Added: debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/chsh.test
===================================================================
--- debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/chsh.test	                        (rev 0)
+++ debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/chsh.test	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "chsh can displays its usage message"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+chmod a+w tmp
+
+echo /tmp/bash >> /etc/shells
+echo -n "execute chsh..."
+su myuser -c "./run.exp /tmp/bash"
+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/chsh/09_chsh_myuser_to_missing_shell/chsh.test
___________________________________________________________________
Added: svn:executable
   + *

Added: debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/config/etc/group
===================================================================
--- debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/config/etc/group	                        (rev 0)
+++ debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/config/etc/group	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/09_chsh_myuser_to_missing_shell/config/etc/gshadow
===================================================================
--- debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/config/etc/gshadow	                        (rev 0)
+++ debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/config/etc/gshadow	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/09_chsh_myuser_to_missing_shell/config/etc/passwd
===================================================================
--- debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/config/etc/passwd	                        (rev 0)
+++ debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/config/etc/passwd	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/09_chsh_myuser_to_missing_shell/config/etc/shadow
===================================================================
--- debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/config/etc/shadow	                        (rev 0)
+++ debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/config/etc/shadow	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/09_chsh_myuser_to_missing_shell/config/etc/shells
===================================================================
--- debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/config/etc/shells	                        (rev 0)
+++ debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/config/etc/shells	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1,15 @@
+# /etc/shells: valid login shells
+/bin/ash
+/bin/csh
+/bin/sh
+/usr/bin/es
+/usr/bin/ksh
+/bin/ksh
+/usr/bin/rc
+/usr/bin/tcsh
+/bin/tcsh
+/usr/bin/zsh
+/bin/sash
+#/bin/zsh
+/usr/bin/esh
+/bin/rbash

Added: debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/config.txt
===================================================================
Added: debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/data/passwd
===================================================================
--- debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/data/passwd	                        (rev 0)
+++ debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/data/passwd	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/09_chsh_myuser_to_missing_shell/run.exp
===================================================================
--- debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/run.exp	                        (rev 0)
+++ debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/run.exp	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1,41 @@
+#!/usr/bin/expect
+
+set timeout 5
+
+if {$argc < 1} {
+	puts "usage: run.exp \[shell] \[user]"
+	exit 1
+}
+set shell     [lindex $argv 0]
+
+if {$argc == 2} {
+	spawn /usr/bin/chsh [lindex $argv 1]
+} else {
+	spawn /usr/bin/chsh
+}
+
+expect "Password: "
+send "myuserF00barbaz\r"
+expect "Changing the login shell for myuser"
+expect "Enter the new value, or press ENTER for the default"
+expect -re "Login Shell .*\]: "
+send "$shell\r"
+expect "$shell\r\n"
+expect "chsh: $shell is an invalid shell\r\n"
+expect {
+	eof {
+		if ([string compare $expect_out(buffer) ""]) {
+			set fp [open "tmp/out" w]
+			puts $fp "$expect_out(buffer)"
+			puts "\nFAIL"
+			exit 1
+		}
+	} default {
+		puts "\nFAIL"
+		exit 1
+	}
+}
+
+puts "\nPASS"
+exit 0
+


Property changes on: debian/trunk/tests/chsh/09_chsh_myuser_to_missing_shell/run.exp
___________________________________________________________________
Added: svn:executable
   + *

Added: debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/chsh.test
===================================================================
--- debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/chsh.test	                        (rev 0)
+++ debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/chsh.test	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "chsh can displays its usage message"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config; rm -f /tmp/bash' 0
+
+change_config
+
+chmod a+w tmp
+
+echo /tmp/bash >> /etc/shells
+cp /bin/bash /tmp/bash
+chmod a-x /tmp/bash
+
+echo -n "execute chsh..."
+su myuser -c "./run.exp /tmp/bash"
+echo "OK"
+rm -f /tmp/bash
+
+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/chsh/10_chsh_myuser_to_non_executable_shell/chsh.test
___________________________________________________________________
Added: svn:executable
   + *

Added: debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/config/etc/group
===================================================================
--- debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/config/etc/group	                        (rev 0)
+++ debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/config/etc/group	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/10_chsh_myuser_to_non_executable_shell/config/etc/gshadow
===================================================================
--- debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/config/etc/gshadow	                        (rev 0)
+++ debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/config/etc/gshadow	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/10_chsh_myuser_to_non_executable_shell/config/etc/passwd
===================================================================
--- debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/config/etc/passwd	                        (rev 0)
+++ debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/config/etc/passwd	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/10_chsh_myuser_to_non_executable_shell/config/etc/shadow
===================================================================
--- debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/config/etc/shadow	                        (rev 0)
+++ debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/config/etc/shadow	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/10_chsh_myuser_to_non_executable_shell/config/etc/shells
===================================================================
--- debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/config/etc/shells	                        (rev 0)
+++ debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/config/etc/shells	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1,15 @@
+# /etc/shells: valid login shells
+/bin/ash
+/bin/csh
+/bin/sh
+/usr/bin/es
+/usr/bin/ksh
+/bin/ksh
+/usr/bin/rc
+/usr/bin/tcsh
+/bin/tcsh
+/usr/bin/zsh
+/bin/sash
+#/bin/zsh
+/usr/bin/esh
+/bin/rbash

Added: debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/config.txt
===================================================================
Added: debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/data/passwd
===================================================================
--- debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/data/passwd	                        (rev 0)
+++ debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/data/passwd	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/10_chsh_myuser_to_non_executable_shell/run.exp
===================================================================
--- debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/run.exp	                        (rev 0)
+++ debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/run.exp	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1,41 @@
+#!/usr/bin/expect
+
+set timeout 5
+
+if {$argc < 1} {
+	puts "usage: run.exp \[shell] \[user]"
+	exit 1
+}
+set shell     [lindex $argv 0]
+
+if {$argc == 2} {
+	spawn /usr/bin/chsh [lindex $argv 1]
+} else {
+	spawn /usr/bin/chsh
+}
+
+expect "Password: "
+send "myuserF00barbaz\r"
+expect "Changing the login shell for myuser"
+expect "Enter the new value, or press ENTER for the default"
+expect -re "Login Shell .*\]: "
+send "$shell\r"
+expect "$shell\r\n"
+expect "chsh: $shell is an invalid shell\r\n"
+expect {
+	eof {
+		if ([string compare $expect_out(buffer) ""]) {
+			set fp [open "tmp/out" w]
+			puts $fp "$expect_out(buffer)"
+			puts "\nFAIL"
+			exit 1
+		}
+	} default {
+		puts "\nFAIL"
+		exit 1
+	}
+}
+
+puts "\nPASS"
+exit 0
+


Property changes on: debian/trunk/tests/chsh/10_chsh_myuser_to_non_executable_shell/run.exp
___________________________________________________________________
Added: svn:executable
   + *

Added: debian/trunk/tests/chsh/11_chsh_auth_failure/chsh.test
===================================================================
--- debian/trunk/tests/chsh/11_chsh_auth_failure/chsh.test	                        (rev 0)
+++ debian/trunk/tests/chsh/11_chsh_auth_failure/chsh.test	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "chsh checks password for non root"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+chmod a+w tmp
+
+echo -n "execute chsh..."
+su myuser -c "./run.exp /bin/bash"
+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/chsh/11_chsh_auth_failure/chsh.test
___________________________________________________________________
Added: svn:executable
   + *

Added: debian/trunk/tests/chsh/11_chsh_auth_failure/config/etc/group
===================================================================
--- debian/trunk/tests/chsh/11_chsh_auth_failure/config/etc/group	                        (rev 0)
+++ debian/trunk/tests/chsh/11_chsh_auth_failure/config/etc/group	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/11_chsh_auth_failure/config/etc/gshadow
===================================================================
--- debian/trunk/tests/chsh/11_chsh_auth_failure/config/etc/gshadow	                        (rev 0)
+++ debian/trunk/tests/chsh/11_chsh_auth_failure/config/etc/gshadow	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/11_chsh_auth_failure/config/etc/passwd
===================================================================
--- debian/trunk/tests/chsh/11_chsh_auth_failure/config/etc/passwd	                        (rev 0)
+++ debian/trunk/tests/chsh/11_chsh_auth_failure/config/etc/passwd	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/11_chsh_auth_failure/config/etc/shadow
===================================================================
--- debian/trunk/tests/chsh/11_chsh_auth_failure/config/etc/shadow	                        (rev 0)
+++ debian/trunk/tests/chsh/11_chsh_auth_failure/config/etc/shadow	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/11_chsh_auth_failure/config/etc/shells
===================================================================
--- debian/trunk/tests/chsh/11_chsh_auth_failure/config/etc/shells	                        (rev 0)
+++ debian/trunk/tests/chsh/11_chsh_auth_failure/config/etc/shells	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1,15 @@
+# /etc/shells: valid login shells
+/bin/ash
+/bin/csh
+/bin/sh
+/usr/bin/es
+/usr/bin/ksh
+/bin/ksh
+/usr/bin/rc
+/usr/bin/tcsh
+/bin/tcsh
+/usr/bin/zsh
+/bin/sash
+#/bin/zsh
+/usr/bin/esh
+/bin/rbash

Added: debian/trunk/tests/chsh/11_chsh_auth_failure/config.txt
===================================================================
Added: debian/trunk/tests/chsh/11_chsh_auth_failure/data/passwd
===================================================================
--- debian/trunk/tests/chsh/11_chsh_auth_failure/data/passwd	                        (rev 0)
+++ debian/trunk/tests/chsh/11_chsh_auth_failure/data/passwd	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/11_chsh_auth_failure/run.exp
===================================================================
--- debian/trunk/tests/chsh/11_chsh_auth_failure/run.exp	                        (rev 0)
+++ debian/trunk/tests/chsh/11_chsh_auth_failure/run.exp	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1,36 @@
+#!/usr/bin/expect
+
+set timeout 5
+
+if {$argc < 1} {
+	puts "usage: run.exp \[shell] \[user]"
+	exit 1
+}
+set shell     [lindex $argv 0]
+
+if {$argc == 2} {
+	spawn /usr/bin/chsh [lindex $argv 1]
+} else {
+	spawn /usr/bin/chsh
+}
+
+expect "Password: "
+send "wrong pass\r"
+expect "chsh: PAM authentication failed\r\n"
+expect {
+	eof {
+		if ([string compare $expect_out(buffer) ""]) {
+			set fp [open "tmp/out" w]
+			puts $fp "$expect_out(buffer)"
+			puts "\nFAIL"
+			exit 1
+		}
+	} default {
+		puts "\nFAIL"
+		exit 1
+	}
+}
+
+puts "\nPASS"
+exit 0
+


Property changes on: debian/trunk/tests/chsh/11_chsh_auth_failure/run.exp
___________________________________________________________________
Added: svn:executable
   + *

Added: debian/trunk/tests/chsh/12_chsh_warning_missing_shell/chsh.test
===================================================================
--- debian/trunk/tests/chsh/12_chsh_warning_missing_shell/chsh.test	                        (rev 0)
+++ debian/trunk/tests/chsh/12_chsh_warning_missing_shell/chsh.test	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "chsh can displays its usage message"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo -n "Change shell to a missing shell (chsh -s /tmp/bash bin)..."
+chsh -s /tmp/bash bin 2>tmp/chsh.err
+echo "OK"
+
+echo "chsh reported:"
+echo "======================================================================="
+cat tmp/chsh.err
+echo "======================================================================="
+echo -n "Check the usage message..."
+diff -au data/chsh.err tmp/chsh.err
+echo "usage message OK."
+rm -f tmp/chsh.err
+
+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/chsh/12_chsh_warning_missing_shell/chsh.test
___________________________________________________________________
Added: svn:executable
   + *

Added: debian/trunk/tests/chsh/12_chsh_warning_missing_shell/config/etc/group
===================================================================
--- debian/trunk/tests/chsh/12_chsh_warning_missing_shell/config/etc/group	                        (rev 0)
+++ debian/trunk/tests/chsh/12_chsh_warning_missing_shell/config/etc/group	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/12_chsh_warning_missing_shell/config/etc/gshadow
===================================================================
--- debian/trunk/tests/chsh/12_chsh_warning_missing_shell/config/etc/gshadow	                        (rev 0)
+++ debian/trunk/tests/chsh/12_chsh_warning_missing_shell/config/etc/gshadow	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/12_chsh_warning_missing_shell/config/etc/pam.d/chsh
===================================================================
--- debian/trunk/tests/chsh/12_chsh_warning_missing_shell/config/etc/pam.d/chsh	                        (rev 0)
+++ debian/trunk/tests/chsh/12_chsh_warning_missing_shell/config/etc/pam.d/chsh	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1,20 @@
+#
+# The PAM configuration file for the Shadow `chsh' service
+#
+
+# This will not allow a user to change their shell unless
+# their current one is listed in /etc/shells. This keeps
+# accounts with special shells from changing them.
+auth       required   pam_shells.so
+
+# This allows root to change user shell without being
+# prompted for a password
+auth		sufficient	pam_rootok.so
+
+# The standard Unix authentication modules, used with
+# NIS (man nsswitch) as well as normal /etc/passwd and
+# /etc/shadow entries.
+ at include common-auth
+ at include common-account
+ at include common-session
+

Added: debian/trunk/tests/chsh/12_chsh_warning_missing_shell/config/etc/passwd
===================================================================
--- debian/trunk/tests/chsh/12_chsh_warning_missing_shell/config/etc/passwd	                        (rev 0)
+++ debian/trunk/tests/chsh/12_chsh_warning_missing_shell/config/etc/passwd	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/12_chsh_warning_missing_shell/config/etc/shadow
===================================================================
--- debian/trunk/tests/chsh/12_chsh_warning_missing_shell/config/etc/shadow	                        (rev 0)
+++ debian/trunk/tests/chsh/12_chsh_warning_missing_shell/config/etc/shadow	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/12_chsh_warning_missing_shell/config/etc/shells
===================================================================
--- debian/trunk/tests/chsh/12_chsh_warning_missing_shell/config/etc/shells	                        (rev 0)
+++ debian/trunk/tests/chsh/12_chsh_warning_missing_shell/config/etc/shells	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1,16 @@
+# /etc/shells: valid login shells
+/bin/ash
+/bin/csh
+/bin/sh
+/usr/bin/es
+/usr/bin/ksh
+/bin/ksh
+/usr/bin/rc
+/usr/bin/tcsh
+/bin/tcsh
+/usr/bin/zsh
+/bin/sash
+/bin/zsh
+/usr/bin/esh
+/bin/bash
+/bin/rbash

Added: debian/trunk/tests/chsh/12_chsh_warning_missing_shell/config.txt
===================================================================
Added: debian/trunk/tests/chsh/12_chsh_warning_missing_shell/data/chsh.err
===================================================================
--- debian/trunk/tests/chsh/12_chsh_warning_missing_shell/data/chsh.err	                        (rev 0)
+++ debian/trunk/tests/chsh/12_chsh_warning_missing_shell/data/chsh.err	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1 @@
+chsh: Warning: /tmp/bash does not exist

Added: debian/trunk/tests/chsh/12_chsh_warning_missing_shell/data/passwd
===================================================================
--- debian/trunk/tests/chsh/12_chsh_warning_missing_shell/data/passwd	                        (rev 0)
+++ debian/trunk/tests/chsh/12_chsh_warning_missing_shell/data/passwd	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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:/tmp/bash
+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/chsh/13_chsh_warning_non_executable/chsh.test
===================================================================
--- debian/trunk/tests/chsh/13_chsh_warning_non_executable/chsh.test	                        (rev 0)
+++ debian/trunk/tests/chsh/13_chsh_warning_non_executable/chsh.test	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+log_start "$0" "chsh can displays its usage message"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config; rm -f /tmp/bash' 0
+
+change_config
+
+cp /bin/bash /tmp/bash
+chmod a-x /tmp/bash
+
+echo -n "Change shell to a missing shell (chsh -s /tmp/bash bin)..."
+chsh -s /tmp/bash bin 2>tmp/chsh.err
+echo "OK"
+rm -f /tmp/bash
+
+echo "chsh reported:"
+echo "======================================================================="
+cat tmp/chsh.err
+echo "======================================================================="
+echo -n "Check the usage message..."
+diff -au data/chsh.err tmp/chsh.err
+echo "usage message OK."
+rm -f tmp/chsh.err
+
+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/chsh/13_chsh_warning_non_executable/chsh.test
___________________________________________________________________
Added: svn:executable
   + *

Added: debian/trunk/tests/chsh/13_chsh_warning_non_executable/config/etc/group
===================================================================
--- debian/trunk/tests/chsh/13_chsh_warning_non_executable/config/etc/group	                        (rev 0)
+++ debian/trunk/tests/chsh/13_chsh_warning_non_executable/config/etc/group	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/13_chsh_warning_non_executable/config/etc/gshadow
===================================================================
--- debian/trunk/tests/chsh/13_chsh_warning_non_executable/config/etc/gshadow	                        (rev 0)
+++ debian/trunk/tests/chsh/13_chsh_warning_non_executable/config/etc/gshadow	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/13_chsh_warning_non_executable/config/etc/pam.d/chsh
===================================================================
--- debian/trunk/tests/chsh/13_chsh_warning_non_executable/config/etc/pam.d/chsh	                        (rev 0)
+++ debian/trunk/tests/chsh/13_chsh_warning_non_executable/config/etc/pam.d/chsh	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1,20 @@
+#
+# The PAM configuration file for the Shadow `chsh' service
+#
+
+# This will not allow a user to change their shell unless
+# their current one is listed in /etc/shells. This keeps
+# accounts with special shells from changing them.
+auth       required   pam_shells.so
+
+# This allows root to change user shell without being
+# prompted for a password
+auth		sufficient	pam_rootok.so
+
+# The standard Unix authentication modules, used with
+# NIS (man nsswitch) as well as normal /etc/passwd and
+# /etc/shadow entries.
+ at include common-auth
+ at include common-account
+ at include common-session
+

Added: debian/trunk/tests/chsh/13_chsh_warning_non_executable/config/etc/passwd
===================================================================
--- debian/trunk/tests/chsh/13_chsh_warning_non_executable/config/etc/passwd	                        (rev 0)
+++ debian/trunk/tests/chsh/13_chsh_warning_non_executable/config/etc/passwd	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/13_chsh_warning_non_executable/config/etc/shadow
===================================================================
--- debian/trunk/tests/chsh/13_chsh_warning_non_executable/config/etc/shadow	                        (rev 0)
+++ debian/trunk/tests/chsh/13_chsh_warning_non_executable/config/etc/shadow	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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/chsh/13_chsh_warning_non_executable/config/etc/shells
===================================================================
--- debian/trunk/tests/chsh/13_chsh_warning_non_executable/config/etc/shells	                        (rev 0)
+++ debian/trunk/tests/chsh/13_chsh_warning_non_executable/config/etc/shells	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1,16 @@
+# /etc/shells: valid login shells
+/bin/ash
+/bin/csh
+/bin/sh
+/usr/bin/es
+/usr/bin/ksh
+/bin/ksh
+/usr/bin/rc
+/usr/bin/tcsh
+/bin/tcsh
+/usr/bin/zsh
+/bin/sash
+/bin/zsh
+/usr/bin/esh
+/bin/bash
+/bin/rbash

Added: debian/trunk/tests/chsh/13_chsh_warning_non_executable/config.txt
===================================================================
Added: debian/trunk/tests/chsh/13_chsh_warning_non_executable/data/chsh.err
===================================================================
--- debian/trunk/tests/chsh/13_chsh_warning_non_executable/data/chsh.err	                        (rev 0)
+++ debian/trunk/tests/chsh/13_chsh_warning_non_executable/data/chsh.err	2011-09-25 13:53:11 UTC (rev 3507)
@@ -0,0 +1 @@
+chsh: Warning: /tmp/bash is not executable

Added: debian/trunk/tests/chsh/13_chsh_warning_non_executable/data/passwd
===================================================================
--- debian/trunk/tests/chsh/13_chsh_warning_non_executable/data/passwd	                        (rev 0)
+++ debian/trunk/tests/chsh/13_chsh_warning_non_executable/data/passwd	2011-09-25 13:53:11 UTC (rev 3507)
@@ -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:/tmp/bash
+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




More information about the Pkg-shadow-commits mailing list