Signed-off-by: Zhang Yale ylzhangah@qq.com --- doc/manual/how-to-log-in-the-machine.md | 86 ------------------- ...03\346\265\213\344\273\273\345\212\241.md" | 72 ++++++++++++++++ 2 files changed, 72 insertions(+), 86 deletions(-) delete mode 100644 doc/manual/how-to-log-in-the-machine.md create mode 100644 "doc/manual/\345\246\202\344\275\225\347\231\273\345\275\225\346\265\213\350\257\225\346\234\272\350\260\203\346\265\213\344\273\273\345\212\241.md"
diff --git a/doc/manual/how-to-log-in-the-machine.md b/doc/manual/how-to-log-in-the-machine.md deleted file mode 100644 index fefd718..0000000 --- a/doc/manual/how-to-log-in-the-machine.md +++ /dev/null @@ -1,86 +0,0 @@ -这篇文档将告诉你如何登陆测试环境 - -# 1. 前提条件 -请先学习: -* [apply-account.md](https://gitee.com/wu_fengguang/compass-ci/blob/master/doc/manual/apply-accou...), 配置个人邮箱 -* [如何申请测试机.md](https://gitee.com/wu_fengguang/compass-ci/blob/master/doc/manual/%E5%A6%82%E...), 并在本地生成RSA公私钥对 -* [submit命令详解.md](https://gitee.com/wu_fengguang/compass-ci/blob/master/doc/manual/submit%E5%9...), submit 命令详解 - -# 2. 操作方法 -## 2.1 在job.yaml里加上sshd和sleep字段, 以host-info.yaml任务为例: - -```shell - suite: host-info - category: functional - pub_key: <%= - begin - File.read("#{ENV['HOME']}/.ssh/id_rsa.pub").chomp - rescue - nil - end - %> - sshd: - # sleep at the bottom - sleep: 1h - - host-info: -``` - -## 2.2 以下有2种方式可以登录到测试机: -### 第一种:使用submit -m -c的方式: - 这种方式提交的任务会在指定的位置sleep并直接登陆到测试机中,适用于登陆测试环境后手动调试 - 命令:submit -m -c host-info.yaml - 任务提交完成后,当测试执行到sshd后会自动登陆到测试机器上: - 效果如下: - -```shell - hi6325@account-vm ~% submit -m -c atomic.yaml - submit atomic.yaml, got job_id=crystal.146528 - query=>{"job_id":["crystal.146528"]} - connect to ws://localhost:11310/filter - {"job_id": "crystal.146528", "result_root": "/srv/result/atomic/2020-12-01/vm-2p8g/openeuler-20.03-aarch64/1-1000/crystal.146528", "job_state": "set result root" - {"job_id": "crystal.146528", "job_state": "boot"} - {"job_id": "crystal.146528", "job_state": "download"} - "time":"2020-12-01 10:12:33","mac":"0a-2d-7b-d9-f8-b1","ip":"172.18.252.12","job_id":"crystal.146528","state":"running","testbox":"vm-2p8g.zhyl-453231"} - {"job_state":"running","job_id":"crystal.146528"} - {"job_id": "crystal.146528", "state": "set ssh port", "ssh_port": "51750", "tbox_name": "vm-2p8g.zhyl-453231"} - - root@vm-2p8g ~# -``` - -### 第二种:根据邮件信息使用ssh方式登录测试机: - 这种是使用submit方式提交的任务完成后,系统自动发送一封邮件提醒您可以在指定时间内登陆到测试环境 - 命令: submit host-info.yaml - 任务执行完成后,系统发送邮件内容如下: - -```shell - Subject: [NOTIFY Compass-ci] vm-2p8g-294828 ready to use - - Dear $my_username: - Thanks for your participation in software ecosystem! - According to your application, vm-2p8g-294828 has been provisioned. - The datails are as follows: - - Login: - ssh root@api.compass-ci.openeuler.org -p $port - Due time: - $deadline - HW: - nr_cpu: $nr_cpu - memory: $memory - testbox: $testbox - OS: - $os $os_version $os_arch - Regards - Compass-Ci -``` - - 可通过ssh方式登陆到测试环境: - 命令: ssh root@api.compass-ci.openeuler.org -p $port - 效果如下: - -```shell - hi6325@account-vm ~% ssh root@api.compass-ci.openeuler.org -p 51400 - - root@vm-2p8g ~# -``` diff --git "a/doc/manual/\345\246\202\344\275\225\347\231\273\345\275\225\346\265\213\350\257\225\346\234\272\350\260\203\346\265\213\344\273\273\345\212\241.md" "b/doc/manual/\345\246\202\344\275\225\347\231\273\345\275\225\346\265\213\350\257\225\346\234\272\350\260\203\346\265\213\344\273\273\345\212\241.md" new file mode 100644 index 0000000..1b962fe --- /dev/null +++ "b/doc/manual/\345\246\202\344\275\225\347\231\273\345\275\225\346\265\213\350\257\225\346\234\272\350\260\203\346\265\213\344\273\273\345\212\241.md" @@ -0,0 +1,72 @@ +这篇文档将告诉你如何登陆测试环境去调测任务 + +# 1. 前提条件: +## 请先学习: +* [apply-account.md](https://gitee.com/wu_fengguang/compass-ci/blob/master/doc/manual/apply-accou...), 配置个人邮箱 +* [如何申请测试机.md](https://gitee.com/wu_fengguang/compass-ci/blob/master/doc/manual/%E5%A6%82%E...), 并在本地生成RSA公私钥对 +* [submit命令详解.md](https://gitee.com/wu_fengguang/compass-ci/blob/master/doc/manual/submit%E5%9...), submit 命令详解 + +# 2. 操作方法 + +## 2.1 定义免密登录的yaml + +### 方法一:在测试机运行脚本之前进入测试机调测任务 + +在job.yaml里加上sshd和sleep字段,测试机在运行脚本之前sleep, 并免密登录进去,手动输入命令或脚本进行调试,以host-info.yaml为例: + +```yaml + suite: host-info + category: functional + + pub_key: <%= + begin + File.read("#{ENV['HOME']}/.ssh/id_rsa.pub").chomp + rescue + nil + end + %> + + sshd: + # sleep at the bottom + sleep: 1h + + host-info: +``` + +### 方法二:在测试任务运行失败时进入测试机调测任务 + +在job.yaml里加上pub_key和on_fail字段,并在on_fail下加上sshd和sleep字段,测试任务失败后,免密登录进去手动调试,以host-info.yaml为例: + +```yaml + suite: host-info + category: functional + + pub_key: <%= + begin + File.read("#{ENV['HOME']}/.ssh/id_rsa.pub").chomp + rescue + nil + end + %> + + host-info: + on_fail: + sshd: + sleep: 1000s +``` + +## 2.2 提交job.yaml + +### 方法一:直接提交 + + submit host-info.yaml + +在收到邮件后,按照邮件提示手动免密登录到执行机调测 + + ssh root@api.compass-ci.openeuler.org -p $port + +### 方法二:带参数提交 + + submit -m -c host-info.yaml + +该方法不用查看邮件,可自动免密登录到测试机