def get_motes_detail(BR): b = test_helper.get_data(BR) c= [] for values_b in b: value_b = values_b.split('->') value_b = value_b[0] if value_b not in c: c.append(value_b) for mote in c: mote_ipv6 = mote print "Mote Name : %s\tMote IPv6 : %s" % (helper.get_mote(mote_ipv6),mote_ipv6)
def get_motes_detail(BR): b = test_helper.get_data(BR) c = [] for values_b in b: value_b = values_b.split('->') value_b = value_b[0] if value_b not in c: c.append(value_b) for mote in c: mote_ipv6 = mote print "Mote Name : %s\tMote IPv6 : %s" % (helper.get_mote(mote_ipv6), mote_ipv6)
def get_edges(BR, endpoint): edges = [] b = test_helper.get_data(BR, endpoint) for values_b in b: value_b = values_b.split('->') value_b[1] = value_b[1].split('::')[-1] value_b[1] = "aaaa::" + value_b[1] value_b[0] = get_mote(value_b[0]) value_b[1] = get_mote(value_b[1]) if value_b[0] == value_b[1]: values = "BR->" + value_b[0] else: values = value_b[0] + "->" + value_b[1] edges.append(values) return edges
def get_nodes(BR, endpoint): motes = [] b = test_helper.get_data(BR, endpoint) for values_b in b: value_b = values_b.split('->') value_b[1] = value_b[1].split('::')[-1] value_b[1] = "aaaa::" + value_b[1] value_b[0] = get_mote(value_b[0]) value_b[1] = get_mote(value_b[1]) motes.append(value_b[0]) motes.append(value_b[1]) unique_motes = list(set(motes)) return unique_motes
row = 1 col = 0 worksheet.set_column('B:B', 30) worksheet.write(0, 0, "Mote ID") worksheet.write(0, 1, "IPv6") worksheet.write(0, 2, "Ping Result") parser = argparse.ArgumentParser() parser.add_argument("-ip", help="Set Ip") args = parser.parse_args() if args.ip: BR = args.ip else: print "No Valid Ip Given" sys.exit(0) b = test_helper.get_data(BR, endpoint="/routes") count = 0 checking = "y" while (checking == "y"): count = 0 for values_b in b: value_b = values_b.split('->') value_b = value_b[0] if value_b not in c: count = 1 mote_name = raw_input("Mote_Name : %s : " % value_b) ping_test = test_helper.ping(value_b) worksheet.write(row, col, mote_name) worksheet.write(row, col + 1, value_b) worksheet.write(row, col + 2, ping_test)
row = 1 col = 0 worksheet.set_column('B:B', 30) worksheet.write(0, 0, "Mote ID") worksheet.write(0, 1, "IPv6") worksheet.write(0, 2, "Ping Result") parser = argparse.ArgumentParser() parser.add_argument("-ip", help="Set Ip") args = parser.parse_args() if args.ip: BR = args.ip else: print "No Valid Ip Given" sys.exit(0) b = test_helper.get_data(BR,endpoint="/routes") count = 0 checking = "y" while (checking == "y"): count = 0 for values_b in b: value_b = values_b.split('->') value_b = value_b[0] if value_b not in c: count = 1 mote_name = raw_input("Mote_Name : %s : " % value_b ) ping_test = test_helper.ping(value_b) worksheet.write(row, col, mote_name) worksheet.write(row, col + 1, value_b) worksheet.write(row, col + 2, ping_test)