def check_port_4(ipcont=None):
    if ipcont is None or not ipcont:
        ipcont = "10.0.3.104"
        
    cmd = "python login_to_web.py"
    retVal = cmd_execute_command(ipcont, "ubuntu", "ubuntu", cmd)
    #print retVal
    if retVal[0] == 'P':
        return (retVal[3])
    else:
        return (retVal)
示例#2
0
def exec_get_wifi_signal(ssid, ipcont=None, ifname=None):
    if ipcont is None or not ipcont:
        ipcont = "10.0.3.110"
    if ifname is None or not ifname:
        ifname = 'wlan0'
        
    cmd = "python get_wireless_signal.py -d " + ssid + " -f " + ifname
    retVal = cmd_execute_command(ipcont, "ubuntu", "ubuntu", cmd)
    #print retVal
    if retVal[0] == 'P':
        return (retVal[1])
    else:
        return (retVal)
def exec_connect_wifi(ssid, wpa_key, ipcont=None, ifname=None):
    if ipcont is None or not ipcont:
        ipcont = "10.0.3.110"
    if ifname is None or not ifname:
        ifname = 'wlan0'
        
    cmd = "python conectar_wifi.py -s " + ssid + " -k " + wpa_key
    retVal = cmd_execute_command(ipcont, "ubuntu", "ubuntu", cmd)
    #print retVal
    if retVal[0] == 'P':
        return (retVal[3])
    else:
        return (retVal)
def validate_moca():
    result = ''
    error = ''
    msg = ''
    retVal = configure_moca()
    #print retVal
    if retVal[0] == 'F':
        result = 'F'
        error = '520'
        msg = retVal[2]
        return (result, error, msg)
    
    dut_ip = '192.168.0.1'
    ipcont = "10.0.3.111"
    cmd = "python detect_dut.py -i " + dut_ip
    retVal = cmd_execute_command(ipcont, "ubuntu", "ubuntu", cmd)
    #print retVal
    if retVal[0] == 'P':
        return (retVal[3])
    else:
        return (retVal)