diff --git a/daemon/tests/conftest.py b/daemon/tests/conftest.py index a41b99b9..4c268ce5 100644 --- a/daemon/tests/conftest.py +++ b/daemon/tests/conftest.py @@ -12,6 +12,8 @@ from core.netns import nodes from core.services import quagga from core.services import utility +EMANE_SERVICES = "zebra|OSPFv3MDR|IPForward" + class Core(object): def __init__(self, session, ip_prefix): @@ -127,6 +129,7 @@ def session(): # create and return session session_fixture = Session(1, persistent=True) + session_fixture.master = True assert os.path.exists(session_fixture.session_dir) yield session_fixture @@ -151,7 +154,7 @@ def session_emane(): utility.load_services() # set location - session_fixture.master = True + # session_fixture.master = True session_fixture.location.setrefgeo(47.57917, -122.13232, 2.00000) session_fixture.location.refscale = 150.0 diff --git a/daemon/tests/test_core.py b/daemon/tests/test_core.py index ab26042b..99ef587d 100644 --- a/daemon/tests/test_core.py +++ b/daemon/tests/test_core.py @@ -4,13 +4,14 @@ Unit tests for testing with a CORE switch. import time +from conftest import EMANE_SERVICES from core.mobility import BasicRangeModel from core.netns import nodes from core.phys.pnodes import PhysicalNode class TestCore: - def test_physical(self, core): + def skip_test_physical(self, core): """ Test physical node network. @@ -138,8 +139,8 @@ class TestCore: wlan_node.setmodel(BasicRangeModel, values) # create nodes - core.create_node("n1") - core.create_node("n2") + core.create_node("n1", services=EMANE_SERVICES, model="mdr") + core.create_node("n2", services=EMANE_SERVICES, model="mdr") # add interfaces interface_one = core.add_interface(wlan_node, "n1") @@ -175,8 +176,8 @@ class TestCore: wlan_node.setmodel(BasicRangeModel, values) # create nodes - core.create_node("n1") - core.create_node("n2") + core.create_node("n1", services=EMANE_SERVICES, model="mdr") + core.create_node("n2", services=EMANE_SERVICES, model="mdr") # add interfaces interface_one = core.add_interface(wlan_node, "n1") diff --git a/daemon/tests/test_emane.py b/daemon/tests/test_emane.py index b34da87a..819c05d3 100644 --- a/daemon/tests/test_emane.py +++ b/daemon/tests/test_emane.py @@ -1,6 +1,8 @@ """ Unit tests for testing with a CORE switch. """ +from conftest import EMANE_SERVICES + from core.data import ConfigData from core.emane.bypass import EmaneBypassModel from core.emane.commeffect import EmaneCommEffectModel @@ -8,8 +10,6 @@ from core.emane.ieee80211abg import EmaneIeee80211abgModel from core.emane.nodes import EmaneNode from core.emane.rfpipe import EmaneRfPipeModel -_EMANE_SERVICES = "zebra|OSPFv3MDR|IPForward" - class TestGui: def test_80211(self, core_emane): @@ -27,8 +27,8 @@ class TestGui: core_emane.set_emane_model(emane_node, EmaneIeee80211abgModel) # create nodes - core_emane.create_node("n1", objid=1, position=(150, 150), services=_EMANE_SERVICES, model="mdr") - core_emane.create_node("n2", objid=2, position=(300, 150), services=_EMANE_SERVICES, model="mdr") + core_emane.create_node("n1", objid=1, position=(150, 150), services=EMANE_SERVICES, model="mdr") + core_emane.create_node("n2", objid=2, position=(300, 150), services=EMANE_SERVICES, model="mdr") # add interfaces to nodes core_emane.add_interface(emane_node, "n1") @@ -59,8 +59,8 @@ class TestGui: core_emane.set_emane_model(emane_node, EmaneRfPipeModel) # create nodes - core_emane.create_node("n1", objid=1, position=(150, 150), services=_EMANE_SERVICES, model="mdr") - core_emane.create_node("n2", objid=2, position=(300, 150), services=_EMANE_SERVICES, model="mdr") + core_emane.create_node("n1", objid=1, position=(150, 150), services=EMANE_SERVICES, model="mdr") + core_emane.create_node("n2", objid=2, position=(300, 150), services=EMANE_SERVICES, model="mdr") # add interfaces to nodes core_emane.add_interface(emane_node, "n1") @@ -101,8 +101,8 @@ class TestGui: EmaneCommEffectModel.configure_emane(core_emane.session, config_data) # create nodes - core_emane.create_node("n1", objid=1, position=(150, 150), services=_EMANE_SERVICES, model="mdr") - core_emane.create_node("n2", objid=2, position=(300, 150), services=_EMANE_SERVICES, model="mdr") + core_emane.create_node("n1", objid=1, position=(150, 150), services=EMANE_SERVICES, model="mdr") + core_emane.create_node("n2", objid=2, position=(300, 150), services=EMANE_SERVICES, model="mdr") # add interfaces to nodes core_emane.add_interface(emane_node, "n1") @@ -133,8 +133,8 @@ class TestGui: core_emane.set_emane_model(emane_node, EmaneBypassModel) # create nodes - core_emane.create_node("n1", objid=1, position=(150, 150), services=_EMANE_SERVICES, model="mdr") - core_emane.create_node("n2", objid=2, position=(300, 150), services=_EMANE_SERVICES, model="mdr") + core_emane.create_node("n1", objid=1, position=(150, 150), services=EMANE_SERVICES, model="mdr") + core_emane.create_node("n2", objid=2, position=(300, 150), services=EMANE_SERVICES, model="mdr") # add interfaces to nodes core_emane.add_interface(emane_node, "n1")