# 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':
# 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':
# 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', ''))
Exemple #4
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
from honorRouter import Configuration

rc = Configuration()

to_log('WiFi密码错误网络配置测试\n')

if rc.wc(name='QA', pwd='12345678', secure=2):
    # 生成WiFi密码错误网络配置二维码
    wifi_mode(name='QA', pwd='waHaHa', 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'))

    if nowTimestamp[:-3] != da.get('time', 'failed')[:-3]:
        to_log('WiFi密码错误网络配置测试Pass\n')
    else:
        to_log('WiFi密码错误网络配置测试Failed\n')

rc.finished()
Exemple #5
0
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+静态IP+无打印机 WPA/WPA2 网络配置测试\n')

if rc.wc(name='QA', pwd='12345678', secure=3):
    # 生成WIFI+StaticIP网络配置二维码
    wifi_mode(name='QA',
              pwd='12345678',
              ip=data_for_networkTest.get('ip'),
              mask=data_for_networkTest.get('mask'),
              gw=data_for_networkTest.get('gw'),
              dns=data_for_networkTest.get('dns'))

    # 配网时间
    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(
Exemple #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
from honorRouter import Configuration

rc = Configuration()

to_log('WIFI设成隐藏,配置界面选择否网络配置测试\n')

if rc.wc(name='QA', pwd='12345678', secure=2, ssid=True):
    # 生成WIFI设成隐藏,配置界面选择否网络配置二维码
    wifi_mode(name='QA', pwd='12345678', ss_id=False, 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'))

    if nowTimestamp[:-3] != da.get('time', 'failed')[:-3]:
        to_log('WIFI设成隐藏,配置界面选择否网络配置测试Pass\n')
    else:
        to_log('WIFI设成隐藏,配置界面选择否网络配置测试Failed\n')

rc.finished()
Exemple #7
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(
            'time', 'failed')[:-3] == correction_time:
# 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='', secure=1):
    # 生成WiFi密码为空网络配置二维码
    wifi_mode(name='QA', pwd='', 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':