diff options
author | Matus Fabian <matfabia@cisco.com> | 2016-04-04 12:07:51 +0200 |
---|---|---|
committer | Gerrit Code Review <gerrit@fd.io> | 2016-04-05 14:13:57 +0000 |
commit | 4c597cafd320c1e68f81768e14abc9f89bbc07e2 (patch) | |
tree | 952dfab61f0dad8521189a49c95e0036d61643a9 /resources | |
parent | a1383e569b184808780fbe0405402dea584902a9 (diff) |
Add "Stop and Clear QEMU" KW
Change-Id: Ib1b3907cd30c20c89283bd20e84ed8b829540ca4
Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'resources')
-rw-r--r-- | resources/libraries/robot/qemu.robot | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/resources/libraries/robot/qemu.robot b/resources/libraries/robot/qemu.robot index e26f9aa6bf..171a9be5a3 100644 --- a/resources/libraries/robot/qemu.robot +++ b/resources/libraries/robot/qemu.robot @@ -12,7 +12,7 @@ # limitations under the License. *** Settings *** | Library | resources.libraries.python.QemuUtils -| Library | Collections +| Library | resources.libraries.python.ssh.SSH *** Keywords *** @@ -50,3 +50,16 @@ | | Return From Keyword If | ${ready} == ${TRUE} | | Build QEMU | ${node} | | Add Node to QEMU Build List | ${node} + +| Stop and Clear QEMU +| | [Documentation] | Stop QEMU, clear used sockets and close SSH connection +| | ... | running on ${dut}, ${vm} is VM node info dictionary +| | ... | returned by qemu_start or None. +| | [Arguments] | ${dut} | ${vm} +| | Qemu Set Node | ${dut} +| | ${status} | ${value}= | Run Keyword And Ignore Error | Qemu System Status +| | Run Keyword If | "${status}" == "FAIL" | Qemu Kill +| | ... | ELSE IF | "${value}" == "running" | Qemu System Powerdown +| | ... | ELSE | Qemu Quit +| | Qemu Clear Socks +| | Run Keyword If | ${vm} is not None | Disconnect | ${vm} |