def setUp(self):
    self.simulator = config.create_default_simulator()
    self.nodes = {}
    for i in range(1, 6):
        self.nodes[i] = node.Node(i, (i == MED1), simulator=self.simulator)
    self.nodes[LEADER].set_panid()
    self.nodes[LEADER].set_mode('rsdn')
    self.nodes[LEADER].add_whitelist(self.nodes[ROUTER1].get_addr64())
    self.nodes[LEADER].add_whitelist(self.nodes[DUT_ROUTER2].get_addr64())
    self.nodes[LEADER].add_whitelist(self.nodes[ROUTER3].get_addr64())
    self.nodes[LEADER].enable_whitelist()
    self.nodes[ROUTER1].set_panid()
    self.nodes[ROUTER1].set_mode('rsdn')
    self.nodes[ROUTER1].add_whitelist(self.nodes[LEADER].get_addr64())
    self.nodes[ROUTER1].enable_whitelist()
    self.nodes[ROUTER1].set_router_selection_jitter(1)
    self.nodes[DUT_ROUTER2].set_panid()
    self.nodes[DUT_ROUTER2].set_mode('rsdn')
    self.nodes[DUT_ROUTER2].add_whitelist(self.nodes[LEADER].get_addr64())
    self.nodes[DUT_ROUTER2].add_whitelist(self.nodes[ROUTER3].get_addr64())
    self.nodes[DUT_ROUTER2].add_whitelist(self.nodes[MED1].get_addr64())
    self.nodes[DUT_ROUTER2].enable_whitelist()
    self.nodes[DUT_ROUTER2].set_router_selection_jitter(1)
    self.nodes[ROUTER3].set_panid()
    self.nodes[ROUTER3].set_mode('rsdn')
    self.nodes[ROUTER3].add_whitelist(self.nodes[LEADER].get_addr64())
    self.nodes[ROUTER3].add_whitelist(self.nodes[DUT_ROUTER2].get_addr64())
    self.nodes[ROUTER3].enable_whitelist()
    self.nodes[ROUTER3].set_router_selection_jitter(1)
    self.nodes[MED1].set_panid()
    self.nodes[MED1].set_mode('rsn')
    self.nodes[MED1].add_whitelist(self.nodes[DUT_ROUTER2].get_addr64())
    self.nodes[MED1].set_timeout(MED1_TIMEOUT)
    self.nodes[MED1].enable_whitelist()
def setUp(self):
    self.simulator = config.create_default_simulator()
    self.nodes = {}
    for i in range(1, 6):
        self.nodes[i] = node.Node(i, (i == MED1), simulator=self.simulator)
    self.nodes[LEADER].set_panid()
    self.nodes[LEADER].set_mode('rsdn')
    self.nodes[LEADER].add_whitelist(self.nodes[ROUTER1].get_addr64())
    self.nodes[LEADER].add_whitelist(self.nodes[DUT_ROUTER2].get_addr64())
    self.nodes[LEADER].add_whitelist(self.nodes[ROUTER3].get_addr64())
    self.nodes[LEADER].enable_whitelist()
    self.nodes[ROUTER1].set_panid()
    self.nodes[ROUTER1].set_mode('rsdn')
    self.nodes[ROUTER1].add_whitelist(self.nodes[LEADER].get_addr64())
    self.nodes[ROUTER1].enable_whitelist()
    self.nodes[ROUTER1].set_router_selection_jitter(1)
    self.nodes[DUT_ROUTER2].set_panid()
    self.nodes[DUT_ROUTER2].set_mode('rsdn')
    self.nodes[DUT_ROUTER2].add_whitelist(self.nodes[LEADER].get_addr64())
    self.nodes[DUT_ROUTER2].add_whitelist(self.nodes[ROUTER3].get_addr64())
    self.nodes[DUT_ROUTER2].add_whitelist(self.nodes[MED1].get_addr64())
    self.nodes[DUT_ROUTER2].enable_whitelist()
    self.nodes[DUT_ROUTER2].set_router_selection_jitter(1)
    self.nodes[ROUTER3].set_panid()
    self.nodes[ROUTER3].set_mode('rsdn')
    self.nodes[ROUTER3].add_whitelist(self.nodes[LEADER].get_addr64())
    self.nodes[ROUTER3].add_whitelist(self.nodes[DUT_ROUTER2].get_addr64())
    self.nodes[ROUTER3].enable_whitelist()
    self.nodes[ROUTER3].set_router_selection_jitter(1)
    self.nodes[MED1].set_panid()
    self.nodes[MED1].set_mode('rsn')
    self.nodes[MED1].add_whitelist(self.nodes[DUT_ROUTER2].get_addr64())
    self.nodes[MED1].set_timeout(MED1_TIMEOUT)
    self.nodes[MED1].enable_whitelist()