-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Started refactoring #535 to allow server configuring vsock family
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |