*** Settings ***
Documentation Transfer a file from OCU to PC
Library SSHLibrary
Suite Setup Open Connection and Login With Public Key
Suite Teardown Close All Connections
*** Variables ***
${REMOTE HOST} 192.168.x.xxx
${USER} xxx
*** Keywords ***
Open Connection and Login With Public Key
Open Connection ${REMOTE HOST}
Login With Public Key ${USER} /home/bhushan/.ssh/id_rsa
*** Test Cases ***
Run the given command on the console
${pwd}= Execute Command pwd
Should Be Equal ${pwd} /home/root
${output}= Execute Command ls
${output}= Execute Command scp /home/root/myfile.txt bhushan@192.168.x.xxx:/home/bhushan/vdr-reports/
Log ${output}
我的目标上安装了最新版本的Dropbear。我正在尝试运行上面的SSH Library Robot框架关键字测试用例,它定义了将文件从远程传输到本地主机。 execute命令关键字在开头工作,即$ {output} = Execute Command ls,但是在复制文件时使用相同的关键字时出错,即我看不到控制台上发生的任何事情。它挂了,我等了很长时间才看到输出,但没有看到任何东西。但是,当我手动将文件复制到本地计算机时,这可以正常工作。这里的任何人都可以帮我修复此错误。
KEYWORD $ {output} = SSHLibrary。执行命令scp /home/root/myfile.txt bhushan@192.168.x.xxx:/ home / bhushan / vdr-reports / 文档:在远程计算机上执行
command
并返回 它的产出。开始/结束/经过:20170829 10:26:23.897 / 20170829 10:26:50.148 / 00:00:26.251 10:26:23.898 INFO执行命令'scp /home/root/myfile.txt bhushan@192.168.x.xxx:/家庭/普山/ VDR-报告/'...................& GT;
这是我在日志中看到的