[Buildroot] [git commit] support/testing: make treq tests to ignore warning

Thomas Petazzoni thomas.petazzoni at bootlin.com
Sun Aug 11 12:17:28 UTC 2019


commit: https://git.buildroot.net/buildroot/commit/?id=ef5e87bb920fb0908c16b731670aa8124c0337b6
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

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 at gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
Cc: Yegor Yefremov <yegorslists at googlemail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
---
 support/testing/tests/package/test_python_treq.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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)
 
 


More information about the buildroot mailing list