Skip to content

Commit

Permalink
Started refactoring #535 to allow server configuring vsock family
Browse files Browse the repository at this point in the history
  • Loading branch information
comrumino committed Jun 17, 2023
1 parent 9632c6d commit 9763065
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/test_vsock.py
Original file line number Diff line number Diff line change
@@ -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("<a/>"))
c.execute("x = 5")
self.assertEqual(c.namespace["x"], 5)
self.assertEqual(c.eval("1+x"), 6)
c.close()


if __name__ == "__main__":
unittest.main()

0 comments on commit 9763065

Please sign in to comment.