From 9763065422b0b91daebc9db89059005fd2d7f060 Mon Sep 17 00:00:00 2001 From: comrumino Date: Sat, 17 Jun 2023 18:08:53 -0500 Subject: [PATCH] Started refactoring #535 to allow server configuring vsock family --- tests/test_vsock.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tests/test_vsock.py diff --git a/tests/test_vsock.py b/tests/test_vsock.py new file mode 100644 index 00000000..e536ed83 --- /dev/null +++ b/tests/test_vsock.py @@ -0,0 +1,30 @@ +import rpyc +import unittest +from rpyc.utils.server import ThreadedServer +from rpyc import SlaveService +import socket + + +class Test_IPv6(unittest.TestCase): + def setUp(self): + self.server = ThreadedServer(SlaveService, port=9999, family=socket.AF_VSOCK) + self.server.logger.quiet = True + self.thd = self.server._start_in_thread() + + def tearDown(self): + self.server.close() + self.thd.join() + + def test_vsock_conenction(self): + c = rpyc.classic.connect(self.server.host, port=self.server.port, family=socket.AF_VSOCK) + print(repr(c)) + print(c.modules.sys) + print(c.modules["xml.dom.minidom"].parseString("")) + c.execute("x = 5") + self.assertEqual(c.namespace["x"], 5) + self.assertEqual(c.eval("1+x"), 6) + c.close() + + +if __name__ == "__main__": + unittest.main()