mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 12:29:55 +00:00
bitbake: hashserv: Add websocket connection implementation
Adds support to the hash equivalence client and server to communicate over websockets. Since websockets are message orientated instead of stream orientated, and new connection class is needed to handle them. Note that websocket support does require the 3rd party websockets python module be installed on the host, but it should not be required unless websockets are actually being used. (Bitbake rev: 56dd2fdbfb6350a9eef43a12aa529c8637887a7e) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
8f8501ed40
commit
2484bd8931
@@ -483,3 +483,20 @@ class TestHashEquivalenceTCPServer(HashEquivalenceTestSetup, HashEquivalenceComm
|
||||
# If IPv6 is enabled, it should be safe to use localhost directly, in general
|
||||
# case it is more reliable to resolve the IP address explicitly.
|
||||
return socket.gethostbyname("localhost") + ":0"
|
||||
|
||||
|
||||
class TestHashEquivalenceWebsocketServer(HashEquivalenceTestSetup, HashEquivalenceCommonTests, unittest.TestCase):
|
||||
def setUp(self):
|
||||
try:
|
||||
import websockets
|
||||
except ImportError as e:
|
||||
self.skipTest(str(e))
|
||||
|
||||
super().setUp()
|
||||
|
||||
def get_server_addr(self, server_idx):
|
||||
# Some hosts cause asyncio module to misbehave, when IPv6 is not enabled.
|
||||
# If IPv6 is enabled, it should be safe to use localhost directly, in general
|
||||
# case it is more reliable to resolve the IP address explicitly.
|
||||
host = socket.gethostbyname("localhost")
|
||||
return "ws://%s:0" % host
|
||||
|
||||
Reference in New Issue
Block a user