Author: lslezak Date: Fri Dec 2 13:07:16 2011 New Revision: 66979 URL: http://svn.opensuse.org/viewcvs/yast?rev=66979&view=rev Log: - process-agent - fixed testuite (removed potential race condition) - 2.22.0 Modified: trunk/core/agent-process/testsuite/tests/stderr.ycp trunk/core/agent-process/testsuite/tests/stdout.ycp trunk/core/package/yast2-core.changes Modified: trunk/core/agent-process/testsuite/tests/stderr.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/agent-process/testsuite/tests/stderr.ycp?rev=66979&r1=66978&r2=66979&view=diff ============================================================================== --- trunk/core/agent-process/testsuite/tests/stderr.ycp (original) +++ trunk/core/agent-process/testsuite/tests/stderr.ycp Fri Dec 2 13:07:16 2011 @@ -7,15 +7,32 @@ // no output string out1 = (string)SCR::Read(.read_stderr, id); - SCR::Write(., id, "foo\n"); - sleep(250); + string in1 = "foo\n"; + SCR::Write(., id, in1); // read "foo\n" - string out2 = (string)SCR::Read(.read_stderr, id); + string out2 = ""; + while (out2 != in1) + { + string o = (string)SCR::Read(.read_stderr, id); + if (o != nil) + { + out2 = out2 + o; + } + } + + string in2 = "foo2\nfoo2\n"; + SCR::Write(., id, in2); - SCR::Write(., id, "foo2\nfoo2\n"); - sleep(250); // read "foo2\nfoo2\n" - string out3 = (string)SCR::Read(.read_stderr, id); + string out3 = ""; + while (out3 != in2) + { + string o = (string)SCR::Read(.read_stderr, id); + if (o != nil) + { + out3 = out3 + o; + } + } // no output string out4 = (string)SCR::Read(.read_stderr, id); @@ -35,22 +52,32 @@ string out1 = (string)SCR::Read(.read_line_stderr, id); SCR::Write(., id, "foo\n"); - sleep(250); // read "foo\n" - string out2 = (string)SCR::Read(.read_line_stderr, id); + string out2 = nil; + while (out2 == nil) + { + out2 = (string)SCR::Read(.read_line_stderr, id); + } SCR::Write(., id, "foo2\nfoo2\n"); - sleep(250); + // read "foo2\n" - string out3 = (string)SCR::Read(.read_line_stderr, id); + string out3 = nil; + while (out3 == nil) + { + out3 = (string)SCR::Read(.read_line_stderr, id); + } // read "foo2\n" - string out4 = (string)SCR::Read(.read_line_stderr, id); + string out4 = nil; + while (out4 == nil) + { + out4 = (string)SCR::Read(.read_line_stderr, id); + } // no output string out5 = (string)SCR::Read(.read_line_stderr, id); - // close the communication channel SCR::Execute(.close, id); while(SCR::Read(.running, id) == true) sleep(20); Modified: trunk/core/agent-process/testsuite/tests/stdout.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/agent-process/testsuite/tests/stdout.ycp?rev=66979&r1=66978&r2=66979&view=diff ============================================================================== --- trunk/core/agent-process/testsuite/tests/stdout.ycp (original) +++ trunk/core/agent-process/testsuite/tests/stdout.ycp Fri Dec 2 13:07:16 2011 @@ -7,15 +7,33 @@ // no output string out1 = (string)SCR::Read(.read, id); - SCR::Write(., id, "foo\n"); - sleep(250); + string in1 = "foo\n"; + SCR::Write(., id, in1); + // read "foo\n" - string out2 = (string)SCR::Read(.read, id); + string out2 = ""; + while (out2 != in1) + { + string o = (string)SCR::Read(.read, id); + if (o != nil) + { + out2 = out2 + o; + } + } + string in2 = "foo2\nfoo2\n"; SCR::Write(., id, "foo2\nfoo2\n"); - sleep(250); + // read "foo2\nfoo2\n" - string out3 = (string)SCR::Read(.read, id); + string out3 = ""; + while (out3 != in2) + { + string o = (string)SCR::Read(.read, id); + if (o != nil) + { + out3 = out3 + o; + } + } // no output string out4 = (string)SCR::Read(.read, id); @@ -34,22 +52,33 @@ string out1 = (string)SCR::Read(.read_line, id); SCR::Write(., id, "foo\n"); - sleep(250); + // read "foo\n" - string out2 = (string)SCR::Read(.read_line, id); + string out2 = nil; + while (out2 == nil) + { + out2 = (string)SCR::Read(.read_line, id); + } SCR::Write(., id, "foo2\nfoo2\n"); - sleep(250); + // read "foo2\n" - string out3 = (string)SCR::Read(.read_line, id); + string out3 = nil; + while (out3 == nil) + { + out3 = (string)SCR::Read(.read_line, id); + } // read "foo2\n" - string out4 = (string)SCR::Read(.read_line, id); + string out4 = nil; + while (out4 == nil) + { + out4 = (string)SCR::Read(.read_line, id); + } // no output string out5 = (string)SCR::Read(.read_line, id); - // close the communication channel SCR::Execute(.close, id); while(SCR::Read(.running, id) == true) sleep(20); Modified: trunk/core/package/yast2-core.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/package/yast2-core.changes?rev=66979&r1=66978&r2=66979&view=diff ============================================================================== --- trunk/core/package/yast2-core.changes (original) +++ trunk/core/package/yast2-core.changes Fri Dec 2 13:07:16 2011 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Fri Dec 2 11:49:56 UTC 2011 - lslezak@suse.cz + +- process-agent - fixed testuite (removed potential race condition) +- 2.22.0 + +------------------------------------------------------------------- Fri Nov 25 14:11:01 CET 2011 - mvidner@suse.cz - ini-agent: Fixed a test failure "wrong stderr for nonex" -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org