updated emane commeffect test to turn on default connectivity, test now passes

This commit is contained in:
Blake J. Harnden 2017-07-12 09:29:36 -07:00
parent 9934ce8d3f
commit d51e80fac8
2 changed files with 12 additions and 1 deletions

View file

@ -351,6 +351,7 @@ class Configurable(object):
typeflags = ConfigFlags.NONE.value typeflags = ConfigFlags.NONE.value
values = manager.getconfig(node_id, cls.name, defaults)[1] values = manager.getconfig(node_id, cls.name, defaults)[1]
if values is None: if values is None:
logger.warn("no active configuration for node (%s), ignoring request")
# node has no active config for this model (don't send defaults) # node has no active config for this model (don't send defaults)
return None return None
# reply with config options # reply with config options

View file

@ -1,7 +1,7 @@
""" """
Unit tests for testing with a CORE switch. Unit tests for testing with a CORE switch.
""" """
from core.data import ConfigData
from core.emane.bypass import EmaneBypassModel from core.emane.bypass import EmaneBypassModel
from core.emane.commeffect import EmaneCommEffectModel from core.emane.commeffect import EmaneCommEffectModel
from core.emane.ieee80211abg import EmaneIeee80211abgModel from core.emane.ieee80211abg import EmaneIeee80211abgModel
@ -90,6 +90,16 @@ class TestGui:
# set the emane model # set the emane model
core_emane.set_emane_model(emane_node, EmaneCommEffectModel) core_emane.set_emane_model(emane_node, EmaneCommEffectModel)
# configure emane to enable default connectivity
config_data = ConfigData(
node=emane_node.objid,
object="emane_commeffect",
type=2,
data_types=(11,),
data_values="defaultconnectivitymode=1"
)
EmaneCommEffectModel.configure_emane(core_emane.session, config_data)
# create nodes # create nodes
core_emane.create_node("n1", objid=1, position=(150, 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") core_emane.create_node("n2", objid=2, position=(300, 150), services=_EMANE_SERVICES, model="mdr")