CSIT-312 VPP vhost-user - VPP vhost-user driver, virtio in VM
[csit.git] / resources / libraries / robot / qemu.robot
index e26f9aa..a9cf010 100644 (file)
@@ -12,7 +12,7 @@
 # limitations under the License.
 *** Settings ***
 | Library | resources.libraries.python.QemuUtils
-| Library | Collections
+| Library | resources.libraries.python.ssh.SSH
 
 *** Keywords ***
 
 | | Return From Keyword If | ${ready} == ${TRUE}
 | | Build QEMU | ${node}
 | | Add Node to QEMU Build List | ${node}
+
+| Build QEMU on all DUTs
+| | [Documentation] | Build QEMU from sources on all DUTs. Nodes with successful
+| | ...             | QEMU build are stored in global variable list QEMU_BUILD
+| | ${duts}= | Get Matches | ${nodes} | DUT*
+| | :FOR | ${dut} | IN | @{duts}
+| | | Build QEMU on Node | ${nodes['${dut}']}
+
+| 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}
+
+| Kill Qemu on all DUTs
+| | [Documentation] | Kill QEMU processes on all DUTs.
+| | ${duts}= | Get Matches | ${nodes} | DUT*
+| | :FOR | ${dut} | IN | @{duts}
+| | | Qemu Set Node | ${nodes['${dut}']}
+| | | Qemu Kill