• 基于多个openEuler物理机执行mugen测试脚本


    【原文链接】基于多个openEuler物理机执行mugen测试脚本

    mugen脚本中有的脚本执行需要使用多个物理机,针对此场景,这里以需要两个物理机为例(用openEuler虚拟机模拟物理机)

    (1)首先安装两台openEuler虚拟机(用过模拟openEuler物理机),具体安装可参考 VMware安装openEuler-22.03-LTS版本的虚拟机 这里比如两台ip地址为:192.168.1.8和192.168.1.12

    (2)在其中一台(192.168.1.8)安装git工具,若已安装,则直接跳过

    dnf install -y git
    
    • 1

    (3)在其中一台(192.168.1.8)下载mugen代码

    cd /opt/
    git clone https://gitee.com/openeuler/mugen.git
    
    • 1
    • 2

    (4)在其中一台(192.168.1.8)安装依赖

    cd mugen/
    chmod 777 dep_install.sh
    bash dep_install.sh
    
    • 1
    • 2
    • 3

    (5)查看命令帮助信息

    [root@openEuler-1 mugen]# bash mugen.sh --help
    mugen.sh:非法选项 -- -
    Usage:
    
        -c: configuration environment of test framework
    
        -a: execute all use cases
    
        -f: designated test suite
    
        -r: designated test case
    
        -x: the shell script is executed in debug mode
    
        -b: do make for test suite if test suite path have makefile or Makefile file
    
        -s: runing test case at remote NODE1
    
    
        Example:
            run all cases:
              normal mode:
                bash mugen.sh -a
              debug mode:
                bash mugen.sh -a -x
    
            run test suite:
              normal mode:
                bash mugen.sh -f test_suite
              debug mode:
                bash mugen.sh -f test_suite -x
    
            run test case:
              normal mode:
                bash mugen.sh -f test_suite -r test_case
              debug mode:
                bash mugen.sh -f test_suite -r test_case -x
    
            run at remote:
              normal mode:
                bash mugen.sh -a -s
                bash mugen.sh -f test_suite -s
                bash mugen.sh -f test_suite -r test_case -s
              debug mode:
                bash mugen.sh -a -s
                bash mugen.sh -f test_suite -s
                bash mugen.sh -f test_suite -r test_case -s
    
    
            configure env of test framework:
                bash mugen.sh -c --ip $ip --password $passwd --user $user --port $port
    
              if want run at remote should add --run_remote
              if want run at remote copy all testcase once add --put_all
    
    
        do make for test suite:
            for all test suite:
                bash mugen.sh -b -a
            for one test suite:
                bash mugen.sh -b test_suite
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61

    (6)设置环境变量

    如下,执行两次即可以将两个ip地址设置到环境变量中

    bash mugen.sh -c --ip 192.168.1.8 --password xxxxxx --user root --port 22
    bash mugen.sh -c --ip 192.168.1.12 --password xxxxxx --user root --port 22
    
    • 1
    • 2

    然后可以查看环境变量文件 conf/env.json

    (7)从mugen中找到一个需要两个物理机的脚本,如下

    (8)执行测试用例

    bash mugen.sh -f nftables -r oe_test_nftables_variable_map -x
    
    • 1

    (9)执行结果如下,即成功执行

    (10)同理,如果需要多个物理环境,只需要参照步骤6多配置几个环境的配置即可

  • 相关阅读:
    STM32 | 独立看门狗 | RTC(实时时钟)
    Win10下Hadoop3.2.1的安装与配置
    Flutter的The file name ‘xxxx.dart‘ isn‘t a snake_case identifier警告
    腾讯云轻量数据库性能如何?轻量数据库租用配置价格表
    JVM学习(三)-- 垃圾回收
    uniapp——第2篇:编写vue语法
    01 pyechars 特性、版本、安装介绍
    Docker-Compose安装Gitlab
    图数据库 之 Neo4j - 应用场景4 - 反洗钱(9)
    图机器学习(GML)&图神经网络(GNN)原理和代码实现(前置学习系列二)
  • 原文地址:https://blog.csdn.net/redrose2100/article/details/127869419