Exemple #1
0
def start_up_net_if(net_if=[]):
    #cmd = []
    for x in net_if:
        cmd_str = "sudo ifconfig " + x + " up"
        util_lib.system_call_return(cmd_str)
        #cmd.append(cmd_str)
    return True
Exemple #2
0
def start_if_serial_to_net(self):
    success, list = serial_io.get_serial_list()
    if success:
        #self.assertTrue(success)
        cmd = "slattach " + list.replace('\n', '').replace('\r', '') + \
            " -p slip -s 115200 &"
        success = util_lib.system_call_return(cmd)
        self.assertTrue(success)
        time.sleep(1)
        return True
    return False
Exemple #3
0
def setup_ipv4_ip(net_if="", addr="", prefix=""):
    cmd = "sudo ifconfig " + net_if + " " + addr + "/" + prefix
    return util_lib.system_call_return(cmd)
Exemple #4
0
def stop_if_serial_to_net(self):
    cmd = "sudo kill -9 $(ps -ef | grep slattach | " + \
        "grep -v grep | awk '{print $2}')"
    return util_lib.system_call_return(cmd)
Exemple #5
0
def ipv6_cmd_ping(net_if="", ip_addr=""):
    cmd = "ping6 -I " + net_if + " " + ip_addr + \
" -c " + str(_g_ping_packet_number)
    return util_lib.system_call_return(cmd)