diff mbox series

[1/4] support/testing: make treq tests to ignore warning

Message ID 20190811013538.26614-1-ricardo.martincoski@gmail.com
State Accepted
Headers show
Series [1/4] support/testing: make treq tests to ignore warning | expand

Commit Message

Ricardo Martincoski Aug. 11, 2019, 1:35 a.m. UTC
Newer versions of python-treq display a warning at runtime when
service_identity is not installed:
"Without the service_identity module, Twisted can perform only
rudimentary TLS client hostname verification."

This warning message confuses the test that looks for another string in
stdout. Make the test ignore other messages while still expecting
"Connection refused".

Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/269139449
https://gitlab.com/buildroot.org/buildroot/-/jobs/269139450

Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Yegor Yefremov <yegorslists@googlemail.com>
---
https://gitlab.com/RicardoMartincoski/buildroot/-/jobs/270022950
https://gitlab.com/RicardoMartincoski/buildroot/-/jobs/270022951
---
 support/testing/tests/package/test_python_treq.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Thomas Petazzoni Aug. 11, 2019, 12:18 p.m. UTC | #1
Hello Ricardo,

On Sat, 10 Aug 2019 22:35:35 -0300
Ricardo Martincoski <ricardo.martincoski@gmail.com> wrote:

> Newer versions of python-treq display a warning at runtime when
> service_identity is not installed:
> "Without the service_identity module, Twisted can perform only
> rudimentary TLS client hostname verification."
> 
> This warning message confuses the test that looks for another string in
> stdout. Make the test ignore other messages while still expecting
> "Connection refused".
> 
> Fixes:
> https://gitlab.com/buildroot.org/buildroot/-/jobs/269139449
> https://gitlab.com/buildroot.org/buildroot/-/jobs/269139450
> 
> Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com>
> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> Cc: Yegor Yefremov <yegorslists@googlemail.com>
> ---
> https://gitlab.com/RicardoMartincoski/buildroot/-/jobs/270022950
> https://gitlab.com/RicardoMartincoski/buildroot/-/jobs/270022951
> ---
>  support/testing/tests/package/test_python_treq.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Series applied, thanks! Thanks a lot for coming back so quickly with
fixes for those runtime test issues!

Best regards,

Thomas
diff mbox series

Patch

diff --git a/support/testing/tests/package/test_python_treq.py b/support/testing/tests/package/test_python_treq.py
index 7108b95696..e24ae845be 100644
--- a/support/testing/tests/package/test_python_treq.py
+++ b/support/testing/tests/package/test_python_treq.py
@@ -7,7 +7,8 @@  class TestPythonTreq(TestPythonPackageBase):
     def run_sample_scripts(self):
         cmd = self.interpreter + " sample_python_treq.py"
         output, exit_code = self.emulator.run(cmd, timeout=20)
-        self.assertIn("Connection refused", output[0])
+        refuse_msgs = [1 for l in output if "Connection refused" in l]
+        self.assertGreater(sum(refuse_msgs), 0)
         self.assertEqual(exit_code, 0)