代码获取没用的不必看社区readme使用的获取代码命令如下git clone https://github.com/openbmc/openbmc-test-automationCloning into openbmc-test-automation...fatal: unable to access https://github.com/openbmc/openbmc-test-automation/: Failed to connect to 127.0.0.1 port 7890 after 0 ms: Connection refused取消代理git config --global --unset http.proxygit config --global --unset https.proxy继续报错如下git clone https://github.com/openbmc/openbmc-test-automationCloning into openbmc-test-automation...fatal: unable to access https://github.com/openbmc/openbmc-test-automation/: Failed to connect to github.com port 443 after 21110 ms: Connection refusedping github.com PING github.com (20.205.243.166) 56(84) bytes of data. 64 bytes from 20.205.243.166 (20.205.243.166): icmp_seq1 ttl128 time131 ms 64 bytes from 20.205.243.166 (20.205.243.166): icmp_seq2 ttl128 time132 ms 64 bytes fromcurl -v https://github.com * Trying 20.205.243.166:443... * connect to 20.205.243.166 port 443 failed: Connection refused * Failed to connect to github.com port 443 after 21046 ms: Connection refused * Closing connection 0 curl: (7) Failed to connect to github.com port 443 after 21046 ms: Connection refused可以尝试使用ssh:ssh -vT gitgithub.comssh -T -p 443 gitssh.github.comssh -vT gitgithub.com显示Connection established.说明22 端口是通的。ssh -T -p 443 gitssh.github.com返回了Permission denied说明443 端口也是通的配置可以看一下ssh-keygen -t rsa -C vm_obmc_test一直按enter把产生的.ssh/id_rsa.pub内容全部复制到对应的网站(Sign in to GitHub · GitHub)添加git config --global url.gitgithub.com:.insteadOf https://github.com/之后执行git clone https://github.com/openbmc/openbmc-test-automation就会自动使用 SSH 协议环境配置pip install -r requirements.txtpip install -r requirements_optional.txtpip install -U toxsudo apt-get install expectCLI实践readme提到过用户可通过环境变量预声明个人实操变量确实导入到了环境变量中但是测试时并没用传递给robot测试框架建议还是显示传递或者使用tox进行管理基础环境验证测试示例robot -v OPENBMC_HOST:192.168.20.100 \-v OPENBMC_USERNAME:root \-v OPENBMC_PASSWORD:0penBmc \-v IPMI_COMMAND:External \templates/test_openbmc_setup.robot也可使用tox进行测试在tox.ini中添加自己的机型并设置好测试的环境变量:[testenv:e2ps23]deps {[testenv]deps}setenv {[testenv]setenv}OPENBMC_HOST192.168.20.100HTTPS_PORT443SSH_PORT22IPMI_PORT623commands {[testenv]commands}python3 -m robot.run --argumentfile {env:ARG_FILE} {posargs}使用如下命令进行测试首次测试时可能较慢tox -e e2ps23 -- templates/test_openbmc_setup.robot真机测试QEMU测试项robot -v OPENBMC_HOST:192.168.20.100 -v OPENBMC_USERNAME:root -v OPENBMC_PASSWORD:0penBmc -v IPMI_COMMAND:External -A test_lists/QEMU_CI redfish/ ipmi/tox测试命令tox -e e2ps23 -- -A test_lists/QEMU_CI redfish/ ipmi/运行单个测试套件tox -e e2ps23 -- redfish/extended/test_basic_ci.robot运行单个测试用例tox -e e2ps23 -- --include Test_SSH_And_IPMI_Connections redfish/extended/test_basic_ci.robot