mugen----基于多个openEuler物理机执行mugen测试脚本
作者:redrose2100   类别:    日期:2022-11-15 09:01:17    阅读:1411 次   消耗积分:0 分

【原文链接】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工具,若已安装,则直接跳过

  1. dnf install -y git

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

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

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

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

(5)查看命令帮助信息

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

(6)设置环境变量

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

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

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

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

(8)执行测试用例

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

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

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

始终坚持开源开放共享精神,同时感谢您的充电鼓励和支持!
版权所有,转载本站文章请注明出处:redrose2100, http://blog.redrose2100.com/article/443
个人成就
  • 2022年 : 371 篇 
  • 2023年 : 211 篇 
  • 2024年 : 31 篇 
  • 2025年 : 0 篇 
  • 博客总数: 613 
  • 阅读总量: 666979 
测试开发技术全栈公众号
DevOps技术交流微信群