[Pkg-shadow-commits] r1700 - debian/trunk/tests/su/03

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Sat Jan 12 13:25:11 UTC 2008


Author: nekral-guest
Date: 2008-01-12 13:25:11 +0000 (Sat, 12 Jan 2008)
New Revision: 1700

Added:
   debian/trunk/tests/su/03/su_run_command01.test
   debian/trunk/tests/su/03/su_run_command02.test
   debian/trunk/tests/su/03/su_run_command03.test
   debian/trunk/tests/su/03/su_run_command04.test
   debian/trunk/tests/su/03/su_run_command05.test
   debian/trunk/tests/su/03/su_run_command06.test
   debian/trunk/tests/su/03/su_run_command07.test
   debian/trunk/tests/su/03/su_run_command08.test
   debian/trunk/tests/su/03/su_run_command09.test
   debian/trunk/tests/su/03/su_run_command10.test
   debian/trunk/tests/su/03/su_run_command11.test
   debian/trunk/tests/su/03/su_run_command12.test
   debian/trunk/tests/su/03/su_run_command13.test
   debian/trunk/tests/su/03/su_run_command14.test
   debian/trunk/tests/su/03/su_run_command15.test
   debian/trunk/tests/su/03/su_run_command16.test
   debian/trunk/tests/su/03/su_run_command17.test
Removed:
   debian/trunk/tests/su/03/run
   debian/trunk/tests/su/03/run.exp
Log:
Split the test script in more atomic tests.


Deleted: debian/trunk/tests/su/03/run
===================================================================
--- debian/trunk/tests/su/03/run	2008-01-12 13:23:19 UTC (rev 1699)
+++ debian/trunk/tests/su/03/run	2008-01-12 13:25:11 UTC (rev 1700)
@@ -1,41 +0,0 @@
-#!/bin/sh
-
-set -e
-cd $(dirname $0)
-
-# Rational:
-# Test that su can be used to switch to root and to a normal account
-
-# no testsuite password
-# root password: rootF00barbaz
-# myuser password: myuserF00barbaz
-
-save()
-{
-	[ ! -d tmp ] && mkdir tmp
-	for i in passwd group shadow gshadow
-	do
-		[ -f /etc/$i  ] && cp /etc/$i  tmp/$i
-	done
-
-	true
-}
-
-restore()
-{
-	for i in passwd group shadow gshadow
-	do
-		[ -f tmp/$i  ] && cp tmp/$i  /etc/$i  && rm tmp/$i
-	done
-	rmdir tmp
-}
-
-save
-
-# restore the files on exit
-trap 'restore' 0
-
-cp data/{passwd,shadow,group,gshadow} /etc/
-
-./run.exp
-

Deleted: debian/trunk/tests/su/03/run.exp
===================================================================
--- debian/trunk/tests/su/03/run.exp	2008-01-12 13:23:19 UTC (rev 1699)
+++ debian/trunk/tests/su/03/run.exp	2008-01-12 13:25:11 UTC (rev 1700)
@@ -1,95 +0,0 @@
-#!/usr/bin/expect
-
-set timeout 2
-expect_after default {puts "\nFAIL"; exit 1}
-
-spawn /bin/bash
-expect "# "
-
-#=============================================================================
-#
-# Test the -c option
-#
-#=============================================================================
-send "/bin/su myuser -c ls\r"
-expect "data  run  run.exp  tmp\r\n"
-expect "# "
-
-send "/bin/su -- myuser -c ls\r"
-expect "data  run  run.exp  tmp\r\n"
-expect "# "
-
-send "/bin/su myuser -- -c ls\r"
-expect "data  run  run.exp  tmp\r\n"
-expect "# "
-
-# This is Debian specific. Use su's -c option
-send "/bin/su -c ls myuser\r"
-expect "data  run  run.exp  tmp\r\n"
-expect "# "
-
-send "/bin/su -c ls -- myuser\r"
-expect "data  run  run.exp  tmp\r\n"
-expect "# "
-
-# non login su should not change the working directory
-send "/bin/su myuser -c pwd\r"
-expect "/su/03\r\n"
-expect "# "
-
-# Same tests with login su
-send "/bin/su - myuser -c pwd\r"
-expect "/home\r\n"
-expect "# "
-
-send "/bin/su - -- myuser -c pwd\r"
-expect "/home\r\n"
-expect "# "
-
-send "/bin/su - myuser -- -c pwd\r"
-expect "/home\r\n"
-expect "# "
-
-# The same with -l/--login
-send "/bin/su -l myuser -c pwd\r"
-expect "/home\r\n"
-expect "# "
-
-send "/bin/su --login -- myuser -c pwd\r"
-expect "/home\r\n"
-expect "# "
-
-send "/bin/su -l myuser -- -c pwd\r"
-expect "/home\r\n"
-expect "# "
-
-# make sure -c is an su option
-send "/bin/su -c pwd - myuser\r"
-expect "/home\r\n"
-expect "# "
-
-send "/bin/su -c pwd -- - myuser\r"
-expect "/home\r\n"
-expect "# "
-
-# getopt must reorder the options/non-options
-send "/bin/su -p -c pwd -- - myuser\r"
-expect "/su/03\r\n"
-expect "# "
-send "/bin/su -p -c pwd - myuser\r"
-expect "/su/03\r\n"
-expect "# "
-send "/bin/su -c pwd -p - myuser\r"
-expect "/su/03\r\n"
-expect "# "
-send "/bin/su -c pwd - -p myuser\r"
-expect "/su/03\r\n"
-expect "# "
-send "/bin/su -c pwd - myuser -p\r"
-expect "/su/03\r\n"
-expect "# "
-
-
-puts "\nPASS"
-exit 0
-

Added: debian/trunk/tests/su/03/su_run_command01.test
===================================================================
--- debian/trunk/tests/su/03/su_run_command01.test	                        (rev 0)
+++ debian/trunk/tests/su/03/su_run_command01.test	2008-01-12 13:25:11 UTC (rev 1700)
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+
+log_start "$0" "Running commands: su myuser -c 'ls config'"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo "/bin/su myuser -c 'ls config'> tmp/out 2> tmp/err"
+/bin/su myuser -c 'ls config'> tmp/out 2> tmp/err
+
+echo -n "Checking tmp/out..."
+diff -au data/ls.out tmp/out
+rm -f tmp/out
+echo "OK"
+
+echo -n "Checking tmp/err..."
+[ "$(wc -c tmp/err)" = "0 tmp/err" ] || false
+rm -f tmp/err
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/su/03/su_run_command01.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/su/03/su_run_command02.test
===================================================================
--- debian/trunk/tests/su/03/su_run_command02.test	                        (rev 0)
+++ debian/trunk/tests/su/03/su_run_command02.test	2008-01-12 13:25:11 UTC (rev 1700)
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+
+log_start "$0" "Running commands: su -- myuser -c 'ls config'"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo "/bin/su -- myuser -c 'ls config'> tmp/out 2> tmp/err"
+/bin/su -- myuser -c 'ls config'> tmp/out 2> tmp/err
+
+echo -n "Checking tmp/out..."
+diff -au data/ls.out tmp/out
+rm -f tmp/out
+echo "OK"
+
+echo -n "Checking tmp/err..."
+[ "$(wc -c tmp/err)" = "0 tmp/err" ] || false
+rm -f tmp/err
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/su/03/su_run_command02.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/su/03/su_run_command03.test
===================================================================
--- debian/trunk/tests/su/03/su_run_command03.test	                        (rev 0)
+++ debian/trunk/tests/su/03/su_run_command03.test	2008-01-12 13:25:11 UTC (rev 1700)
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+
+log_start "$0" "Running commands: su myuser -- -c 'ls config'"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo "/bin/su myuser -- -c 'ls config'> tmp/out 2> tmp/err"
+/bin/su myuser -- -c 'ls config'> tmp/out 2> tmp/err
+
+echo -n "Checking tmp/out..."
+diff -au data/ls.out tmp/out
+rm -f tmp/out
+echo "OK"
+
+echo -n "Checking tmp/err..."
+[ "$(wc -c tmp/err)" = "0 tmp/err" ] || false
+rm -f tmp/err
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/su/03/su_run_command03.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/su/03/su_run_command04.test
===================================================================
--- debian/trunk/tests/su/03/su_run_command04.test	                        (rev 0)
+++ debian/trunk/tests/su/03/su_run_command04.test	2008-01-12 13:25:11 UTC (rev 1700)
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+
+log_start "$0" "Running commands: su -c 'ls config' myuser"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo "/bin/su -c 'ls config' myuser> tmp/out 2> tmp/err"
+/bin/su -c 'ls config' myuser> tmp/out 2> tmp/err
+
+echo -n "Checking tmp/out..."
+diff -au data/ls.out tmp/out
+rm -f tmp/out
+echo "OK"
+
+echo -n "Checking tmp/err..."
+[ "$(wc -c tmp/err)" = "0 tmp/err" ] || false
+rm -f tmp/err
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/su/03/su_run_command04.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/su/03/su_run_command05.test
===================================================================
--- debian/trunk/tests/su/03/su_run_command05.test	                        (rev 0)
+++ debian/trunk/tests/su/03/su_run_command05.test	2008-01-12 13:25:11 UTC (rev 1700)
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+
+log_start "$0" "Running commands: su -c 'ls config' -- myuser"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo "/bin/su -c 'ls config' -- myuser> tmp/out 2> tmp/err"
+/bin/su -c 'ls config' -- myuser> tmp/out 2> tmp/err
+
+echo -n "Checking tmp/out..."
+diff -au data/ls.out tmp/out
+rm -f tmp/out
+echo "OK"
+
+echo -n "Checking tmp/err..."
+[ "$(wc -c tmp/err)" = "0 tmp/err" ] || false
+rm -f tmp/err
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/su/03/su_run_command05.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/su/03/su_run_command06.test
===================================================================
--- debian/trunk/tests/su/03/su_run_command06.test	                        (rev 0)
+++ debian/trunk/tests/su/03/su_run_command06.test	2008-01-12 13:25:11 UTC (rev 1700)
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+
+log_start "$0" "Running commands (check working directory): su myuser -c pwd"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo "/bin/su myuser -c pwd> tmp/out 2> tmp/err"
+/bin/su myuser -c pwd> tmp/out 2> tmp/err
+
+echo -n "Checking tmp/out..."
+case "$(cat tmp/out)" in
+	*/su/03)
+		echo "OK"
+		;;
+	*)
+		echo "FAIL"
+		echo "working directory: '$(cat tmp/out)' instead of '.../su/03'"
+		rm -f tmp/out
+		false
+		;;
+esac
+rm -f tmp/out
+
+echo -n "Checking tmp/err..."
+[ "$(wc -c tmp/err)" = "0 tmp/err" ] || false
+rm -f tmp/err
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/su/03/su_run_command06.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/su/03/su_run_command07.test
===================================================================
--- debian/trunk/tests/su/03/su_run_command07.test	                        (rev 0)
+++ debian/trunk/tests/su/03/su_run_command07.test	2008-01-12 13:25:11 UTC (rev 1700)
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+
+log_start "$0" "Running commands (check working directory): su - myuser -c pwd"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo "/bin/su - myuser -c pwd> tmp/out 2> tmp/err"
+/bin/su - myuser -c pwd> tmp/out 2> tmp/err
+
+echo -n "Checking tmp/out..."
+case "$(cat tmp/out)" in
+	/home)
+		echo "OK"
+		;;
+	*)
+		echo "FAIL"
+		echo "working directory: '$(cat tmp/out)' instead of '/home'"
+		rm -f tmp/out
+		false
+		;;
+esac
+rm -f tmp/out
+
+echo -n "Checking tmp/err..."
+[ "$(wc -c tmp/err)" = "0 tmp/err" ] || false
+rm -f tmp/err
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/su/03/su_run_command07.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/su/03/su_run_command08.test
===================================================================
--- debian/trunk/tests/su/03/su_run_command08.test	                        (rev 0)
+++ debian/trunk/tests/su/03/su_run_command08.test	2008-01-12 13:25:11 UTC (rev 1700)
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+
+log_start "$0" "Running commands (check working directory): su - -- myuser -c pwd"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo "/bin/su - -- myuser -c pwd> tmp/out 2> tmp/err"
+/bin/su - -- myuser -c pwd> tmp/out 2> tmp/err
+
+echo -n "Checking tmp/out..."
+case "$(cat tmp/out)" in
+	/home)
+		echo "OK"
+		;;
+	*)
+		echo "FAIL"
+		echo "working directory: '$(cat tmp/out)' instead of '/home'"
+		rm -f tmp/out
+		false
+		;;
+esac
+rm -f tmp/out
+
+echo -n "Checking tmp/err..."
+[ "$(wc -c tmp/err)" = "0 tmp/err" ] || false
+rm -f tmp/err
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/su/03/su_run_command08.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/su/03/su_run_command09.test
===================================================================
--- debian/trunk/tests/su/03/su_run_command09.test	                        (rev 0)
+++ debian/trunk/tests/su/03/su_run_command09.test	2008-01-12 13:25:11 UTC (rev 1700)
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+
+log_start "$0" "Running commands (check working directory): su - myuser -- -c pwd"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo "/bin/su - myuser -- -c pwd> tmp/out 2> tmp/err"
+/bin/su - myuser -- -c pwd> tmp/out 2> tmp/err
+
+echo -n "Checking tmp/out..."
+case "$(cat tmp/out)" in
+	/home)
+		echo "OK"
+		;;
+	*)
+		echo "FAIL"
+		echo "working directory: '$(cat tmp/out)' instead of '/home'"
+		rm -f tmp/out
+		false
+		;;
+esac
+rm -f tmp/out
+
+echo -n "Checking tmp/err..."
+[ "$(wc -c tmp/err)" = "0 tmp/err" ] || false
+rm -f tmp/err
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/su/03/su_run_command09.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/su/03/su_run_command10.test
===================================================================
--- debian/trunk/tests/su/03/su_run_command10.test	                        (rev 0)
+++ debian/trunk/tests/su/03/su_run_command10.test	2008-01-12 13:25:11 UTC (rev 1700)
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+
+log_start "$0" "Running commands (check working directory): su -l myuser -c pwd"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo "/bin/su -l myuser -c pwd> tmp/out 2> tmp/err"
+/bin/su -l myuser -c pwd> tmp/out 2> tmp/err
+
+echo -n "Checking tmp/out..."
+case "$(cat tmp/out)" in
+	/home)
+		echo "OK"
+		;;
+	*)
+		echo "FAIL"
+		echo "working directory: '$(cat tmp/out)' instead of '/home'"
+		rm -f tmp/out
+		false
+		;;
+esac
+rm -f tmp/out
+
+echo -n "Checking tmp/err..."
+[ "$(wc -c tmp/err)" = "0 tmp/err" ] || false
+rm -f tmp/err
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/su/03/su_run_command10.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/su/03/su_run_command11.test
===================================================================
--- debian/trunk/tests/su/03/su_run_command11.test	                        (rev 0)
+++ debian/trunk/tests/su/03/su_run_command11.test	2008-01-12 13:25:11 UTC (rev 1700)
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+
+log_start "$0" "Running commands (check working directory): su --login -- myuser -c pwd"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo "/bin/su --login -- myuser -c pwd> tmp/out 2> tmp/err"
+/bin/su --login -- myuser -c pwd> tmp/out 2> tmp/err
+
+echo -n "Checking tmp/out..."
+case "$(cat tmp/out)" in
+	/home)
+		echo "OK"
+		;;
+	*)
+		echo "FAIL"
+		echo "working directory: '$(cat tmp/out)' instead of '/home'"
+		rm -f tmp/out
+		false
+		;;
+esac
+rm -f tmp/out
+
+echo -n "Checking tmp/err..."
+[ "$(wc -c tmp/err)" = "0 tmp/err" ] || false
+rm -f tmp/err
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/su/03/su_run_command11.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/su/03/su_run_command12.test
===================================================================
--- debian/trunk/tests/su/03/su_run_command12.test	                        (rev 0)
+++ debian/trunk/tests/su/03/su_run_command12.test	2008-01-12 13:25:11 UTC (rev 1700)
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+
+log_start "$0" "Running commands (check working directory): su -l myuser -- -c pwd"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo "/bin/su -l myuser -- -c pwd> tmp/out 2> tmp/err"
+/bin/su -l myuser -- -c pwd> tmp/out 2> tmp/err
+
+echo -n "Checking tmp/out..."
+case "$(cat tmp/out)" in
+	/home)
+		echo "OK"
+		;;
+	*)
+		echo "FAIL"
+		echo "working directory: '$(cat tmp/out)' instead of '/home'"
+		rm -f tmp/out
+		false
+		;;
+esac
+rm -f tmp/out
+
+echo -n "Checking tmp/err..."
+[ "$(wc -c tmp/err)" = "0 tmp/err" ] || false
+rm -f tmp/err
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/su/03/su_run_command12.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/su/03/su_run_command13.test
===================================================================
--- debian/trunk/tests/su/03/su_run_command13.test	                        (rev 0)
+++ debian/trunk/tests/su/03/su_run_command13.test	2008-01-12 13:25:11 UTC (rev 1700)
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+
+log_start "$0" "Running commands (check working directory): su -p -c pwd -- - myuser"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo "/bin/su -p -c pwd -- - myuser> tmp/out 2> tmp/err"
+/bin/su -p -c pwd -- - myuser> tmp/out 2> tmp/err
+
+echo -n "Checking tmp/out..."
+case "$(cat tmp/out)" in
+	*/su/03)
+		echo "OK"
+		;;
+	*)
+		echo "FAIL"
+		echo "working directory: '$(cat tmp/out)' instead of '.../su/03'"
+		rm -f tmp/out
+		false
+		;;
+esac
+rm -f tmp/out
+
+echo -n "Checking tmp/err..."
+[ "$(wc -c tmp/err)" = "0 tmp/err" ] || {
+	echo "FAIL"
+	echo "tmp/err is not empty:"
+	cat tmp/err
+	false
+}
+rm -f tmp/err
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/su/03/su_run_command13.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/su/03/su_run_command14.test
===================================================================
--- debian/trunk/tests/su/03/su_run_command14.test	                        (rev 0)
+++ debian/trunk/tests/su/03/su_run_command14.test	2008-01-12 13:25:11 UTC (rev 1700)
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+
+log_start "$0" "Running commands (check working directory): su -p -c pwd - myuser"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo "/bin/su -p -c pwd - myuser> tmp/out 2> tmp/err"
+/bin/su -p -c pwd - myuser> tmp/out 2> tmp/err
+
+echo -n "Checking tmp/out..."
+case "$(cat tmp/out)" in
+	*/su/03)
+		echo "OK"
+		;;
+	*)
+		echo "FAIL"
+		echo "working directory: '$(cat tmp/out)' instead of '.../su/03'"
+		rm -f tmp/out
+		false
+		;;
+esac
+rm -f tmp/out
+
+echo -n "Checking tmp/err..."
+[ "$(wc -c tmp/err)" = "0 tmp/err" ] || false
+rm -f tmp/err
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/su/03/su_run_command14.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/su/03/su_run_command15.test
===================================================================
--- debian/trunk/tests/su/03/su_run_command15.test	                        (rev 0)
+++ debian/trunk/tests/su/03/su_run_command15.test	2008-01-12 13:25:11 UTC (rev 1700)
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+
+log_start "$0" "Running commands (check working directory): su -c pwd -p - myuser"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo "/bin/su -c pwd -p - myuser> tmp/out 2> tmp/err"
+/bin/su -c pwd -p - myuser> tmp/out 2> tmp/err
+
+echo -n "Checking tmp/out..."
+case "$(cat tmp/out)" in
+	*/su/03)
+		echo "OK"
+		;;
+	*)
+		echo "FAIL"
+		echo "working directory: '$(cat tmp/out)' instead of '.../su/03'"
+		rm -f tmp/out
+		false
+		;;
+esac
+rm -f tmp/out
+
+echo -n "Checking tmp/err..."
+[ "$(wc -c tmp/err)" = "0 tmp/err" ] || false
+rm -f tmp/err
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/su/03/su_run_command15.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/su/03/su_run_command16.test
===================================================================
--- debian/trunk/tests/su/03/su_run_command16.test	                        (rev 0)
+++ debian/trunk/tests/su/03/su_run_command16.test	2008-01-12 13:25:11 UTC (rev 1700)
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+
+log_start "$0" "Running commands (check working directory): su -c pwd - -p myuser"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo "/bin/su -c pwd - -p myuser> tmp/out 2> tmp/err"
+/bin/su -c pwd - -p myuser> tmp/out 2> tmp/err
+
+echo -n "Checking tmp/out..."
+case "$(cat tmp/out)" in
+	*/su/03)
+		echo "OK"
+		;;
+	*)
+		echo "FAIL"
+		echo "working directory: '$(cat tmp/out)' instead of '.../su/03'"
+		rm -f tmp/out
+		false
+		;;
+esac
+rm -f tmp/out
+
+echo -n "Checking tmp/err..."
+[ "$(wc -c tmp/err)" = "0 tmp/err" ] || false
+rm -f tmp/err
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/su/03/su_run_command16.test
___________________________________________________________________
Name: svn:executable
   + *

Added: debian/trunk/tests/su/03/su_run_command17.test
===================================================================
--- debian/trunk/tests/su/03/su_run_command17.test	                        (rev 0)
+++ debian/trunk/tests/su/03/su_run_command17.test	2008-01-12 13:25:11 UTC (rev 1700)
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+
+log_start "$0" "Running commands (check working directory): su -c pwd - myuser -p"
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+echo "/bin/su -c pwd - myuser -p> tmp/out 2> tmp/err"
+/bin/su -c pwd - myuser -p> tmp/out 2> tmp/err
+
+echo -n "Checking tmp/out..."
+case "$(cat tmp/out)" in
+	*/su/03)
+		echo "OK"
+		;;
+	*)
+		echo "FAIL"
+		echo "working directory: '$(cat tmp/out)' instead of '.../su/03'"
+		rm -f tmp/out
+		false
+		;;
+esac
+rm -f tmp/out
+
+echo -n "Checking tmp/err..."
+[ "$(wc -c tmp/err)" = "0 tmp/err" ] || false
+rm -f tmp/err
+echo "OK"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+


Property changes on: debian/trunk/tests/su/03/su_run_command17.test
___________________________________________________________________
Name: svn:executable
   + *




More information about the Pkg-shadow-commits mailing list