예제 #1
0
# coding=utf-8
import time
from to_log import to_log
from honorRouter import Configuration

rc = Configuration()

count = 0
while True:
    count += 1
    to_log('第' + str(count) + '断网')
    # 重新登录路由器管理后台
    rc.re_login()
    # 断网:通过改变路由器密码
    rc.wc(name='QA', pwd='123456789', secure=2)
    # 断网后等待1min
    time.sleep(60)

    # 重新登录路由器管理后台
    rc.re_login()
    rc.wc(name='QA', pwd='12345678', secure=2)
    # 网络恢复后等待1min
    time.sleep(60)

    if count == 2160:
        break

예제 #2
0
# coding=utf-8
import time
from to_log import to_log
from QRCodeOfNetworkConfig import wifi_mode
from dmSupport import get_device_attribute
from configFile import data_for_networkTest, open_picture
from honorRouter import Configuration

rc = Configuration()

to_log('WIFI+DHCP+USB打印网络配置测试\n')

if rc.wc(name='QA', pwd='12345678', secure=2):
    # 生成WIFI+DHCP+USB网络配置二维码
    wifi_mode(name='QA', pwd='12345678', pr='usb', dh='dhcp')

    # 配网时间
    time.sleep(10)

    # 获取系统当前时间
    nowTimestamp = time.strftime('%Y-%m-%d %H-%M-%S',
                                 time.localtime(time.time()))
    # 获取设备属性
    da = get_device_attribute(data_for_networkTest.get('deviceNo'))
    # 修正时间
    correction_time = nowTimestamp[:-4] + str(int(nowTimestamp[-4]) + 1)

    if da.get('time', 'failed')[:-3] == nowTimestamp[:-3] or da.get(
            'time', 'failed')[:-3] == correction_time:
        if da.get('persist.net.type') == 'wifi' and da.get(
                'persist.net.dhcp') == 'true':
예제 #3
0
# coding=utf-8
import time
from to_log import to_log
from QRCodeOfNetworkConfig import wifi_mode
from dmSupport import get_device_attribute
from configFile import data_for_networkTest, open_picture
from honorRouter import Configuration

rc = Configuration()

to_log('SSID长度32/密码长度63网络配置测试\n')

if rc.wc(name='123a'*8, pwd='12'*30 + 'abc', secure=2):
    # 生成SSID长度32/密码长度63网络配置二维码
    wifi_mode(name='123a'*8, pwd='12'*30 + 'abc', pr='usb', dh='dhcp')

    # 配网时间
    time.sleep(15)

    # 获取系统当前时间
    nowTimestamp = time.strftime('%Y-%m-%d %H-%M-%S', time.localtime(time.time()))
    # 获取设备属性
    da = get_device_attribute(data_for_networkTest.get('deviceNo'))
    # 修正时间
    correction_time = nowTimestamp[:-4] + str(int(nowTimestamp[-4]) + 1)

    if da.get('time', 'failed')[:-3] == nowTimestamp[:-3] or da.get('time', 'failed')[:-3] == correction_time:
        if da.get('persist.net.type') == 'wifi' and da.get('persist.net.dhcp') == 'true':
            to_log('SSID长度32/密码长度63网络配置测试Pass\n')
            to_log('配网方式:'+da.get('persist.net.type', ''))
            to_log('DHCP:' + da.get('persist.net.dhcp', ''))
# coding=utf-8
import time
import json
import requests
from send_email import send_email
from sign import jm
from to_log import to_log
from honorRouter import Configuration

rc = Configuration()
data = [
    '4113180400129095', '4113180400129061', '4113180400129091',
    '4113180400129081', '4113180400129059', '4113180400131015',
    '4113180400130996', '4113171200100030', '4113180400129063'
]


# 设备连接状态接口
def device_connect_status(device_no):
    body = {
        "device_no": device_no,
        "nonce_str": "232323",
        "token": "1c7c54925f153eaaa12758d70af17d2",
    }
    body['sign'] = jm(body, '12345')
    res = requests.post(
        url='http://common-api.2dupay.com/api/getDevice/v1.0/connectStatus',
        json=body)

    temp = json.loads(res.text)
# coding=utf-8
import time
from to_log import to_log
from QRCodeOfNetworkConfig import wifi_mode
from dmSupport import get_device_attribute
from configFile import data_for_networkTest
from honorRouter import Configuration

rc = Configuration()

to_log('隐藏WIFI密码为空网络配置测试\n')

if rc.wc(name='QA', pwd='', ssid=True, secure=1):
    # 生成WiFi密码为空网络配置二维码
    wifi_mode(name='QA', pwd='', ss_id=True, dh='dhcp')

    # 配网时间
    time.sleep(15)

    # 获取系统当前时间
    nowTimestamp = time.strftime('%Y-%m-%d %H-%M-%S',
                                 time.localtime(time.time()))
    # 获取设备属性
    da = get_device_attribute(data_for_networkTest.get('deviceNo'))
    # 修正时间
    correction_time = nowTimestamp[:-4] + str(int(nowTimestamp[-4]) + 1)

    if da.get('time', 'failed')[:-3] == nowTimestamp[:-3] or da.get(
            'time', 'failed')[:-3] == correction_time:
        if da.get('persist.net.type') == 'wifi' and da.get(
                'persist.net.wifihide') == '1':
예제 #6
0
# coding=utf-8
import time
from to_log import to_log
from QRCodeOfNetworkConfig import wifi_mode
from dmSupport import get_device_attribute
from configFile import data_for_networkTest, open_picture
from honorRouter import Configuration

rc = Configuration()

to_log('WiFi含中文、特殊字符、空格网络配置测试\n')

if rc.wc(name='孙 _!@#$%sunnana', pwd='!_@#$%+4sunnana', secure=2):
    # 生成WiFi含中文、特殊字符、空格网络配置二维码
    wifi_mode(name='孙 _!@#$%sunnana',
              pwd='!_@#$%+4sunnana',
              pr='usb',
              dh='dhcp')

    # 配网时间
    time.sleep(15)

    # 获取系统当前时间
    nowTimestamp = time.strftime('%Y-%m-%d %H-%M-%S',
                                 time.localtime(time.time()))
    # 获取设备属性
    da = get_device_attribute(data_for_networkTest.get('deviceNo'))
    # 修正时间
    correction_time = nowTimestamp[:-4] + str(int(nowTimestamp[-4]) + 1)

    if da.get('time', 'failed')[:-3] == nowTimestamp[:-3] or da.get(