[Pkg-shadow-commits] r1695 - debian/trunk/tests/su/02
nekral-guest at alioth.debian.org
nekral-guest at alioth.debian.org
Sun Jan 6 20:34:19 UTC 2008
Author: nekral-guest
Date: 2008-01-06 20:34:19 +0000 (Sun, 06 Jan 2008)
New Revision: 1695
Added:
debian/trunk/tests/su/02/env_FOO-options_
debian/trunk/tests/su/02/env_FOO-options_-
debian/trunk/tests/su/02/env_FOO-options_--login
debian/trunk/tests/su/02/env_FOO-options_--login.exp
debian/trunk/tests/su/02/env_FOO-options_--login_bash
debian/trunk/tests/su/02/env_FOO-options_--preserve-environment
debian/trunk/tests/su/02/env_FOO-options_--preserve-environment.exp
debian/trunk/tests/su/02/env_FOO-options_--preserve-environment_bash
debian/trunk/tests/su/02/env_FOO-options_-.exp
debian/trunk/tests/su/02/env_FOO-options_-_bash
debian/trunk/tests/su/02/env_FOO-options_-l
debian/trunk/tests/su/02/env_FOO-options_-l-m
debian/trunk/tests/su/02/env_FOO-options_-l-m.exp
debian/trunk/tests/su/02/env_FOO-options_-l-m_bash
debian/trunk/tests/su/02/env_FOO-options_-l.exp
debian/trunk/tests/su/02/env_FOO-options_-l_bash
debian/trunk/tests/su/02/env_FOO-options_-m
debian/trunk/tests/su/02/env_FOO-options_-m.exp
debian/trunk/tests/su/02/env_FOO-options_-m_bash
debian/trunk/tests/su/02/env_FOO-options_-p
debian/trunk/tests/su/02/env_FOO-options_-p-
debian/trunk/tests/su/02/env_FOO-options_-p-.exp
debian/trunk/tests/su/02/env_FOO-options_-p-_bash
debian/trunk/tests/su/02/env_FOO-options_-p.exp
debian/trunk/tests/su/02/env_FOO-options_-p_bash
debian/trunk/tests/su/02/env_FOO-options_.exp
debian/trunk/tests/su/02/env_FOO-options__bash
debian/trunk/tests/su/02/env_special-options_
debian/trunk/tests/su/02/env_special-options_-l
debian/trunk/tests/su/02/env_special-options_-l-p
debian/trunk/tests/su/02/env_special-options_-l-p.exp
debian/trunk/tests/su/02/env_special-options_-l-p_bash
debian/trunk/tests/su/02/env_special-options_-l.exp
debian/trunk/tests/su/02/env_special-options_-l_bash
debian/trunk/tests/su/02/env_special-options_-p
debian/trunk/tests/su/02/env_special-options_-p.exp
debian/trunk/tests/su/02/env_special-options_-p_bash
debian/trunk/tests/su/02/env_special-options_.exp
debian/trunk/tests/su/02/env_special-options__bash
debian/trunk/tests/su/02/env_special_root-options_
debian/trunk/tests/su/02/env_special_root-options_-l
debian/trunk/tests/su/02/env_special_root-options_-l-p
debian/trunk/tests/su/02/env_special_root-options_-l-p.exp
debian/trunk/tests/su/02/env_special_root-options_-l-p_bash
debian/trunk/tests/su/02/env_special_root-options_-l.exp
debian/trunk/tests/su/02/env_special_root-options_-l_bash
debian/trunk/tests/su/02/env_special_root-options_-p
debian/trunk/tests/su/02/env_special_root-options_-p.exp
debian/trunk/tests/su/02/env_special_root-options_-p_bash
debian/trunk/tests/su/02/env_special_root-options_.exp
debian/trunk/tests/su/02/env_special_root-options__bash
debian/trunk/tests/su/02/run_env_test.sh
Removed:
debian/trunk/tests/su/02/run
debian/trunk/tests/su/02/run.exp
debian/trunk/tests/su/02/run.exp2
Log:
Split run.exp and run.exp2 in separate tests for each
options/combinations.
Added: debian/trunk/tests/su/02/env_FOO-options_
===================================================================
--- debian/trunk/tests/su/02/env_FOO-options_ (rev 0)
+++ debian/trunk/tests/su/02/env_FOO-options_ 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_FOO-options_
___________________________________________________________________
Name: svn:special
+ *
Added: debian/trunk/tests/su/02/env_FOO-options_-
===================================================================
--- debian/trunk/tests/su/02/env_FOO-options_- (rev 0)
+++ debian/trunk/tests/su/02/env_FOO-options_- 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_FOO-options_-
___________________________________________________________________
Name: svn:special
+ *
Added: debian/trunk/tests/su/02/env_FOO-options_--login
===================================================================
--- debian/trunk/tests/su/02/env_FOO-options_--login (rev 0)
+++ debian/trunk/tests/su/02/env_FOO-options_--login 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_FOO-options_--login
___________________________________________________________________
Name: svn:special
+ *
Added: debian/trunk/tests/su/02/env_FOO-options_--login.exp
===================================================================
--- debian/trunk/tests/su/02/env_FOO-options_--login.exp (rev 0)
+++ debian/trunk/tests/su/02/env_FOO-options_--login.exp 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1,48 @@
+#!/usr/bin/expect
+
+if {$argc == 1} {
+ set command [lindex $argv 0]
+} else {
+ set command ""
+}
+
+
+set timeout 2
+expect_after default {puts "\nFAIL"; exit 1}
+
+spawn /bin/bash
+expect "# "
+
+send "id\r"
+expect "uid=0(root) gid=0(root) groups=0(root)\r"
+expect "# "
+
+send "export FOO=bar\r"
+expect "# "
+
+#=============================================================================
+#
+# su --login, make a login shell
+#
+#=============================================================================
+send "/bin/su --login $command myuser\r"
+expect "$ "
+
+send "id\n"
+expect "uid=424242(myuser) gid=424242(myuser) groups=424242(myuser)\r"
+expect "$ "
+
+send_user "\n# FOO should be empty"
+send "\r"
+expect "$ "
+
+send "echo \"FOO=\\\"\$FOO\\\"\"\r"
+expect "FOO=\"\"\r"
+expect "$ "
+
+send "exit\r"
+expect "# "
+
+puts "\nPASS"
+exit 0
+
Property changes on: debian/trunk/tests/su/02/env_FOO-options_--login.exp
___________________________________________________________________
Name: svn:executable
+ *
Added: debian/trunk/tests/su/02/env_FOO-options_--login_bash
===================================================================
--- debian/trunk/tests/su/02/env_FOO-options_--login_bash (rev 0)
+++ debian/trunk/tests/su/02/env_FOO-options_--login_bash 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_FOO-options_--login_bash
___________________________________________________________________
Name: svn:special
+ *
Added: debian/trunk/tests/su/02/env_FOO-options_--preserve-environment
===================================================================
--- debian/trunk/tests/su/02/env_FOO-options_--preserve-environment (rev 0)
+++ debian/trunk/tests/su/02/env_FOO-options_--preserve-environment 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_FOO-options_--preserve-environment
___________________________________________________________________
Name: svn:special
+ *
Added: debian/trunk/tests/su/02/env_FOO-options_--preserve-environment.exp
===================================================================
--- debian/trunk/tests/su/02/env_FOO-options_--preserve-environment.exp (rev 0)
+++ debian/trunk/tests/su/02/env_FOO-options_--preserve-environment.exp 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1,48 @@
+#!/usr/bin/expect
+
+if {$argc == 1} {
+ set command [lindex $argv 0]
+} else {
+ set command ""
+}
+
+
+set timeout 2
+expect_after default {puts "\nFAIL"; exit 1}
+
+spawn /bin/bash
+expect "# "
+
+send "id\r"
+expect "uid=0(root) gid=0(root) groups=0(root)\r"
+expect "# "
+
+send "export FOO=bar\r"
+expect "# "
+
+#=============================================================================
+#
+# su --preserve-environment, as for regular su, environment is preserved
+#
+#=============================================================================
+send "/bin/su $command -m myuser\r"
+expect "$ "
+
+send "id\n"
+expect "uid=424242(myuser) gid=424242(myuser) groups=424242(myuser)\r"
+expect "$ "
+
+send_user "\n# FOO should be 'bar'"
+send "\r"
+expect "$ "
+
+send "echo \"FOO=\\\"\$FOO\\\"\"\r"
+expect "FOO=\"bar\"\r"
+expect "$ "
+
+send "exit\r"
+expect "# "
+
+puts "\nPASS"
+exit 0
+
Property changes on: debian/trunk/tests/su/02/env_FOO-options_--preserve-environment.exp
___________________________________________________________________
Name: svn:executable
+ *
Added: debian/trunk/tests/su/02/env_FOO-options_--preserve-environment_bash
===================================================================
--- debian/trunk/tests/su/02/env_FOO-options_--preserve-environment_bash (rev 0)
+++ debian/trunk/tests/su/02/env_FOO-options_--preserve-environment_bash 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_FOO-options_--preserve-environment_bash
___________________________________________________________________
Name: svn:special
+ *
Added: debian/trunk/tests/su/02/env_FOO-options_-.exp
===================================================================
--- debian/trunk/tests/su/02/env_FOO-options_-.exp (rev 0)
+++ debian/trunk/tests/su/02/env_FOO-options_-.exp 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1,48 @@
+#!/usr/bin/expect
+
+if {$argc == 1} {
+ set command [lindex $argv 0]
+} else {
+ set command ""
+}
+
+
+set timeout 2
+expect_after default {puts "\nFAIL"; exit 1}
+
+spawn /bin/bash
+expect "# "
+
+send "id\r"
+expect "uid=0(root) gid=0(root) groups=0(root)\r"
+expect "# "
+
+send "export FOO=bar\r"
+expect "# "
+
+#=============================================================================
+#
+# su -, make a login shell
+#
+#=============================================================================
+send "/bin/su - $command myuser\r"
+expect "$ "
+
+send "id\n"
+expect "uid=424242(myuser) gid=424242(myuser) groups=424242(myuser)\r"
+expect "$ "
+
+send_user "\n# FOO should be empty"
+send "\r"
+expect "$ "
+
+send "echo \"FOO=\\\"\$FOO\\\"\"\r"
+expect "FOO=\"\"\r"
+expect "$ "
+
+send "exit\r"
+expect "# "
+
+puts "\nPASS"
+exit 0
+
Property changes on: debian/trunk/tests/su/02/env_FOO-options_-.exp
___________________________________________________________________
Name: svn:executable
+ *
Added: debian/trunk/tests/su/02/env_FOO-options_-_bash
===================================================================
--- debian/trunk/tests/su/02/env_FOO-options_-_bash (rev 0)
+++ debian/trunk/tests/su/02/env_FOO-options_-_bash 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_FOO-options_-_bash
___________________________________________________________________
Name: svn:special
+ *
Added: debian/trunk/tests/su/02/env_FOO-options_-l
===================================================================
--- debian/trunk/tests/su/02/env_FOO-options_-l (rev 0)
+++ debian/trunk/tests/su/02/env_FOO-options_-l 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_FOO-options_-l
___________________________________________________________________
Name: svn:special
+ *
Added: debian/trunk/tests/su/02/env_FOO-options_-l-m
===================================================================
--- debian/trunk/tests/su/02/env_FOO-options_-l-m (rev 0)
+++ debian/trunk/tests/su/02/env_FOO-options_-l-m 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_FOO-options_-l-m
___________________________________________________________________
Name: svn:special
+ *
Added: debian/trunk/tests/su/02/env_FOO-options_-l-m.exp
===================================================================
--- debian/trunk/tests/su/02/env_FOO-options_-l-m.exp (rev 0)
+++ debian/trunk/tests/su/02/env_FOO-options_-l-m.exp 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1,48 @@
+#!/usr/bin/expect
+
+if {$argc == 1} {
+ set command [lindex $argv 0]
+} else {
+ set command ""
+}
+
+
+set timeout 2
+expect_after default {puts "\nFAIL"; exit 1}
+
+spawn /bin/bash
+expect "# "
+
+send "id\r"
+expect "uid=0(root) gid=0(root) groups=0(root)\r"
+expect "# "
+
+send "export FOO=bar\r"
+expect "# "
+
+#=============================================================================
+#
+# su -l -m, make a login shell, but preserve environment
+#
+#=============================================================================
+send "/bin/su -l -m $command myuser\r"
+expect "$ "
+
+send "id\n"
+expect "uid=424242(myuser) gid=424242(myuser) groups=424242(myuser)\r"
+expect "$ "
+
+send_user "\n# FOO should be 'bar'"
+send "\r"
+expect "$ "
+
+send "echo \"FOO=\\\"\$FOO\\\"\"\r"
+expect "FOO=\"bar\"\r"
+expect "$ "
+
+send "exit\r"
+expect "# "
+
+puts "\nPASS"
+exit 0
+
Property changes on: debian/trunk/tests/su/02/env_FOO-options_-l-m.exp
___________________________________________________________________
Name: svn:executable
+ *
Added: debian/trunk/tests/su/02/env_FOO-options_-l-m_bash
===================================================================
--- debian/trunk/tests/su/02/env_FOO-options_-l-m_bash (rev 0)
+++ debian/trunk/tests/su/02/env_FOO-options_-l-m_bash 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_FOO-options_-l-m_bash
___________________________________________________________________
Name: svn:special
+ *
Added: debian/trunk/tests/su/02/env_FOO-options_-l.exp
===================================================================
--- debian/trunk/tests/su/02/env_FOO-options_-l.exp (rev 0)
+++ debian/trunk/tests/su/02/env_FOO-options_-l.exp 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1,48 @@
+#!/usr/bin/expect
+
+if {$argc == 1} {
+ set command [lindex $argv 0]
+} else {
+ set command ""
+}
+
+
+set timeout 2
+expect_after default {puts "\nFAIL"; exit 1}
+
+spawn /bin/bash
+expect "# "
+
+send "id\r"
+expect "uid=0(root) gid=0(root) groups=0(root)\r"
+expect "# "
+
+send "export FOO=bar\r"
+expect "# "
+
+#=============================================================================
+#
+# su -l, make a login shell
+#
+#=============================================================================
+send "/bin/su - $command myuser\r"
+expect "$ "
+
+send "id\n"
+expect "uid=424242(myuser) gid=424242(myuser) groups=424242(myuser)\r"
+expect "$ "
+
+send_user "\n# FOO should be empty"
+send "\r"
+expect "$ "
+
+send "echo \"FOO=\\\"\$FOO\\\"\"\r"
+expect "FOO=\"\"\r"
+expect "$ "
+
+send "exit\r"
+expect "# "
+
+puts "\nPASS"
+exit 0
+
Property changes on: debian/trunk/tests/su/02/env_FOO-options_-l.exp
___________________________________________________________________
Name: svn:executable
+ *
Added: debian/trunk/tests/su/02/env_FOO-options_-l_bash
===================================================================
--- debian/trunk/tests/su/02/env_FOO-options_-l_bash (rev 0)
+++ debian/trunk/tests/su/02/env_FOO-options_-l_bash 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_FOO-options_-l_bash
___________________________________________________________________
Name: svn:special
+ *
Added: debian/trunk/tests/su/02/env_FOO-options_-m
===================================================================
--- debian/trunk/tests/su/02/env_FOO-options_-m (rev 0)
+++ debian/trunk/tests/su/02/env_FOO-options_-m 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_FOO-options_-m
___________________________________________________________________
Name: svn:special
+ *
Added: debian/trunk/tests/su/02/env_FOO-options_-m.exp
===================================================================
--- debian/trunk/tests/su/02/env_FOO-options_-m.exp (rev 0)
+++ debian/trunk/tests/su/02/env_FOO-options_-m.exp 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1,48 @@
+#!/usr/bin/expect
+
+if {$argc == 1} {
+ set command [lindex $argv 0]
+} else {
+ set command ""
+}
+
+
+set timeout 2
+expect_after default {puts "\nFAIL"; exit 1}
+
+spawn /bin/bash
+expect "# "
+
+send "id\r"
+expect "uid=0(root) gid=0(root) groups=0(root)\r"
+expect "# "
+
+send "export FOO=bar\r"
+expect "# "
+
+#=============================================================================
+#
+# su -m, as for regular su, environment is preserved
+#
+#=============================================================================
+send "/bin/su $command -m myuser\r"
+expect "$ "
+
+send "id\n"
+expect "uid=424242(myuser) gid=424242(myuser) groups=424242(myuser)\r"
+expect "$ "
+
+send_user "\n# FOO should be 'bar'"
+send "\r"
+expect "$ "
+
+send "echo \"FOO=\\\"\$FOO\\\"\"\r"
+expect "FOO=\"bar\"\r"
+expect "$ "
+
+send "exit\r"
+expect "# "
+
+puts "\nPASS"
+exit 0
+
Property changes on: debian/trunk/tests/su/02/env_FOO-options_-m.exp
___________________________________________________________________
Name: svn:executable
+ *
Added: debian/trunk/tests/su/02/env_FOO-options_-m_bash
===================================================================
--- debian/trunk/tests/su/02/env_FOO-options_-m_bash (rev 0)
+++ debian/trunk/tests/su/02/env_FOO-options_-m_bash 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_FOO-options_-m_bash
___________________________________________________________________
Name: svn:special
+ *
Added: debian/trunk/tests/su/02/env_FOO-options_-p
===================================================================
--- debian/trunk/tests/su/02/env_FOO-options_-p (rev 0)
+++ debian/trunk/tests/su/02/env_FOO-options_-p 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_FOO-options_-p
___________________________________________________________________
Name: svn:special
+ *
Added: debian/trunk/tests/su/02/env_FOO-options_-p-
===================================================================
--- debian/trunk/tests/su/02/env_FOO-options_-p- (rev 0)
+++ debian/trunk/tests/su/02/env_FOO-options_-p- 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_FOO-options_-p-
___________________________________________________________________
Name: svn:special
+ *
Added: debian/trunk/tests/su/02/env_FOO-options_-p-.exp
===================================================================
--- debian/trunk/tests/su/02/env_FOO-options_-p-.exp (rev 0)
+++ debian/trunk/tests/su/02/env_FOO-options_-p-.exp 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1,48 @@
+#!/usr/bin/expect
+
+if {$argc == 1} {
+ set command [lindex $argv 0]
+} else {
+ set command ""
+}
+
+
+set timeout 2
+expect_after default {puts "\nFAIL"; exit 1}
+
+spawn /bin/bash
+expect "# "
+
+send "id\r"
+expect "uid=0(root) gid=0(root) groups=0(root)\r"
+expect "# "
+
+send "export FOO=bar\r"
+expect "# "
+
+#=============================================================================
+#
+# su -p -, make a login shell, but preserve environment
+#
+#=============================================================================
+send "/bin/su -p $command - myuser\r"
+expect "$ "
+
+send "id\n"
+expect "uid=424242(myuser) gid=424242(myuser) groups=424242(myuser)\r"
+expect "$ "
+
+send_user "\n# FOO should be 'bar'"
+send "\r"
+expect "$ "
+
+send "echo \"FOO=\\\"\$FOO\\\"\"\r"
+expect "FOO=\"bar\"\r"
+expect "$ "
+
+send "exit\r"
+expect "# "
+
+puts "\nPASS"
+exit 0
+
Property changes on: debian/trunk/tests/su/02/env_FOO-options_-p-.exp
___________________________________________________________________
Name: svn:executable
+ *
Added: debian/trunk/tests/su/02/env_FOO-options_-p-_bash
===================================================================
--- debian/trunk/tests/su/02/env_FOO-options_-p-_bash (rev 0)
+++ debian/trunk/tests/su/02/env_FOO-options_-p-_bash 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_FOO-options_-p-_bash
___________________________________________________________________
Name: svn:special
+ *
Added: debian/trunk/tests/su/02/env_FOO-options_-p.exp
===================================================================
--- debian/trunk/tests/su/02/env_FOO-options_-p.exp (rev 0)
+++ debian/trunk/tests/su/02/env_FOO-options_-p.exp 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1,48 @@
+#!/usr/bin/expect
+
+if {$argc == 1} {
+ set command [lindex $argv 0]
+} else {
+ set command ""
+}
+
+
+set timeout 2
+expect_after default {puts "\nFAIL"; exit 1}
+
+spawn /bin/bash
+expect "# "
+
+send "id\r"
+expect "uid=0(root) gid=0(root) groups=0(root)\r"
+expect "# "
+
+send "export FOO=bar\r"
+expect "# "
+
+#=============================================================================
+#
+# su -m, as for regular su, environment is preserved
+#
+#=============================================================================
+send "/bin/su $command -m myuser\r"
+expect "$ "
+
+send "id\n"
+expect "uid=424242(myuser) gid=424242(myuser) groups=424242(myuser)\r"
+expect "$ "
+
+send_user "\n# FOO should be 'bar'"
+send "\r"
+expect "$ "
+
+send "echo \"FOO=\\\"\$FOO\\\"\"\r"
+expect "FOO=\"bar\"\r"
+expect "$ "
+
+send "exit\r"
+expect "# "
+
+puts "\nPASS"
+exit 0
+
Property changes on: debian/trunk/tests/su/02/env_FOO-options_-p.exp
___________________________________________________________________
Name: svn:executable
+ *
Added: debian/trunk/tests/su/02/env_FOO-options_-p_bash
===================================================================
--- debian/trunk/tests/su/02/env_FOO-options_-p_bash (rev 0)
+++ debian/trunk/tests/su/02/env_FOO-options_-p_bash 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_FOO-options_-p_bash
___________________________________________________________________
Name: svn:special
+ *
Added: debian/trunk/tests/su/02/env_FOO-options_.exp
===================================================================
--- debian/trunk/tests/su/02/env_FOO-options_.exp (rev 0)
+++ debian/trunk/tests/su/02/env_FOO-options_.exp 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1,48 @@
+#!/usr/bin/expect
+
+if {$argc == 1} {
+ set command [lindex $argv 0]
+} else {
+ set command ""
+}
+
+
+set timeout 2
+expect_after default {puts "\nFAIL"; exit 1}
+
+spawn /bin/bash
+expect "# "
+
+send "id\r"
+expect "uid=0(root) gid=0(root) groups=0(root)\r"
+expect "# "
+
+send "export FOO=bar\r"
+expect "# "
+
+#=============================================================================
+#
+# Regular su, preserve environment
+#
+#=============================================================================
+send "/bin/su myuser $command\r"
+expect "$ "
+
+send "id\n"
+expect "uid=424242(myuser) gid=424242(myuser) groups=424242(myuser)\r"
+expect "$ "
+
+send_user "\n# FOO should be 'bar'"
+send "\r"
+expect "$ "
+
+send "echo \"FOO=\\\"\$FOO\\\"\"\r"
+expect "FOO=\"bar\"\r"
+expect "$ "
+
+send "exit\r"
+expect "# "
+
+puts "\nPASS"
+exit 0
+
Property changes on: debian/trunk/tests/su/02/env_FOO-options_.exp
___________________________________________________________________
Name: svn:executable
+ *
Added: debian/trunk/tests/su/02/env_FOO-options__bash
===================================================================
--- debian/trunk/tests/su/02/env_FOO-options__bash (rev 0)
+++ debian/trunk/tests/su/02/env_FOO-options__bash 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_FOO-options__bash
___________________________________________________________________
Name: svn:special
+ *
Added: debian/trunk/tests/su/02/env_special-options_
===================================================================
--- debian/trunk/tests/su/02/env_special-options_ (rev 0)
+++ debian/trunk/tests/su/02/env_special-options_ 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_special-options_
___________________________________________________________________
Name: svn:special
+ *
Added: debian/trunk/tests/su/02/env_special-options_-l
===================================================================
--- debian/trunk/tests/su/02/env_special-options_-l (rev 0)
+++ debian/trunk/tests/su/02/env_special-options_-l 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_special-options_-l
___________________________________________________________________
Name: svn:special
+ *
Added: debian/trunk/tests/su/02/env_special-options_-l-p
===================================================================
--- debian/trunk/tests/su/02/env_special-options_-l-p (rev 0)
+++ debian/trunk/tests/su/02/env_special-options_-l-p 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_special-options_-l-p
___________________________________________________________________
Name: svn:special
+ *
Added: debian/trunk/tests/su/02/env_special-options_-l-p.exp
===================================================================
--- debian/trunk/tests/su/02/env_special-options_-l-p.exp (rev 0)
+++ debian/trunk/tests/su/02/env_special-options_-l-p.exp 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1,55 @@
+#!/usr/bin/expect
+
+if {$argc == 1} {
+ set command [lindex $argv 0]
+} else {
+ set command ""
+}
+
+
+set timeout 2
+expect_after default {puts "\nFAIL"; exit 1}
+
+spawn /bin/bash
+expect "# "
+
+send "id\r"
+expect "uid=0(root) gid=0(root) groups=0(root)\r"
+expect "# "
+
+send "export PATH=bar:\$PATH\r"
+expect "# "
+send "echo \"PATH=\\\"\$PATH\\\"\"\r"
+expect "# "
+
+#=============================================================================
+#
+# su -m -l, make a login shell, but preserve environment
+# However, PATH is not preserved, but set to what it would be with login
+#
+#=============================================================================
+send "/bin/su -p $command -l myuser\r"
+expect "$ "
+
+send "id\n"
+expect "uid=424242(myuser) gid=424242(myuser) groups=424242(myuser)\r"
+expect "$ "
+
+send_user "\n# PATH should be '/usr/local/bin:/usr/bin:/bin:/usr/games'"
+send "\r"
+expect "$ "
+
+send "echo \"PATH=\\\"\$PATH\\\"\"\r"
+expect "PATH=\"/usr/local/bin:/usr/bin:/bin:/usr/games\"\r"
+expect "$ "
+
+send "echo \"'\$HOME'\$USER'\$LOGNAME'\$SHELL'\"\r"
+expect "'/root'root'root'/bin/bash'\r"
+expect "$ "
+
+send "exit\r"
+expect "# "
+
+puts "\nPASS"
+exit 0
+
Property changes on: debian/trunk/tests/su/02/env_special-options_-l-p.exp
___________________________________________________________________
Name: svn:executable
+ *
Added: debian/trunk/tests/su/02/env_special-options_-l-p_bash
===================================================================
--- debian/trunk/tests/su/02/env_special-options_-l-p_bash (rev 0)
+++ debian/trunk/tests/su/02/env_special-options_-l-p_bash 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_special-options_-l-p_bash
___________________________________________________________________
Name: svn:special
+ *
Added: debian/trunk/tests/su/02/env_special-options_-l.exp
===================================================================
--- debian/trunk/tests/su/02/env_special-options_-l.exp (rev 0)
+++ debian/trunk/tests/su/02/env_special-options_-l.exp 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1,54 @@
+#!/usr/bin/expect
+
+if {$argc == 1} {
+ set command [lindex $argv 0]
+} else {
+ set command ""
+}
+
+
+set timeout 2
+expect_after default {puts "\nFAIL"; exit 1}
+
+spawn /bin/bash
+expect "# "
+
+send "id\r"
+expect "uid=0(root) gid=0(root) groups=0(root)\r"
+expect "# "
+
+send "export PATH=bar:\$PATH\r"
+expect "# "
+send "echo \"PATH=\\\"\$PATH\\\"\"\r"
+expect "# "
+
+#=============================================================================
+#
+# su -l, make a login shell
+#
+#=============================================================================
+send "/bin/su - $command myuser\r"
+expect "$ "
+
+send "id\n"
+expect "uid=424242(myuser) gid=424242(myuser) groups=424242(myuser)\r"
+expect "$ "
+
+send_user "\n# PATH should be '/usr/local/bin:/usr/bin:/bin:/usr/games'"
+send "\r"
+expect "$ "
+
+send "echo \"PATH=\\\"\$PATH\\\"\"\r"
+expect "PATH=\"/usr/local/bin:/usr/bin:/bin:/usr/games\"\r"
+expect "$ "
+
+send "echo \"'\$HOME'\$USER'\$LOGNAME'\$SHELL'\"\r"
+expect "'/home/'myuser'myuser'/bin/sh'\r"
+expect "$ "
+
+send "exit\r"
+expect "# "
+
+puts "\nPASS"
+exit 0
+
Property changes on: debian/trunk/tests/su/02/env_special-options_-l.exp
___________________________________________________________________
Name: svn:executable
+ *
Added: debian/trunk/tests/su/02/env_special-options_-l_bash
===================================================================
--- debian/trunk/tests/su/02/env_special-options_-l_bash (rev 0)
+++ debian/trunk/tests/su/02/env_special-options_-l_bash 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_special-options_-l_bash
___________________________________________________________________
Name: svn:special
+ *
Added: debian/trunk/tests/su/02/env_special-options_-p
===================================================================
--- debian/trunk/tests/su/02/env_special-options_-p (rev 0)
+++ debian/trunk/tests/su/02/env_special-options_-p 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_special-options_-p
___________________________________________________________________
Name: svn:special
+ *
Added: debian/trunk/tests/su/02/env_special-options_-p.exp
===================================================================
--- debian/trunk/tests/su/02/env_special-options_-p.exp (rev 0)
+++ debian/trunk/tests/su/02/env_special-options_-p.exp 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1,56 @@
+#!/usr/bin/expect
+
+if {$argc == 1} {
+ set command [lindex $argv 0]
+} else {
+ set command ""
+}
+
+
+set timeout 2
+expect_after default {puts "\nFAIL"; exit 1}
+
+spawn /bin/bash
+expect "# "
+
+send "id\r"
+expect "uid=0(root) gid=0(root) groups=0(root)\r"
+expect "# "
+
+send "export PATH=bar:\$PATH\r"
+expect "# "
+send "echo \"PATH=\\\"\$PATH\\\"\"\r"
+expect -re "PATH=\"(.*)\"\r" {set PATH $expect_out(1,string)}
+send_user "PATH='$PATH'"
+expect "# "
+
+#=============================================================================
+#
+# su -m, as for regular su, environment is preserved
+#
+#=============================================================================
+send "/bin/su $command -m myuser\r"
+expect "$ "
+
+send "id\n"
+expect "uid=424242(myuser) gid=424242(myuser) groups=424242(myuser)\r"
+expect "$ "
+
+send_user "\n# PATH should be '$PATH'"
+send "\r"
+expect "$ "
+
+send "echo \"PATH=\\\"\$PATH\\\"\"\r"
+expect "PATH=\"$PATH\"\r"
+expect "$ "
+
+send "echo \"'\$HOME'\$USER'\$LOGNAME'\$SHELL'\"\r"
+expect "'/root'root'root'/bin/bash'\r"
+expect "$ "
+
+send "exit\r"
+expect "# "
+
+puts "\nPASS"
+exit 0
+
Property changes on: debian/trunk/tests/su/02/env_special-options_-p.exp
___________________________________________________________________
Name: svn:executable
+ *
Added: debian/trunk/tests/su/02/env_special-options_-p_bash
===================================================================
--- debian/trunk/tests/su/02/env_special-options_-p_bash (rev 0)
+++ debian/trunk/tests/su/02/env_special-options_-p_bash 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_special-options_-p_bash
___________________________________________________________________
Name: svn:special
+ *
Added: debian/trunk/tests/su/02/env_special-options_.exp
===================================================================
--- debian/trunk/tests/su/02/env_special-options_.exp (rev 0)
+++ debian/trunk/tests/su/02/env_special-options_.exp 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1,55 @@
+#!/usr/bin/expect
+
+if {$argc == 1} {
+ set command [lindex $argv 0]
+} else {
+ set command ""
+}
+
+
+set timeout 2
+expect_after default {puts "\nFAIL"; exit 1}
+
+spawn /bin/bash
+expect "# "
+
+send "id\r"
+expect "uid=0(root) gid=0(root) groups=0(root)\r"
+expect "# "
+
+send "export PATH=bar:\$PATH\r"
+expect "# "
+send "echo \"PATH=\\\"\$PATH\\\"\"\r"
+expect "# "
+
+#=============================================================================
+#
+# Regular su, preserve environment
+# However, PATH is reset
+#
+#=============================================================================
+send "/bin/su myuser $command\r"
+expect "$ "
+
+send "id\n"
+expect "uid=424242(myuser) gid=424242(myuser) groups=424242(myuser)\r"
+expect "$ "
+
+send_user "\n# PATH should be '/usr/local/bin:/usr/bin:/bin:/usr/games'"
+send "\r"
+expect "$ "
+
+send "echo \"PATH=\\\"\$PATH\\\"\"\r"
+expect "PATH=\"/usr/local/bin:/usr/bin:/bin:/usr/games\"\r"
+expect "$ "
+
+send "echo \"'\$HOME'\$USER'\$LOGNAME'\$SHELL'\"\r"
+expect "'/home/'myuser'myuser'/bin/sh'\r"
+expect "$ "
+
+send "exit\r"
+expect "# "
+
+puts "\nPASS"
+exit 0
+
Property changes on: debian/trunk/tests/su/02/env_special-options_.exp
___________________________________________________________________
Name: svn:executable
+ *
Added: debian/trunk/tests/su/02/env_special-options__bash
===================================================================
--- debian/trunk/tests/su/02/env_special-options__bash (rev 0)
+++ debian/trunk/tests/su/02/env_special-options__bash 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_special-options__bash
___________________________________________________________________
Name: svn:special
+ *
Added: debian/trunk/tests/su/02/env_special_root-options_
===================================================================
--- debian/trunk/tests/su/02/env_special_root-options_ (rev 0)
+++ debian/trunk/tests/su/02/env_special_root-options_ 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_special_root-options_
___________________________________________________________________
Name: svn:special
+ *
Added: debian/trunk/tests/su/02/env_special_root-options_-l
===================================================================
--- debian/trunk/tests/su/02/env_special_root-options_-l (rev 0)
+++ debian/trunk/tests/su/02/env_special_root-options_-l 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_special_root-options_-l
___________________________________________________________________
Name: svn:special
+ *
Added: debian/trunk/tests/su/02/env_special_root-options_-l-p
===================================================================
--- debian/trunk/tests/su/02/env_special_root-options_-l-p (rev 0)
+++ debian/trunk/tests/su/02/env_special_root-options_-l-p 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_special_root-options_-l-p
___________________________________________________________________
Name: svn:special
+ *
Added: debian/trunk/tests/su/02/env_special_root-options_-l-p.exp
===================================================================
--- debian/trunk/tests/su/02/env_special_root-options_-l-p.exp (rev 0)
+++ debian/trunk/tests/su/02/env_special_root-options_-l-p.exp 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1,57 @@
+#!/usr/bin/expect
+
+if {$argc == 1} {
+ set command [lindex $argv 0]
+} else {
+ set command ""
+}
+
+
+set timeout 2
+expect_after default {puts "\nFAIL"; exit 1}
+
+spawn /bin/bash
+expect "# "
+
+send "id\r"
+expect "uid=0(root) gid=0(root) groups=0(root)\r"
+expect "# "
+
+send "export PATH=bar:\$PATH\r"
+expect "# "
+send "echo \"PATH=\\\"\$PATH\\\"\"\r"
+expect "# "
+
+#=============================================================================
+#
+# su -l -p root, make a login shell, but preserve environment
+# However, PATH is not preserved, but set to what it would be with login
+# for root
+#
+#=============================================================================
+send "/bin/su -p $command - root\r"
+expect "# "
+
+send "id\n"
+expect "uid=0(root) gid=0(root) groups=0(root)\r"
+expect "# "
+
+send_user "\n# PATH should be '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'"
+send "\r"
+expect "# "
+
+send "echo \"PATH=\\\"\$PATH\\\"\"\r"
+expect "PATH=\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\r"
+expect "# "
+
+send "echo \"'\$HOME'\$USER'\$LOGNAME'\$SHELL'\"\r"
+expect "'/root'root'root'/bin/bash'\r"
+expect "# "
+
+send "exit\r"
+expect "# "
+
+
+puts "\nPASS"
+exit 0
+
Property changes on: debian/trunk/tests/su/02/env_special_root-options_-l-p.exp
___________________________________________________________________
Name: svn:executable
+ *
Added: debian/trunk/tests/su/02/env_special_root-options_-l-p_bash
===================================================================
--- debian/trunk/tests/su/02/env_special_root-options_-l-p_bash (rev 0)
+++ debian/trunk/tests/su/02/env_special_root-options_-l-p_bash 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_special_root-options_-l-p_bash
___________________________________________________________________
Name: svn:special
+ *
Added: debian/trunk/tests/su/02/env_special_root-options_-l.exp
===================================================================
--- debian/trunk/tests/su/02/env_special_root-options_-l.exp (rev 0)
+++ debian/trunk/tests/su/02/env_special_root-options_-l.exp 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1,54 @@
+#!/usr/bin/expect
+
+if {$argc == 1} {
+ set command [lindex $argv 0]
+} else {
+ set command ""
+}
+
+
+set timeout 2
+expect_after default {puts "\nFAIL"; exit 1}
+
+spawn /bin/bash
+expect "# "
+
+send "id\r"
+expect "uid=0(root) gid=0(root) groups=0(root)\r"
+expect "# "
+
+send "export PATH=bar:\$PATH\r"
+expect "# "
+send "echo \"PATH=\\\"\$PATH\\\"\"\r"
+expect "# "
+
+#=============================================================================
+#
+# su -l root, make a login shell
+#
+#=============================================================================
+send "/bin/su $command -l root\r"
+expect "# "
+
+send "id\n"
+expect "uid=0(root) gid=0(root) groups=0(root)\r"
+expect "# "
+
+send_user "\n# PATH should be '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'"
+send "\r"
+expect "# "
+
+send "echo \"PATH=\\\"\$PATH\\\"\"\r"
+expect "PATH=\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\r"
+expect "# "
+
+send "echo \"'\$HOME'\$USER'\$LOGNAME'\$SHELL'\"\r"
+expect "'/root'root'root'/bin/bash'\r"
+expect "# "
+
+send "exit\r"
+expect "# "
+
+puts "\nPASS"
+exit 0
+
Property changes on: debian/trunk/tests/su/02/env_special_root-options_-l.exp
___________________________________________________________________
Name: svn:executable
+ *
Added: debian/trunk/tests/su/02/env_special_root-options_-l_bash
===================================================================
--- debian/trunk/tests/su/02/env_special_root-options_-l_bash (rev 0)
+++ debian/trunk/tests/su/02/env_special_root-options_-l_bash 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_special_root-options_-l_bash
___________________________________________________________________
Name: svn:special
+ *
Added: debian/trunk/tests/su/02/env_special_root-options_-p
===================================================================
--- debian/trunk/tests/su/02/env_special_root-options_-p (rev 0)
+++ debian/trunk/tests/su/02/env_special_root-options_-p 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_special_root-options_-p
___________________________________________________________________
Name: svn:special
+ *
Added: debian/trunk/tests/su/02/env_special_root-options_-p.exp
===================================================================
--- debian/trunk/tests/su/02/env_special_root-options_-p.exp (rev 0)
+++ debian/trunk/tests/su/02/env_special_root-options_-p.exp 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1,56 @@
+#!/usr/bin/expect
+
+if {$argc == 1} {
+ set command [lindex $argv 0]
+} else {
+ set command ""
+}
+
+
+set timeout 2
+expect_after default {puts "\nFAIL"; exit 1}
+
+spawn /bin/bash
+expect "# "
+
+send "id\r"
+expect "uid=0(root) gid=0(root) groups=0(root)\r"
+expect "# "
+
+send "export PATH=bar:\$PATH\r"
+expect "# "
+send "echo \"PATH=\\\"\$PATH\\\"\"\r"
+expect -re "PATH=\"(.*)\"\r" {set PATH $expect_out(1,string)}
+send_user "PATH='$PATH'"
+expect "# "
+
+#=============================================================================
+#
+# su -p root, as for regular su, environment is preserved
+#
+#=============================================================================
+send "/bin/su $command -m\r"
+expect "# "
+
+send "id\n"
+expect "uid=0(root) gid=0(root) groups=0(root)\r"
+expect "# "
+
+send_user "\n# PATH should be '$PATH'"
+send "\r"
+expect "# "
+
+send "echo \"PATH=\\\"\$PATH\\\"\"\r"
+expect "PATH=\"$PATH\"\r"
+expect "# "
+
+send "echo \"'\$HOME'\$USER'\$LOGNAME'\$SHELL'\"\r"
+expect "'/root'root'root'/bin/bash'\r"
+expect "# "
+
+send "exit\r"
+expect "# "
+
+puts "\nPASS"
+exit 0
+
Property changes on: debian/trunk/tests/su/02/env_special_root-options_-p.exp
___________________________________________________________________
Name: svn:executable
+ *
Added: debian/trunk/tests/su/02/env_special_root-options_-p_bash
===================================================================
--- debian/trunk/tests/su/02/env_special_root-options_-p_bash (rev 0)
+++ debian/trunk/tests/su/02/env_special_root-options_-p_bash 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_special_root-options_-p_bash
___________________________________________________________________
Name: svn:special
+ *
Added: debian/trunk/tests/su/02/env_special_root-options_.exp
===================================================================
--- debian/trunk/tests/su/02/env_special_root-options_.exp (rev 0)
+++ debian/trunk/tests/su/02/env_special_root-options_.exp 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1,55 @@
+#!/usr/bin/expect
+
+if {$argc == 1} {
+ set command [lindex $argv 0]
+} else {
+ set command ""
+}
+
+
+set timeout 2
+expect_after default {puts "\nFAIL"; exit 1}
+
+spawn /bin/bash
+expect "# "
+
+send "id\r"
+expect "uid=0(root) gid=0(root) groups=0(root)\r"
+expect "# "
+
+send "export PATH=bar:\$PATH\r"
+expect "# "
+send "echo \"PATH=\\\"\$PATH\\\"\"\r"
+expect "# "
+
+#=============================================================================
+#
+# Regular su to root, preserve environment
+# However, PATH is reset
+#
+#=============================================================================
+send "/bin/su $command\r"
+expect "# "
+
+send "id\n"
+expect "uid=0(root) gid=0(root) groups=0(root)\r"
+expect "# "
+
+send_user "\n# PATH should be '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'"
+send "\r"
+expect "# "
+
+send "echo \"PATH=\\\"\$PATH\\\"\"\r"
+expect "PATH=\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\r"
+expect "# "
+
+send "echo \"'\$HOME'\$USER'\$LOGNAME'\$SHELL'\"\r"
+expect "'/root'root'root'/bin/bash'\r"
+expect "# "
+
+send "exit\r"
+expect "# "
+
+puts "\nPASS"
+exit 0
+
Property changes on: debian/trunk/tests/su/02/env_special_root-options_.exp
___________________________________________________________________
Name: svn:executable
+ *
Added: debian/trunk/tests/su/02/env_special_root-options__bash
===================================================================
--- debian/trunk/tests/su/02/env_special_root-options__bash (rev 0)
+++ debian/trunk/tests/su/02/env_special_root-options__bash 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1 @@
+link run_env_test.sh
\ No newline at end of file
Property changes on: debian/trunk/tests/su/02/env_special_root-options__bash
___________________________________________________________________
Name: svn:special
+ *
Deleted: debian/trunk/tests/su/02/run
===================================================================
--- debian/trunk/tests/su/02/run 2008-01-06 20:21:47 UTC (rev 1694)
+++ debian/trunk/tests/su/02/run 2008-01-06 20:34:19 UTC (rev 1695)
@@ -1,44 +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
-./run.exp "-c bash"
-./run.exp2
-./run.exp2 "-c bash"
-
Deleted: debian/trunk/tests/su/02/run.exp
===================================================================
--- debian/trunk/tests/su/02/run.exp 2008-01-06 20:21:47 UTC (rev 1694)
+++ debian/trunk/tests/su/02/run.exp 2008-01-06 20:34:19 UTC (rev 1695)
@@ -1,103 +0,0 @@
-#!/usr/bin/expect
-
-if {$argc == 1} {
- set command [lindex $argv 0]
-} else {
- set command ""
-}
-
-
-set timeout 2
-expect_after default {puts "\nFAIL"; exit 1}
-
-spawn /bin/bash
-expect "# "
-
-send "id\r"
-expect "uid=0(root) gid=0(root) groups=0(root)\r"
-expect "# "
-
-send "export FOO=bar\r"
-expect "# "
-
-#=============================================================================
-#
-# Regular su, preserve environment
-#
-#=============================================================================
-send "/bin/su myuser $command\r"
-expect "$ "
-
-send "id\n"
-expect "uid=424242(myuser) gid=424242(myuser) groups=424242(myuser)\r"
-expect "$ "
-
-send "echo \"FOO=\\\"\$FOO\\\"\"\r"
-expect "FOO=\"bar\"\r"
-expect "$ "
-
-send "exit\r"
-expect "# "
-
-#=============================================================================
-#
-# su -, make a login shell
-#
-#=============================================================================
-send "/bin/su - $command myuser\r"
-expect "$ "
-
-send "id\n"
-expect "uid=424242(myuser) gid=424242(myuser) groups=424242(myuser)\r"
-expect "$ "
-
-send "echo \"FOO=\\\"\$FOO\\\"\"\r"
-expect "FOO=\"\"\r"
-expect "$ "
-
-send "exit\r"
-expect "# "
-
-#=============================================================================
-#
-# su -m, as for regular su, environment is preserved
-#
-#=============================================================================
-send "/bin/su $command -m myuser\r"
-expect "$ "
-
-send "id\n"
-expect "uid=424242(myuser) gid=424242(myuser) groups=424242(myuser)\r"
-expect "$ "
-
-send "echo \"FOO=\\\"\$FOO\\\"\"\r"
-expect "FOO=\"bar\"\r"
-expect "$ "
-
-send "exit\r"
-expect "# "
-
-
-#=============================================================================
-#
-# su -m -, make a login shell, but preserve environment
-#
-#=============================================================================
-send "/bin/su -p $command - myuser\r"
-expect "$ "
-
-send "id\n"
-expect "uid=424242(myuser) gid=424242(myuser) groups=424242(myuser)\r"
-expect "$ "
-
-send "echo \"FOO=\\\"\$FOO\\\"\"\r"
-expect "FOO=\"bar\"\r"
-expect "$ "
-
-send "exit\r"
-expect "# "
-
-
-puts "\nPASS"
-exit 0
-
Deleted: debian/trunk/tests/su/02/run.exp2
===================================================================
--- debian/trunk/tests/su/02/run.exp2 2008-01-06 20:21:47 UTC (rev 1694)
+++ debian/trunk/tests/su/02/run.exp2 2008-01-06 20:34:19 UTC (rev 1695)
@@ -1,168 +0,0 @@
-#!/usr/bin/expect
-
-if {$argc == 1} {
- set command [lindex $argv 0]
-} else {
- set command ""
-}
-
-
-set timeout 2
-expect_after default {puts "\nFAIL"; exit 1}
-
-spawn /bin/bash
-expect "# "
-
-send "id\r"
-expect "uid=0(root) gid=0(root) groups=0(root)\r"
-expect "# "
-
-send "export PATH=bar:\$PATH\r"
-expect "# "
-
-#=============================================================================
-#
-# Regular su, preserve environment
-# However, PATH is reset
-#
-#=============================================================================
-send "/bin/su myuser $command\r"
-expect "$ "
-
-send "id\n"
-expect "uid=424242(myuser) gid=424242(myuser) groups=424242(myuser)\r"
-expect "$ "
-
-send "echo \"PATH=\\\"\$PATH\\\"\"\r"
-expect "PATH=\"/usr/local/bin:/usr/bin:/bin:/usr/games\"\r"
-expect "$ "
-
-send "echo \"'\$HOME'\$USER'\$LOGNAME'\$SHELL'\"\r"
-expect "'/home/'myuser'myuser'/bin/sh'\r"
-expect "$ "
-
-send "exit\r"
-expect "# "
-
-#=============================================================================
-#
-# su -, make a login shell
-#
-#=============================================================================
-send "/bin/su - $command myuser\r"
-expect "$ "
-
-send "id\n"
-expect "uid=424242(myuser) gid=424242(myuser) groups=424242(myuser)\r"
-expect "$ "
-
-send "echo \"PATH=\\\"\$PATH\\\"\"\r"
-expect "PATH=\"/usr/local/bin:/usr/bin:/bin:/usr/games\"\r"
-expect "$ "
-
-send "echo \"'\$HOME'\$USER'\$LOGNAME'\$SHELL'\"\r"
-expect "'/home/'myuser'myuser'/bin/sh'\r"
-expect "$ "
-
-send "exit\r"
-expect "# "
-
-#=============================================================================
-#
-# Regular su to root, preserve environment
-# However, PATH is reset
-#
-#=============================================================================
-send "/bin/su $command\r"
-expect "# "
-
-send "id\n"
-expect "uid=0(root) gid=0(root) groups=0(root)\r"
-expect "# "
-
-send "echo \"PATH=\\\"\$PATH\\\"\"\r"
-expect "PATH=\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\r"
-expect "# "
-
-send "echo \"'\$HOME'\$USER'\$LOGNAME'\$SHELL'\"\r"
-expect "'/root'root'root'/bin/bash'\r"
-expect "# "
-
-send "exit\r"
-expect "# "
-
-#=============================================================================
-#
-# su - root, make a login shell
-#
-#=============================================================================
-send "/bin/su $command - root\r"
-expect "# "
-
-send "id\n"
-expect "uid=0(root) gid=0(root) groups=0(root)\r"
-expect "# "
-
-send "echo \"PATH=\\\"\$PATH\\\"\"\r"
-expect "PATH=\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\r"
-expect "# "
-
-send "echo \"'\$HOME'\$USER'\$LOGNAME'\$SHELL'\"\r"
-expect "'/root'root'root'/bin/bash'\r"
-expect "# "
-
-send "exit\r"
-expect "# "
-
-#=============================================================================
-#
-# su -m, as for regular su, environment is preserved
-#
-#=============================================================================
-send "/bin/su $command -m myuser\r"
-expect "$ "
-
-send "id\n"
-expect "uid=424242(myuser) gid=424242(myuser) groups=424242(myuser)\r"
-expect "$ "
-
-send "echo \"PATH=\\\"\$PATH\\\"\"\r"
-expect "PATH=\"bar:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\r"
-expect "$ "
-
-send "echo \"'\$HOME'\$USER'\$LOGNAME'\$SHELL'\"\r"
-expect "'/root'root'root'/bin/bash'\r"
-expect "$ "
-
-send "exit\r"
-expect "# "
-
-
-#=============================================================================
-#
-# su -m -, make a login shell, but preserve environment
-# However, PATH is not preserved, but set to what it would be with login
-#
-#=============================================================================
-send "/bin/su -p $command - myuser\r"
-expect "$ "
-
-send "id\n"
-expect "uid=424242(myuser) gid=424242(myuser) groups=424242(myuser)\r"
-expect "$ "
-
-send "echo \"PATH=\\\"\$PATH\\\"\"\r"
-expect "PATH=\"/usr/local/bin:/usr/bin:/bin:/usr/games\"\r"
-expect "$ "
-
-send "echo \"'\$HOME'\$USER'\$LOGNAME'\$SHELL'\"\r"
-expect "'/root'root'root'/bin/bash'\r"
-expect "$ "
-
-send "exit\r"
-expect "# "
-
-
-puts "\nPASS"
-exit 0
-
Added: debian/trunk/tests/su/02/run_env_test.sh
===================================================================
--- debian/trunk/tests/su/02/run_env_test.sh (rev 0)
+++ debian/trunk/tests/su/02/run_env_test.sh 2008-01-06 20:34:19 UTC (rev 1695)
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+set -e
+
+cd $(dirname $0)
+
+testname=$(basename $0)
+
+. ../../common/config.sh
+. ../../common/log.sh
+
+command=""
+
+case "$testname" in
+ *_bash)
+ log_start "$0" "propagation of environment variable FOO in command bash: $testname"
+ testname=$(echo "$testname" | sed -s 's/_bash$//')
+ command="-c bash"
+ echo testname: $testname
+ ;;
+ *)
+ log_start "$0" "propagation of environment variable FOO: $test"
+ ;;
+esac
+
+save_config
+
+# restore the files on exit
+trap 'log_status "$0" "FAILURE"; restore_config' 0
+
+change_config
+
+"./$testname.exp" "$command"
+
+log_status "$0" "SUCCESS"
+restore_config
+trap '' 0
+
Property changes on: debian/trunk/tests/su/02/run_env_test.sh
___________________________________________________________________
Name: svn:executable
+ *
More information about the Pkg-shadow-commits
mailing list