diff options
Diffstat (limited to 'bitbake/lib/hashserv/tests.py')
-rw-r--r-- | bitbake/lib/hashserv/tests.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/bitbake/lib/hashserv/tests.py b/bitbake/lib/hashserv/tests.py index f343c586b5..01ffd52c1d 100644 --- a/bitbake/lib/hashserv/tests.py +++ b/bitbake/lib/hashserv/tests.py | |||
@@ -483,3 +483,20 @@ class TestHashEquivalenceTCPServer(HashEquivalenceTestSetup, HashEquivalenceComm | |||
483 | # If IPv6 is enabled, it should be safe to use localhost directly, in general | 483 | # If IPv6 is enabled, it should be safe to use localhost directly, in general |
484 | # case it is more reliable to resolve the IP address explicitly. | 484 | # case it is more reliable to resolve the IP address explicitly. |
485 | return socket.gethostbyname("localhost") + ":0" | 485 | return socket.gethostbyname("localhost") + ":0" |
486 | |||
487 | |||
488 | class TestHashEquivalenceWebsocketServer(HashEquivalenceTestSetup, HashEquivalenceCommonTests, unittest.TestCase): | ||
489 | def setUp(self): | ||
490 | try: | ||
491 | import websockets | ||
492 | except ImportError as e: | ||
493 | self.skipTest(str(e)) | ||
494 | |||
495 | super().setUp() | ||
496 | |||
497 | def get_server_addr(self, server_idx): | ||
498 | # Some hosts cause asyncio module to misbehave, when IPv6 is not enabled. | ||
499 | # If IPv6 is enabled, it should be safe to use localhost directly, in general | ||
500 | # case it is more reliable to resolve the IP address explicitly. | ||
501 | host = socket.gethostbyname("localhost") | ||
502 | return "ws://%s:0" % host | ||