def test03_Verify_NCP_Reset(self): # Verify that prefix1 is retained by `wpantund` and pushed to NCP after a reset self.r1.reset_thread_radio() self.wait_for_completion(self.device_list) # Wait for r1 to recover after reset start_time = time.time() wait_time = 5 while not is_associated(self.r1): if time.time() - start_time > wait_time: print( "Took too long for node to recover after reset ({}>{} sec)" .format(time.time() - start_time, wait_time)) exit(1) time.sleep(0.25) # Wait for on-mesh prefix to be updated time.sleep(0.5) verify_prefix(self.all_nodes, prefix1, stable=True, on_mesh=True, slaac=True) verify_address(self.all_nodes, prefix1)
def check_child_is_reattached(self): child_stat_ncp_changes = len( wpan_table_parser.parse_list(self.child1.get("stat:ncp"))) print(child_stat_ncp_changes) verify(child_stat_ncp_changes > self.child_num_state_changes) verify(is_associated(self.child1))
def test02_verify_router2_attaches_to_router1(self): # router2 is expected to attach to router1 and adopt the mesh-local prefix from router1 verify(is_associated(self.router2)) verify( self.router2.get(wpan.WPAN_IP6_MESH_LOCAL_PREFIX) == self.router1.get(wpan.WPAN_IP6_MESH_LOCAL_PREFIX)) # Ensure that no ipv6 address starting with ML_PREFIX_2 i.e. fd00:2:: is seen verify(self.router2.find_ip6_address_with_prefix(ML_PREFIX_2) == "") # There are only 3 addresses on the router2 (link-local and mesh-local address obtained from # ML_PREFIX_1 i.e. fd00:1:: and ipv6 address added on the router2 interface) and that RLOC # address is correctly filtered (by wpantund). self.assertEqual( len( wpan_table_parser.parse_list( self.router2.get(wpan.WPAN_IP6_ALL_ADDRESSES))), 3)
def check_parent_is_associated(): verify(is_associated(self.router))
def check_router_is_associated(): verify(is_associated(self.router))
def check_r2_neighbor_table(self): verify(is_associated(self.r2)) check_neighbor_table(self.r2, [self.r1])
def check_r1_neighbor_table(self): verify(is_associated(self.r1)) check_neighbor_table(self.r1, [self.r2])
def check_parent_is_associated(): verify(is_associated(self.parent))
def check_child_is_associated(): verify(is_associated(self.child))
def check_child_is_detached(): verify(not is_associated(self.child))
def joiner3_is_associated(): verify(is_associated(self.joiner3))
def joiner1_is_associated(): verify(is_associated(self.joiner1))
def joiner2_is_associated(): verify(is_associated(self.joiner2))
def check_c2_is_associated(): verify(is_associated(self.sc2))