[yast-commit] r38271 - in /trunk/core/agents-perl/testsuite: Makefile.am t-double-status.exp t-echo-sleep.exp t-echo.exp t-norun.exp t-srcmgr1.exp t-srcmgr2.exp test-common.exp
Author: mvidner Date: Mon Jun 4 16:27:08 2007 New Revision: 38271 URL: http://svn.opensuse.org/viewcvs/yast?rev=38271&view=rev Log: Factored out common setup. Distribute the stuff too. Added: trunk/core/agents-perl/testsuite/test-common.exp Modified: trunk/core/agents-perl/testsuite/Makefile.am trunk/core/agents-perl/testsuite/t-double-status.exp trunk/core/agents-perl/testsuite/t-echo-sleep.exp trunk/core/agents-perl/testsuite/t-echo.exp trunk/core/agents-perl/testsuite/t-norun.exp trunk/core/agents-perl/testsuite/t-srcmgr1.exp trunk/core/agents-perl/testsuite/t-srcmgr2.exp Modified: trunk/core/agents-perl/testsuite/Makefile.am URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/agents-perl/testsuite/Makefile.am?rev=38271&r1=38270&r2=38271&view=diff ============================================================================== --- trunk/core/agents-perl/testsuite/Makefile.am (original) +++ trunk/core/agents-perl/testsuite/Makefile.am Mon Jun 4 16:27:08 2007 @@ -7,3 +7,5 @@ t-srcmgr2.exp XFAIL_TESTS = t-srcmgr1.exp + +EXTRA_DIST = test-comon.exp $(TESTS) Modified: trunk/core/agents-perl/testsuite/t-double-status.exp URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/agents-perl/testsuite/t-double-status.exp?rev=38271&r1=38270&r2=38271&view=diff ============================================================================== --- trunk/core/agents-perl/testsuite/t-double-status.exp (original) +++ trunk/core/agents-perl/testsuite/t-double-status.exp Mon Jun 4 16:27:08 2007 @@ -1,35 +1,8 @@ #!/usr/bin/expect -- -# test ... +# try to test bug #263308 -set timeout 3 -expect_after { - default { - puts "OOPS, last matched <<$expect_out(buffer)>>" - exit 1 - } - # pass thru agent stderr -# -i $error_spawn_id -# default {send_user $expect_out(buffer)} -} - -#stty -echo - -#set prog "/usr/lib/YaST2/servers_non_y2/ag_background" -set prog "../ag_background" -puts $prog - -# does not work -#spawn "sh" "-c" "PERLDB_OPTS='NonStop=1 AutoTrace=1 frame=6' perl -dS $prog" - -# can pass -d -spawn $prog $argv - -match_max 100000 - -# TODO use a basic loop like in example and docs -# (while running, or while output open? clarify!) +source test-common.exp -# sleep: have it still running while this simple test runs send "`Execute(.run_output_err, \"echo O; echo O; sleep 1; echo OUT; echo >&2 ERR; exit 2\")\r" expect "(true)$" Modified: trunk/core/agents-perl/testsuite/t-echo-sleep.exp URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/agents-perl/testsuite/t-echo-sleep.exp?rev=38271&r1=38270&r2=38271&view=diff ============================================================================== --- trunk/core/agents-perl/testsuite/t-echo-sleep.exp (original) +++ trunk/core/agents-perl/testsuite/t-echo-sleep.exp Mon Jun 4 16:27:08 2007 @@ -1,20 +1,7 @@ -#!/usr/bin/expect -f -# test agent status before starting a process -set timeout 3 -expect_after { - default { - puts OOPS - exit 1 - } -} +#!/usr/bin/expect -- +# echo something and sleep -#stty -echo -spawn ../ag_background -match_max 100000 -expect -exact "" - -# TODO use a basic looplike in example and docs -# (while running, or while output open? clarify!) +source test-common.exp # sleep: have it still running while this simple test runs send "`Execute(.run, \"echo Hello world; sleep 2\")\r" Modified: trunk/core/agents-perl/testsuite/t-echo.exp URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/agents-perl/testsuite/t-echo.exp?rev=38271&r1=38270&r2=38271&view=diff ============================================================================== --- trunk/core/agents-perl/testsuite/t-echo.exp (original) +++ trunk/core/agents-perl/testsuite/t-echo.exp Mon Jun 4 16:27:08 2007 @@ -1,16 +1,8 @@ -#!/usr/bin/expect -f -# test agent status before starting a process -set timeout 3 -expect_after { - default { - puts OOPS - exit 1 - } -} +#!/usr/bin/expect -- +# sleep, then echo something. simlple test without a loop. + +source test-common.exp -#stty -echo -spawn ../ag_background -match_max 100000 expect -exact "" # sleep: have it still running while this simple test runs Modified: trunk/core/agents-perl/testsuite/t-norun.exp URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/agents-perl/testsuite/t-norun.exp?rev=38271&r1=38270&r2=38271&view=diff ============================================================================== --- trunk/core/agents-perl/testsuite/t-norun.exp (original) +++ trunk/core/agents-perl/testsuite/t-norun.exp Mon Jun 4 16:27:08 2007 @@ -1,16 +1,8 @@ -#!/usr/bin/expect -f +#!/usr/bin/expect -- # test agent status before starting a process -set timeout 3 -expect_after { - default { - puts OOPS - exit 1 - } -} -#stty -echo -spawn ../ag_background -match_max 100000 +source test-common.exp + expect -exact "" send "`Read(.pid)\r" Modified: trunk/core/agents-perl/testsuite/t-srcmgr1.exp URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/agents-perl/testsuite/t-srcmgr1.exp?rev=38271&r1=38270&r2=38271&view=diff ============================================================================== --- trunk/core/agents-perl/testsuite/t-srcmgr1.exp (original) +++ trunk/core/agents-perl/testsuite/t-srcmgr1.exp Mon Jun 4 16:27:08 2007 @@ -1,35 +1,9 @@ #!/usr/bin/expect -- -# test ... +# test bug #263308 +# the old agent only checks the exit status when closing a pipe, not on SIGCHLD -set timeout 3 -expect_after { - default { - puts "OOPS, last matched <<$expect_out(buffer)>>" - exit 1 - } - # pass thru agent stderr -# -i $error_spawn_id -# default {send_user $expect_out(buffer)} -} - -#stty -echo - -#set prog "/usr/lib/YaST2/servers_non_y2/ag_background" -set prog "../ag_background" -#puts $prog - -# does not work -#spawn "sh" "-c" "PERLDB_OPTS='NonStop=1 AutoTrace=1 frame=6' perl -dS $prog" - -# can pass -d -spawn $prog $argv - -match_max 100000 - -# TODO use a basic loop like in example and docs -# (while running, or while output open? clarify!) +source test-common.exp -# sleep: have it still running while this simple test runs #send "`Execute(.run_output_err, \"echo O; echo O; exec 1<&-; sleep 2; echo >&2 ERR; exit 113\")\r" send "`Execute(.run_output_err, \"echo OUT; echo OUT; echo >&2 ERR; exec 1<&- 2<&-; sleep 2; exit 113\")\r" expect "(true)$" Modified: trunk/core/agents-perl/testsuite/t-srcmgr2.exp URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/agents-perl/testsuite/t-srcmgr2.exp?rev=38271&r1=38270&r2=38271&view=diff ============================================================================== --- trunk/core/agents-perl/testsuite/t-srcmgr2.exp (original) +++ trunk/core/agents-perl/testsuite/t-srcmgr2.exp Mon Jun 4 16:27:08 2007 @@ -1,36 +1,14 @@ #!/usr/bin/expect -- # test ... -set timeout 3 -expect_after { - default { - puts "OOPS, last matched <<$expect_out(buffer)>>" - exit 1 - } - # pass thru agent stderr -# -i $error_spawn_id -# default {send_user $expect_out(buffer)} -} - -#stty -echo - -#set prog "/usr/lib/YaST2/servers_non_y2/ag_background" -set prog "../ag_background" -#puts $prog - -# does not work -#spawn "sh" "-c" "PERLDB_OPTS='NonStop=1 AutoTrace=1 frame=6' perl -dS $prog" - -# can pass -d -spawn $prog $argv - -match_max 100000 +source test-common.exp - -send "`Execute(.run_output_err, \"seq 100 199; seq 200 249 >&2; exec 1<&- 2<&-; sleep 2; exit 113\")\r" +send "`Write(.buffer_size, 10)\r"; +expect "(true)$" +send "`Write(.buffer_size_err, 10)\r"; expect "(true)$" -send "`Write(.buffer_size, 10)\r"; +send "`Execute(.run_output_err, \"seq 100 199; seq 200 249 >&2; exec 1<&- 2<&-; sleep 2; exit 113\")\r" expect "(true)$" while {1} { Added: trunk/core/agents-perl/testsuite/test-common.exp URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/agents-perl/testsuite/test-common.exp?rev=38271&view=auto ============================================================================== --- trunk/core/agents-perl/testsuite/test-common.exp (added) +++ trunk/core/agents-perl/testsuite/test-common.exp Mon Jun 4 16:27:08 2007 @@ -0,0 +1,32 @@ +# common setup for test cases of ag_backgound + +# enlarge your input buffer now! satisfaction guaranteed! give us your $$$ +match_max 100000 + +set timeout 3 +expect_after { + default { + puts "OOPS" + puts "last matched <<$expect_out(buffer)>>" + exit 1 + } + # pass thru agent stderr +# -i $error_spawn_id +# default {send_user $expect_out(buffer)} +} + +#stty -echo + +set prog "../ag_background" + +# does not work +#spawn "sh" "-c" "PERLDB_OPTS='NonStop=1 AutoTrace=1 frame=6' perl -dS $prog" + +if {[lindex $argv 0] == "-u"} { + # -u: use the old one in /usr + set prog "/usr/lib/YaST2/servers_non_y2/ag_background" + set argv [lrange $argv 1 end]; # shift +} +# can pass -d +spawn $prog $argv + -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
mvidner@svn.opensuse.org