有关一块没有没有屏的产品测试记录

公司有一块没有屏幕的产品,网页测试的那种在时间上已经来不及了而且个人比较偏向底层,上层基本上没有任何经验。

所以写了一个在串口下测试的计划。

  • 条件1: 两个网口不能在同一个子网下,不能两个产品网口两个同时对连,必须有一个网口经过路由器转接一下数据。

  • 条件2: 六个串口要同时发送和接收数据,但是 x86 的PC机又很少有6个串口的,所以只能通过两个产品的六个串口相互连接进行测试,这样两个产品同时测试的时间理论上来说要比一块一块测更快,(但是也可以考虑做成串口一和串口二进行对测,做出相对应的测试工具即可。)

  • 条件3: 一般晓得路由器有5个网口左右,如果两台产品对测试的话可以同时测两组,所以其中一个要接在路由器上的网口要设置不同的IP。

  • 条件4: 两个产品对测,其中一个网口直接对连。那个两台产品的IP又要同一网段不同地址,并预设了 192.168.2.10 IP, 那么只要改其中一个即可。

  • 串口测试请参考: https://github.com/Aplexchenfl/tty_test

  • 初始化IP及 测试方法请参考:

    #!/bin/sh

    if [ $1 = "1" ]; then
        ifconfig eth1 192.168.20.10
        sleep 5
        echo "set ip over"
        ping 192.168.2.11  -c 50
        ping 192.168.20.11  -c 50
        echo "test network over .... 

"
    elif [ $1 = "2" ]; then
        ifconfig eth0 192.168.2.11
        ifconfig eth1 192.168.20.11
        sleep 5
        echo "set ip over"
        ping 192.168.2.10  -c 50
        ping 192.168.20.10  -c 50
        echo "test network over .... 

"
    elif [ $1 = "3" ]; then
        ifconfig eth1 192.168.20.12
        sleep 5
        echo "set ip over"
        ping 192.168.2.11  -c 50
        ping 192.168.20.13  -c 50
        echo "test network over .... 

"
    elif [ $1 = "4" ]; then
        ifconfig eth0 192.168.2.11
        ifconfig eth1 192.168.20.13
        sleep 5
        echo "set ip over"
        ping 192.168.2.10  -c 50
        ping 192.168.20.12  -c 50
        echo "test network over .... 

"
    fi

    test_tty
  • 测试脚本解释:

    四台产品,只要输入如下即可:
    ./test.sh 1
    ./test.sh 2
    ./test.sh 3
    ./test.sh 4
    // test_tty 是串口测试的二进制文件
原文地址:https://www.cnblogs.com/chenfulin5/p/6903999.html