예제 #1
0
def pruebas_modems(test_id, XMODELO=None, XSN=None, XEMAC=None, XCMAC=None, XMTAMAC=None):
    
    if test_id == "100":    
        msg = "*REALIZANDO PRUEBA ==> ID's CHECK..." + test_id
        print msg 
        sock.sendall(msg)
        start_time = time.time()
        time.sleep(0.2)
        retID_Check = id_check(XEMAC, XCMAC, XMTAMAC, XSN)
        print retID_Check
        exe_time = time.time() - start_time
        result = test_id
        for x in range(0, len(retID_Check)):
            result += "," + retID_Check[x]
        result += "," + str(exe_time)
        time.sleep(0.3)                                        
        return (result)
    
    if test_id == "120":
        dutIP = "192.168.100.1"
        msg = "*REALIZANDO PRUEBA ==> DETECT DUT..." + test_id
        print msg 
        sock.sendall(msg)
        start_time = time.time()
        time.sleep(0.2)
        retVal = detect_dut_test(dutIP, 80, 5)
        #print retVal
        exe_time = time.time() - start_time
        exe_time = "%1.2f" % exe_time
        result = test_id
        for x in range(0, len(retVal)):
            result += "," + retVal[x]
        result += "," + str(exe_time)
        time.sleep(0.3)                                        
        return (result)
        
    if test_id == '150':
        dutIP = "192.168.100.1"
        msg = "*REALIZANDO PRUEBA ==> EXTRAER INFORMACION DE LA UNIDAD..." + test_id
        print msg 
        sock.sendall(msg)
        start_time = time.time()
        time.sleep(0.2)
        retVal = test_arris()
        #print retVal
        exe_time = time.time() - start_time
        exe_time = "%1.2f" % exe_time
        result = test_id
        for x in range(0, len(retVal)):
            result += "," + retVal[x]
        result += "," + str(exe_time)
        time.sleep(0.3)                                        
        return (result)
    
    if test_id == '160':
        msg = "*REALIZANDO PRUEBA ==> RESETEANDO UNIDAD..." + test_id
        print msg 
        sock.sendall(msg)
        start_time = time.time()
        time.sleep(0.2)
        retVal = main_seq()
        #print retVal
        exe_time = time.time() - start_time
        exe_time = "%1.2f" % exe_time
        result = test_id
        for x in range(0, len(retVal)):
            result += "," + retVal[x]
        result += "," + str(exe_time)
        time.sleep(0.3)                                        
        return (result)
    
    if test_id == "200":
        msg = "*REALIZANDO PRUEBA ==> PRUEBAS GENERALES..." + test_id
        print msg 
        sock.sendall(msg)
        start_time = time.time()
        time.sleep(0.2)
        retGeneral_Test = test_arris(XMODELO)
        print retGeneral_Test
        exe_time = time.time() - start_time
        result = test_id
        for x in range(0, len(retGeneral_Test)):
            result += "," + retGeneral_Test[x]
        result += "," + str(exe_time)
        time.sleep(0.3)
        return (result)
    
    else:
        msg = "TESTID NO RECONOCIDO..."
        print msg
        #connection.sendall(msg)
        return msg
예제 #2
0
def pruebas_modems(test_id, XSN=None, XCMMAC=None, XWANMAC=None, XSSID=None, XWPAKEY=None):
    
    if test_id == "100":    
        msg = "*REALIZANDO PRUEBA ==> ID's CHECK..." + test_id
        #print msg 
        sock.sendall(msg)
        start_time = time.time()
        time.sleep(0.2)
        retID_Check = id_check(XEMAC, XCMAC, XMTAMAC, XSN)
        #print retID_Check
        exe_time = time.time() - start_time
        result = test_id
        for x in range(0, len(retID_Check)):
            result += "," + retID_Check[x]
        result += "," + str(exe_time)
        time.sleep(0.3)                                        
        return (result)
    
    if test_id == "120":
        dutIP = "192.168.0.1"
        msg = "*REALIZANDO PRUEBA ==> DETECT DUT..." + test_id
        #print msg 
        sock.sendall(msg)
        start_time = time.time()
        time.sleep(0.2)
        retVal = detect_dut_test(dutIP, 80, 5)
        #print retVal
        exe_time = time.time() - start_time
        exe_time = "%1.2f" % exe_time
        result = test_id
        for x in range(0, len(retVal)):
            result += "," + retVal[x]
        result += "," + str(exe_time)
        time.sleep(0.3)                                        
        return (result)
        
    if test_id == '150':
        dutIP = "192.168.100.1"
        msg = "*REALIZANDO PRUEBA ==> CHECK IDs..." + test_id
        #print msg 
        sock.sendall(msg)
        start_time = time.time()
        time.sleep(0.2)
        retVal = id_check(dutIP)
        #print retVal
        exe_time = time.time() - start_time
        exe_time = "%1.2f" % exe_time
        result = test_id
        for x in range(0, len(retVal)):
            result += "," + retVal[x]
        result += "," + str(exe_time)
        time.sleep(0.3)                                        
        return (result)
    
    if test_id == "200":
        msg = "*REALIZANDO PRUEBA ==> PRUEBAS GENERALES..." + test_id
        #print msg 
        sock.sendall(msg)
        start_time = time.time()
        time.sleep(0.2)
        retGeneral_Test = test_arris(XMODELO)
        #print retGeneral_Test
        exe_time = time.time() - start_time
        exe_time = "%1.2f" % exe_time
        result = test_id
        for x in range(0, len(retGeneral_Test)):
            result += "," + retGeneral_Test[x]
        result += "," + str(exe_time)
        time.sleep(0.3)
        return (result)
    #***** EMPIEZAN PRUEBAS PARA EL MODEL PACE D5001 ********
    if test_id == '300':
        msg = "*REALIZANDO PRUEBA ==> " + test_id + " READ & VALIDATE DUT INFORMATION"
        #print msg
        sock.sendall(msg)
        start_time = time.time()
        retVal = get_dut_info_snmp(XSN, XCMMAC, XWANMAC)
        #print retVal
        exe_time = time.time() - start_time
        exe_time = "%1.2f" % exe_time
        result = test_id
        for x in range(0, len(retVal)):
            result += "," + retVal[x]
        result += "," + str(exe_time)
        time.sleep(0.3)
        return (result)
    
    if test_id == '310':
        time.sleep(0.5)
        msg = "*REALIZANDO PRUEBA ==> " + test_id + " LOGIN TO WEB INTERFACE & VALIDATE UNIT STATUS"
        #print msg
        sock.sendall(msg)
        start_time = time.time()
        retVal = get_dut_info_web(XSN, XCMMAC, XWANMAC)
        #print retVal
        exe_time = time.time() - start_time
        exe_time = "%1.2f" % exe_time
        result = test_id
        for x in range(0, len(retVal)):
            result += "," + retVal[x]
        result += "," + str(exe_time)
        time.sleep(0.3)
        return (result)
    
    if test_id == '311':
        msg = "*REALIZANDO PRUEBA ==> " + test_id + " VALIDATE ETHERNET PORT 2 FUNCTION"
        #print msg
        sock.sendall(msg)
        time.sleep(0.5)
        start_time = time.time()
        retVal = check_port_2()
        #print retVal
        exe_time = time.time() - start_time
        exe_time = "%1.2f" % exe_time
        result = test_id
        for x in range(0, len(retVal)):
            result += "," + retVal[x]
        result += "," + str(exe_time)
        time.sleep(0.3)
        return (result)
    
    if test_id == '312':
        msg = "*REALIZANDO PRUEBA ==> " + test_id + " VALIDATE ETHERNET PORT 3 FUNCTION"
        #print msg
        sock.sendall(msg)
        time.sleep(0.5)
        start_time = time.time()
        retVal = check_port_3()
        #print retVal
        exe_time = time.time() - start_time
        exe_time = "%1.2f" % exe_time
        result = test_id
        for x in range(0, len(retVal)):
            result += "," + retVal[x]
        result += "," + str(exe_time)
        time.sleep(0.3)
        return (result)
    
    if test_id == '313':
        msg = "*REALIZANDO PRUEBA ==> " + test_id + " VALIDATE ETHERNET PORT 4 FUNCTION"
        #print msg
        sock.sendall(msg)
        time.sleep(0.5)
        start_time = time.time()
        retVal = check_port_4()
        #print retVal
        exe_time = time.time() - start_time
        exe_time = "%1.2f" % exe_time
        result = test_id
        for x in range(0, len(retVal)):
            result += "," + retVal[x]
        result += "," + str(exe_time)
        time.sleep(0.3)
        return (result)
    
    if test_id == '320':
        msg = "*REALIZANDO PRUEBA ==> " + test_id + " VALIDATE MoCA FUNCTION"
        #print msg
        sock.sendall(msg)
        time.sleep(0.5)
        start_time = time.time()
        retVal = validate_moca()
        #print retVal
        exe_time = time.time() - start_time
        exe_time = "%1.2f" % exe_time
        result = test_id
        for x in range(0, len(retVal)):
            result += "," + retVal[x]
        result += "," + str(exe_time)
        time.sleep(0.3)
        return (result)
    
    if test_id == '330':
        msg = "*REALIZANDO PRUEBA ==> " + test_id + " VALIDATE USB PORTS FUNCTION"
        #print msg
        sock.sendall(msg)
        time.sleep(0.5)
        start_time = time.time()
        retVal = configure_usb()
        #print retVal
        exe_time = time.time() - start_time
        exe_time = "%1.2f" % exe_time
        result = test_id
        for x in range(0, len(retVal)):
            result += "," + retVal[x]
        result += "," + str(exe_time)
        time.sleep(0.3)
        return (result)
    
    if test_id == '340':
        msg = "*REALIZANDO PRUEBA ==> " + test_id + " CHANGE WIRELESS MODE TO 2.4GHz"
        #print msg
        sock.sendall(msg)
        time.sleep(0.5)
        start_time = time.time()
        retVal = change_to_2_4()
        #print retVal
        exe_time = time.time() - start_time
        exe_time = "%1.2f" % exe_time
        result = test_id
        for x in range(0, len(retVal)):
            result += "," + retVal[x]
        result += "," + str(exe_time)
        time.sleep(0.3)
        return (result)
    
    if test_id == '341':
        msg = "*REALIZANDO PRUEBA ==> " + test_id + " FIND SSID AND GET WIRELESS SIGNAL LEVEL FOR 2.4GHz"
        #print msg
        sock.sendall(msg)
        time.sleep(0.5)
        start_time = time.time()
        retVal = exec_get_wifi_signal(XSSID)
        #print retVal
        exe_time = time.time() - start_time
        exe_time = "%1.2f" % exe_time
        result = test_id
        for x in range(0, len(retVal)):
            result += "," + retVal[x]
        result += "," + str(exe_time)
        time.sleep(0.3)
        return (result)
    
    if test_id == '342':
        msg = "*REALIZANDO PRUEBA ==> " + test_id + " CONNECT WIRELESS CARD FOR 2.4GHz"
        #print msg
        sock.sendall(msg)
        time.sleep(0.5)
        start_time = time.time()
        retVal = exec_connect_wifi(XSSID, XWPAKEY)
        #print retVal
        exe_time = time.time() - start_time
        exe_time = "%1.2f" % exe_time
        result = test_id
        for x in range(0, len(retVal)):
            result += "," + retVal[x]
        result += "," + str(exe_time)
        time.sleep(0.3)
        return (result)
    
    if test_id == '345':
        msg = "*REALIZANDO PRUEBA ==> " + test_id + " CHANGE WIRELESS MODE TO 5GHz"
        #print msg
        sock.sendall(msg)
        time.sleep(0.5)
        start_time = time.time()
        retVal = change_to_5()
        #print retVal
        exe_time = time.time() - start_time
        exe_time = "%1.2f" % exe_time
        result = test_id
        for x in range(0, len(retVal)):
            result += "," + retVal[x]
        result += "," + str(exe_time)
        time.sleep(0.3)
        return (result)
    
    if test_id == '346':
        msg = "*REALIZANDO PRUEBA ==> " + test_id + " FIND SSID AND GET WIRELESS SIGNAL LEVEL FOR 5GHz"
        #print msg
        sock.sendall(msg)
        time.sleep(0.5)
        start_time = time.time()
        retVal = exec_get_wifi_signal(XSSID)
        #print retVal
        exe_time = time.time() - start_time
        exe_time = "%1.2f" % exe_time
        result = test_id
        for x in range(0, len(retVal)):
            result += "," + retVal[x]
        result += "," + str(exe_time)
        time.sleep(0.3)
        return (result)
    
    if test_id == '347':
        msg = "*REALIZANDO PRUEBA ==> " + test_id + " CONNECT WIRELESS CARD FOR 5GHz"
        #print msg
        sock.sendall(msg)
        time.sleep(0.5)
        start_time = time.time()
        retVal = exec_connect_wifi(XSSID, XWPAKEY)
        #print retVal
        exe_time = time.time() - start_time
        exe_time = "%1.2f" % exe_time
        result = test_id
        for x in range(0, len(retVal)):
            result += "," + retVal[x]
        result += "," + str(exe_time)
        time.sleep(0.3)
        return (result)
    
    
    
    #***** TERMINAN PRUEBAS PARA EL MODEL PACE D5001 ********
    
    else:
        msg = "TESTID NO RECONOCIDO..."
        print msg
        #connection.sendall(msg)
        return msg
예제 #3
0
def detectar_dut():
    retVal = detect_dut_test('192.168.100.1', 80, 50)
    #print retVal
    return (retVal)