added distributed tests based on new distributed, removed old distributed tests and fixture to support it

This commit is contained in:
bharnden 2019-10-24 11:52:25 -07:00
parent c255625d2f
commit dc27fadb10
3 changed files with 42 additions and 442 deletions

View file

@ -0,0 +1,39 @@
from core.emulator.emudata import NodeOptions
from core.emulator.enumerations import NodeTypes
class TestDistributed:
def test_remote_node(self, session):
# given
server_name = "core2"
host = "127.0.0.1"
# when
session.distributed.add_server(server_name, host)
options = NodeOptions()
options.server = server_name
node = session.add_node(options=options)
# then
assert node.server is not None
assert node.server.name == server_name
assert node.server.host == host
def test_remote_bridge(self, session):
# given
server_name = "core2"
host = "127.0.0.1"
session.distributed.address = host
# when
session.distributed.add_server(server_name, host)
options = NodeOptions()
options.server = server_name
node = session.add_node(_type=NodeTypes.HUB, options=options)
session.instantiate()
# then
assert node.server is not None
assert node.server.name == server_name
assert node.server.host == host
assert len(session.distributed.tunnels) > 0