changes to fix session adding default emane configuration

This commit is contained in:
Blake Harnden 2019-11-21 12:44:50 -08:00
parent 9445b63bd2
commit 059b0cc316
2 changed files with 12 additions and 6 deletions

View file

@ -704,10 +704,10 @@ class Session:
self.services.add_services(node, node.type, options.services) self.services.add_services(node, node.type, options.services)
# ensure default emane configuration # ensure default emane configuration
if _type == NodeTypes.EMANE: if isinstance(node, EmaneNet):
self.emane.set_model_config(_id, node.emane) self.emane.set_model_config(_id, options.emane)
# set default wlan config if needed # set default wlan config if needed
if _type == NodeTypes.WIRELESS_LAN: if isinstance(node, WlanNode):
self.mobility.set_model_config(_id, BasicRangeModel.name) self.mobility.set_model_config(_id, BasicRangeModel.name)
# boot nodes after runtime, CoreNodes, Physical, and RJ45 are all nodes # boot nodes after runtime, CoreNodes, Physical, and RJ45 are all nodes

View file

@ -692,7 +692,9 @@ class TestGrpc:
client = CoreGrpcClient() client = CoreGrpcClient()
session = grpc_server.coreemu.create_session() session = grpc_server.coreemu.create_session()
session.set_location(47.57917, -122.13232, 2.00000, 1.0) session.set_location(47.57917, -122.13232, 2.00000, 1.0)
emane_network = session.add_node(_type=NodeTypes.EMANE) options = NodeOptions()
options.emane = EmaneIeee80211abgModel.name
emane_network = session.add_node(_type=NodeTypes.EMANE, options=options)
session.emane.set_model(emane_network, EmaneIeee80211abgModel) session.emane.set_model(emane_network, EmaneIeee80211abgModel)
config_key = "platform_id_start" config_key = "platform_id_start"
config_value = "2" config_value = "2"
@ -716,7 +718,9 @@ class TestGrpc:
client = CoreGrpcClient() client = CoreGrpcClient()
session = grpc_server.coreemu.create_session() session = grpc_server.coreemu.create_session()
session.set_location(47.57917, -122.13232, 2.00000, 1.0) session.set_location(47.57917, -122.13232, 2.00000, 1.0)
emane_network = session.add_node(_type=NodeTypes.EMANE) options = NodeOptions()
options.emane = EmaneIeee80211abgModel.name
emane_network = session.add_node(_type=NodeTypes.EMANE, options=options)
session.emane.set_model(emane_network, EmaneIeee80211abgModel) session.emane.set_model(emane_network, EmaneIeee80211abgModel)
config_key = "bandwidth" config_key = "bandwidth"
config_value = "900000" config_value = "900000"
@ -742,7 +746,9 @@ class TestGrpc:
client = CoreGrpcClient() client = CoreGrpcClient()
session = grpc_server.coreemu.create_session() session = grpc_server.coreemu.create_session()
session.set_location(47.57917, -122.13232, 2.00000, 1.0) session.set_location(47.57917, -122.13232, 2.00000, 1.0)
emane_network = session.add_node(_type=NodeTypes.EMANE) options = NodeOptions()
options.emane = EmaneIeee80211abgModel.name
emane_network = session.add_node(_type=NodeTypes.EMANE, options=options)
session.emane.set_model(emane_network, EmaneIeee80211abgModel) session.emane.set_model(emane_network, EmaneIeee80211abgModel)
# then # then