def setUp(self):
        self.nodes = {}
        for i in range(1,5):
            self.nodes[i] = node.Node(i)

        self.nodes[LEADER].set_panid(0xface)
        self.nodes[LEADER].set_mode('rsdn')
        self.nodes[LEADER].add_whitelist(self.nodes[DUT_ROUTER1].get_addr64())
        self.nodes[LEADER].add_whitelist(self.nodes[ROUTER2].get_addr64())
        self.nodes[LEADER].enable_whitelist()

        self.nodes[DUT_ROUTER1].set_panid(0xface)
        self.nodes[DUT_ROUTER1].set_mode('rsdn')
        self.nodes[DUT_ROUTER1].add_whitelist(self.nodes[LEADER].get_addr64())
        self.nodes[DUT_ROUTER1].add_whitelist(self.nodes[ROUTER2].get_addr64())
        self.nodes[DUT_ROUTER1].add_whitelist(self.nodes[ROUTER3].get_addr64())
        self.nodes[DUT_ROUTER1].enable_whitelist()
        self.nodes[DUT_ROUTER1].set_router_selection_jitter(1)

        self.nodes[ROUTER2].set_panid(0xface)
        self.nodes[ROUTER2].set_mode('rsdn')
        self.nodes[ROUTER2].add_whitelist(self.nodes[LEADER].get_addr64())
        self.nodes[ROUTER2].add_whitelist(self.nodes[DUT_ROUTER1].get_addr64())
        self.nodes[ROUTER2].enable_whitelist()
        self.nodes[ROUTER2].set_router_selection_jitter(1)

        self.nodes[ROUTER3].set_panid(0xface)
        self.nodes[ROUTER3].set_mode('rsdn')
        self.nodes[ROUTER3].add_whitelist(self.nodes[DUT_ROUTER1].get_addr64())
        self.nodes[ROUTER3].enable_whitelist()
        self.nodes[ROUTER3].set_router_selection_jitter(1)

        self.sniffer = config.create_default_thread_sniffer()
        self.sniffer.start()
    def setUp(self):
        self.nodes = {}

        self.nodes[DUT_LEADER] = node.Node(DUT_LEADER)
        self.nodes[DUT_LEADER].set_panid(0xface)
        self.nodes[DUT_LEADER].set_mode('rsdn')
        self.nodes[DUT_LEADER].enable_whitelist()
        self.nodes[DUT_LEADER].set_router_upgrade_threshold(32)
        self.nodes[DUT_LEADER].set_router_downgrade_threshold(33)

        for i in range(2, 33):
            self.nodes[i] = node.Node(i)
            self.nodes[i].set_panid(0xface)
            self.nodes[i].set_mode('rsdn')
            self.nodes[i].add_whitelist(self.nodes[DUT_LEADER].get_addr64())
            self.nodes[DUT_LEADER].add_whitelist(self.nodes[i].get_addr64())
            self.nodes[i].enable_whitelist()
            self.nodes[i].set_router_upgrade_threshold(33)
            self.nodes[i].set_router_downgrade_threshold(33)
            self.nodes[i].set_router_selection_jitter(1)

        self.nodes[ROUTER_32] = node.Node(ROUTER_32)
        self.nodes[ROUTER_32].set_panid(0xface)
        self.nodes[ROUTER_32].set_mode('rsdn')
        self.nodes[ROUTER_32].add_whitelist(self.nodes[ROUTER_1].get_addr64())
        self.nodes[ROUTER_1].add_whitelist(self.nodes[ROUTER_32].get_addr64())
        self.nodes[ROUTER_32].enable_whitelist()
        self.nodes[ROUTER_32].set_router_upgrade_threshold(33)
        self.nodes[ROUTER_32].set_router_downgrade_threshold(33)
        self.nodes[ROUTER_32].set_router_selection_jitter(1)

        self.sniffer = config.create_default_thread_sniffer(SNIFFER)
        self.sniffer.start()
Esempio n. 3
0
    def setUp(self):
        self.nodes = {}
        for i in range(1, 5):
            self.nodes[i] = node.Node(i, i == MED1)

        self.nodes[LEADER].set_panid(0xface)
        self.nodes[LEADER].set_mode('rsdn')
        self.nodes[LEADER].add_whitelist(self.nodes[DUT_ROUTER1].get_addr64())
        self.nodes[LEADER].enable_whitelist()

        self.nodes[DUT_ROUTER1].set_panid(0xface)
        self.nodes[DUT_ROUTER1].set_mode('rsdn')
        self.nodes[DUT_ROUTER1].add_whitelist(self.nodes[LEADER].get_addr64())
        self.nodes[DUT_ROUTER1].add_whitelist(self.nodes[REED1].get_addr64())
        self.nodes[DUT_ROUTER1].enable_whitelist()
        self.nodes[DUT_ROUTER1].set_router_selection_jitter(1)

        self.nodes[REED1].set_panid(0xface)
        self.nodes[REED1].set_mode('rsdn')
        self.nodes[REED1].add_whitelist(self.nodes[DUT_ROUTER1].get_addr64())
        self.nodes[REED1].add_whitelist(self.nodes[MED1].get_addr64())
        self.nodes[REED1].enable_whitelist()
        self.nodes[REED1].set_router_selection_jitter(1)
        self.nodes[REED1].set_router_upgrade_threshold(1)

        self.nodes[MED1].set_panid(0xface)
        self.nodes[MED1].set_mode('rsn')
        self.nodes[MED1].add_whitelist(self.nodes[REED1].get_addr64())
        self.nodes[MED1].enable_whitelist()

        self.sniffer = config.create_default_thread_sniffer()
        self.sniffer.start()
    def setUp(self):
        self.nodes = {}
        for i in range(1, 19):
            self.nodes[i] = node.Node(i, (i == ED1))

        self.nodes[LEADER].set_panid()
        self.nodes[LEADER].set_mode('rsdn')
        self.nodes[LEADER].enable_whitelist()

        for i in range(2, 17):
            self.nodes[i].set_panid()
            self.nodes[i].set_mode('rsdn')
            self.nodes[i].add_whitelist(self.nodes[LEADER].get_addr64())
            self.nodes[LEADER].add_whitelist(self.nodes[i].get_addr64())
            self.nodes[i].enable_whitelist()
            self.nodes[i].set_router_selection_jitter(1)

        self.nodes[ED1].set_panid()
        self.nodes[ED1].set_mode('rsn')
        self.nodes[ED1].add_whitelist(self.nodes[LEADER].get_addr64())
        self.nodes[LEADER].add_whitelist(self.nodes[ED1].get_addr64())
        self.nodes[ED1].enable_whitelist()

        self.nodes[DUT_REED].set_panid()
        self.nodes[DUT_REED].set_mode('rsdn')
        self.nodes[DUT_REED].add_whitelist(self.nodes[ROUTER1].get_addr64())
        self.nodes[ROUTER1].add_whitelist(self.nodes[DUT_REED].get_addr64())
        self.nodes[DUT_REED].enable_whitelist()
        self.nodes[DUT_REED].set_router_selection_jitter(1)

        self.sniffer = config.create_default_thread_sniffer()
        self.sniffer.start()
Esempio n. 5
0
    def setUp(self):
        self.nodes = {}

        self.nodes[DUT_LEADER] = node.Node(DUT_LEADER)
        self.nodes[DUT_LEADER].set_panid(0xface)
        self.nodes[DUT_LEADER].set_mode('rsdn')
        self.nodes[DUT_LEADER].enable_whitelist()
        self.nodes[DUT_LEADER].set_router_upgrade_threshold(32)
        self.nodes[DUT_LEADER].set_router_downgrade_threshold(33)

        for i in range(2, 33):
            self.nodes[i] = node.Node(i)
            self.nodes[i].set_panid(0xface)
            self.nodes[i].set_mode('rsdn')
            self.nodes[i].add_whitelist(self.nodes[DUT_LEADER].get_addr64())
            self.nodes[DUT_LEADER].add_whitelist(self.nodes[i].get_addr64())
            self.nodes[i].enable_whitelist()
            self.nodes[i].set_router_upgrade_threshold(33)
            self.nodes[i].set_router_downgrade_threshold(33)
            self.nodes[i].set_router_selection_jitter(1)

        self.nodes[ROUTER_32] = node.Node(ROUTER_32)
        self.nodes[ROUTER_32].set_panid(0xface)
        self.nodes[ROUTER_32].set_mode('rsdn')
        self.nodes[ROUTER_32].add_whitelist(self.nodes[ROUTER_1].get_addr64())
        self.nodes[ROUTER_1].add_whitelist(self.nodes[ROUTER_32].get_addr64())
        self.nodes[ROUTER_32].enable_whitelist()
        self.nodes[ROUTER_32].set_router_upgrade_threshold(33)
        self.nodes[ROUTER_32].set_router_downgrade_threshold(33)
        self.nodes[ROUTER_32].set_router_selection_jitter(1)

        self.sniffer = config.create_default_thread_sniffer(SNIFFER)
        self.sniffer.start()
    def setUp(self):
        self.nodes = {}
        for i in range(1, 5):
            self.nodes[i] = node.Node(i, (i in MTDS))

        self.nodes[LEADER].set_panid(0xface)
        self.nodes[LEADER].set_mode('rsdn')
        self.nodes[LEADER].add_whitelist(self.nodes[ROUTER].get_addr64())
        self.nodes[LEADER].enable_whitelist()

        self.nodes[ROUTER].set_panid(0xface)
        self.nodes[ROUTER].set_mode('rsdn')
        self.nodes[ROUTER].add_whitelist(self.nodes[LEADER].get_addr64())
        self.nodes[ROUTER].add_whitelist(self.nodes[ED].get_addr64())
        self.nodes[ROUTER].add_whitelist(self.nodes[SED].get_addr64())
        self.nodes[ROUTER].enable_whitelist()
        self.nodes[ROUTER].set_router_selection_jitter(1)

        self.nodes[ED].set_panid(0xface)
        self.nodes[ED].set_mode('rsn')
        self.nodes[ED].set_timeout(3)
        self.nodes[ED].add_whitelist(self.nodes[ROUTER].get_addr64())
        self.nodes[ED].enable_whitelist()

        self.nodes[SED].set_panid(0xface)
        self.nodes[SED].set_mode('sn')
        self.nodes[SED].set_timeout(3)
        self.nodes[SED].add_whitelist(self.nodes[ROUTER].get_addr64())
        self.nodes[SED].enable_whitelist()

        self.sniffer = config.create_default_thread_sniffer(SNIFFER)
        self.sniffer.start()
Esempio n. 7
0
    def setUp(self):
        self.nodes = {}
        for i in range(1, 4):
            self.nodes[i] = node.Node(i)

        self.nodes[LEADER].set_panid(0xface)
        self.nodes[LEADER].set_mode('rsdn')
        self.nodes[LEADER].add_whitelist(self.nodes[ROUTER1].get_addr64())
        self.nodes[LEADER].add_whitelist(self.nodes[ROUTER2].get_addr64())
        self.nodes[LEADER].enable_whitelist()

        self.nodes[ROUTER1].set_panid(0xface)
        self.nodes[ROUTER1].set_mode('rsdn')
        self.nodes[ROUTER1].add_whitelist(self.nodes[LEADER].get_addr64())
        self.nodes[ROUTER1].add_whitelist(self.nodes[ROUTER2].get_addr64())
        self.nodes[ROUTER1].enable_whitelist()
        self.nodes[ROUTER1].set_router_selection_jitter(1)

        self.nodes[ROUTER2].set_panid(0xface)
        self.nodes[ROUTER2].set_mode('rsdn')
        self.nodes[ROUTER2].add_whitelist(self.nodes[LEADER].get_addr64())
        self.nodes[ROUTER2].add_whitelist(self.nodes[ROUTER1].get_addr64())
        self.nodes[ROUTER2].enable_whitelist()
        self.nodes[ROUTER2].set_router_selection_jitter(1)

        self.sniffer = config.create_default_thread_sniffer(SNIFFER)
        self.sniffer.start()
    def setUp(self):
        self.nodes = {}
        for i in range(1, 18):
            self.nodes[i] = node.Node(i)
            self.nodes[i].set_panid(0xface)
            self.nodes[i].set_mode('rsdn')
            self.nodes[i].set_router_selection_jitter(1)

        self.sniffer = config.create_default_thread_sniffer()
        self.sniffer.start()
Esempio n. 9
0
    def setUp(self):
        self.nodes = {}
        for i in range(1, 18):
            self.nodes[i] = node.Node(i)
            self.nodes[i].set_panid(0xface)
            self.nodes[i].set_mode('rsdn')
            self.nodes[i].set_router_selection_jitter(1)

        self.sniffer = config.create_default_thread_sniffer()
        self.sniffer.start()
    def setUp(self):
        self.nodes = {}
        for i in range(1, 25):
            self.nodes[i] = node.Node(i)
            self.nodes[i].set_panid()
            self.nodes[i].set_mode('rsdn')
            self.nodes[i].set_router_selection_jitter(1)
            if i != DUT_ROUTER1:
                self.nodes[i].set_router_upgrade_threshold(32)
                self.nodes[i].set_router_downgrade_threshold(32)

        self.sniffer = config.create_default_thread_sniffer()
        self.sniffer.start()
    def setUp(self):
        self.nodes = {}
        for i in range(1, 25):
            self.nodes[i] = node.Node(i)
            self.nodes[i].set_panid()
            self.nodes[i].set_mode('rsdn')
            self.nodes[i].set_router_selection_jitter(1)
            if i != DUT_ROUTER1:
                self.nodes[i].set_router_upgrade_threshold(32)
                self.nodes[i].set_router_downgrade_threshold(32)

        self.sniffer = config.create_default_thread_sniffer()
        self.sniffer.start()
    def setUp(self):
        self.nodes = {}
        for i in range(1, 3):
            self.nodes[i] = node.Node(i)

        self.nodes[LEADER].set_panid(0xface)
        self.nodes[LEADER].set_mode('rsdn')
        self.nodes[LEADER].add_whitelist(self.nodes[ROUTER].get_addr64())
        self.nodes[LEADER].enable_whitelist()

        self.nodes[ROUTER].set_panid(0xface)
        self.nodes[ROUTER].set_mode('rsdn')
        self._setUpRouter()

        self.sniffer = config.create_default_thread_sniffer(SNIFFER)
        self.sniffer.start()
Esempio n. 13
0
    def setUp(self):
        self.nodes = {}
        for i in range(1, 3):
            self.nodes[i] = node.Node(i)

        self.nodes[LEADER].set_panid(0xface)
        self.nodes[LEADER].set_mode('rsdn')
        self.nodes[LEADER].add_whitelist(self.nodes[ED].get_addr64())
        self.nodes[LEADER].enable_whitelist()

        self.nodes[ED].set_panid(0xface)
        self.nodes[ED].set_mode('rsn')
        self.nodes[ED].add_whitelist(self.nodes[LEADER].get_addr64())
        self.nodes[ED].enable_whitelist()

        self.sniffer = config.create_default_thread_sniffer(SNIFFER)
        self.sniffer.start()
    def setUp(self):
        self.nodes = {}
        for i in range(1,7):
            self.nodes[i] = node.Node(i, (i in MTDS))

        self.nodes[DUT_LEADER].set_panid(0xface)
        self.nodes[DUT_LEADER].set_mode('rsdn')
        self.nodes[DUT_LEADER].add_whitelist(self.nodes[ROUTER1].get_addr64())
        self.nodes[DUT_LEADER].add_whitelist(self.nodes[ROUTER2].get_addr64())
        self.nodes[DUT_LEADER].add_whitelist(self.nodes[MED3].get_addr64())
        self.nodes[DUT_LEADER].enable_whitelist()

        self.nodes[ROUTER1].set_panid(0xface)
        self.nodes[ROUTER1].set_mode('rsdn')
        self.nodes[ROUTER1].add_whitelist(self.nodes[DUT_LEADER].get_addr64())
        self.nodes[ROUTER1].add_whitelist(self.nodes[MED1].get_addr64())
        self.nodes[ROUTER1].enable_whitelist()
        self.nodes[ROUTER1].set_router_selection_jitter(1)

        self.nodes[ROUTER2].set_panid(0xface)
        self.nodes[ROUTER2].set_mode('rsdn')
        self.nodes[ROUTER2].add_whitelist(self.nodes[DUT_LEADER].get_addr64())
        self.nodes[ROUTER2].add_whitelist(self.nodes[SED1].get_addr64())
        self.nodes[ROUTER2].enable_whitelist()
        self.nodes[ROUTER2].set_router_selection_jitter(1)

        self.nodes[MED1].set_panid(0xface)
        self.nodes[MED1].set_mode('rsn')
        self.nodes[MED1].add_whitelist(self.nodes[ROUTER1].get_addr64())
        self.nodes[MED1].enable_whitelist()

        self.nodes[SED1].set_panid(0xface)
        self.nodes[SED1].set_mode('s')
        self.nodes[SED1].add_whitelist(self.nodes[ROUTER2].get_addr64())
        self.nodes[SED1].enable_whitelist()

        self.nodes[MED3].set_panid(0xface)
        self.nodes[MED3].set_mode('rsn')
        self.nodes[MED3].add_whitelist(self.nodes[DUT_LEADER].get_addr64())
        self.nodes[MED3].enable_whitelist()

        self.sniffer = config.create_default_thread_sniffer()
        self.sniffer.start()
    def setUp(self):
        self.nodes = {}
        for i in range(1, 6):
            self.nodes[i] = node.Node(i, (i == MED1))

        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()

        self.sniffer = config.create_default_thread_sniffer()
        self.sniffer.start()
    def setUp(self):
        self.nodes = {}
        for i in range(1,8):
            self.nodes[i] = node.Node(i, (i in MTDS))

        self.nodes[LEADER].set_panid(0xface)
        self.nodes[LEADER].set_mode('rsdn')
        self.nodes[LEADER].add_whitelist(self.nodes[DUT_ROUTER1].get_addr64())
        self.nodes[LEADER].add_whitelist(self.nodes[ED1].get_addr64())
        self.nodes[LEADER].add_whitelist(self.nodes[ED2].get_addr64())
        self.nodes[LEADER].add_whitelist(self.nodes[ED3].get_addr64())
        self.nodes[LEADER].add_whitelist(self.nodes[ED4].get_addr64())
        self.nodes[LEADER].enable_whitelist()

        self.nodes[DUT_ROUTER1].set_panid(0xface)
        self.nodes[DUT_ROUTER1].set_mode('rsdn')
        self.nodes[DUT_ROUTER1].add_whitelist(self.nodes[LEADER].get_addr64())
        self.nodes[DUT_ROUTER1].add_whitelist(self.nodes[SED1].get_addr64())
        self.nodes[DUT_ROUTER1].enable_whitelist()
        self.nodes[DUT_ROUTER1].set_router_selection_jitter(1)

        self.nodes[SED1].set_panid(0xface)
        self.nodes[SED1].set_mode('s')
        self.nodes[SED1].add_whitelist(self.nodes[DUT_ROUTER1].get_addr64())

        # Set the SED1's timeout in order to receive the icmp reply when keep alive with DUT_ROUTER.
        self.nodes[SED1].set_timeout(5)
        self.nodes[SED1].enable_whitelist()

        for ED in [ED1, ED2, ED3, ED4]:
            self.nodes[ED].set_panid(0xface)
            self.nodes[ED].set_mode('rsn')
            self.nodes[ED].add_whitelist(self.nodes[LEADER].get_addr64())
            self.nodes[ED].enable_whitelist()

        self.sniffer = config.create_default_thread_sniffer()
        self.sniffer.start()
Esempio n. 17
0
    def setUp(self):
        self.nodes = {}
        for i in range(1, 8):
            self.nodes[i] = node.Node(i, (i in MTDS))

        self.nodes[LEADER].set_panid(0xface)
        self.nodes[LEADER].set_mode('rsdn')
        self.nodes[LEADER].add_whitelist(self.nodes[DUT_ROUTER1].get_addr64())
        self.nodes[LEADER].add_whitelist(self.nodes[ED1].get_addr64())
        self.nodes[LEADER].add_whitelist(self.nodes[ED2].get_addr64())
        self.nodes[LEADER].add_whitelist(self.nodes[ED3].get_addr64())
        self.nodes[LEADER].add_whitelist(self.nodes[ED4].get_addr64())
        self.nodes[LEADER].enable_whitelist()

        self.nodes[DUT_ROUTER1].set_panid(0xface)
        self.nodes[DUT_ROUTER1].set_mode('rsdn')
        self.nodes[DUT_ROUTER1].add_whitelist(self.nodes[LEADER].get_addr64())
        self.nodes[DUT_ROUTER1].add_whitelist(self.nodes[SED1].get_addr64())
        self.nodes[DUT_ROUTER1].enable_whitelist()
        self.nodes[DUT_ROUTER1].set_router_selection_jitter(1)

        self.nodes[SED1].set_panid(0xface)
        self.nodes[SED1].set_mode('s')
        self.nodes[SED1].add_whitelist(self.nodes[DUT_ROUTER1].get_addr64())

        # Set the SED1's timeout in order to receive the icmp reply when keep alive with DUT_ROUTER.
        self.nodes[SED1].set_timeout(5)
        self.nodes[SED1].enable_whitelist()

        for ED in [ED1, ED2, ED3, ED4]:
            self.nodes[ED].set_panid(0xface)
            self.nodes[ED].set_mode('rsn')
            self.nodes[ED].add_whitelist(self.nodes[LEADER].get_addr64())
            self.nodes[ED].enable_whitelist()

        self.sniffer = config.create_default_thread_sniffer()
        self.sniffer.start()
Esempio n. 18
0
 def __init__(self):
     self._sniffer = config.create_default_thread_sniffer()
     self._sniffer.start()
Esempio n. 19
0
 def __init__(self, use_message_factory=True):
     super(RealTime, self).__init__()
     self._sniffer = config.create_default_thread_sniffer(
         use_message_factory=use_message_factory)
     self._sniffer.start()
Esempio n. 20
0
 def __init__(self):
     super(RealTime, self).__init__()
     self._sniffer = config.create_default_thread_sniffer()
     self._sniffer.start()