rls1710: rls_notes update.
[csit.git] / docs / qemu_vpp_vm
1 # Copyright (c) 2016 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 QEMU is used for VPP-VM testing enviroment. You need to run qemu-2.2.1 or newer
15 in order to Vhos-user support. In CSIT VIRL setup DUT has preinstalled QEMU and
16 have small VM image "/var/lib/vm/vhost-nested.img". QEMU binary path must
17 be "/opt/qemu/bin/qemu-system-x86_64". You can use following script to replicate
18 QEMU setup on DUT "resources/libraries/bash/qemu_build.sh" for local testing,
19 out of LF's VM setup. VM image must have installed at least qemu-guest-agent,
20 sshd, bridge-utils and VirtIO support. Note that VPP must be installed before
21 starting QEMU, because VPP will do the hugepages configuration as part of it's
22 installation process. Username/password for the VM must be cisco/cisco and
23 NOPASSWD sudo access. The interface naming is based on driver (management
24 interface type is Intel E1000), all E1000 interfaces will be named mgmt<n> and
25 all VirtIO interfaces will be named virtio<n>. In VM
26 "/etc/init.d/qemu-guest-agent" you must set "TRANSPORT=isa-serial:/dev/ttyS1"
27 because ttyS0 is used by serial console and ttyS1 is dedicated for
28 qemu-guest-agent in QEMU setup.
29 There is python library for QEMU setup, start and some utilities
30 "resources/libraries/python/QemuUtils.py" and keyword "Stop and Clear QEMU" for
31 teardown in resources/libraries/robot/vm/qemu.robot. "Qemu Start" setup one
32 management interface by default. You can add Vhost-user interfaces by
33 "Qemu Add Vhost User If" keyword.
34 Example usage in robot framework test:
35
36 *** Settings ***
37 | Resource | resources/libraries/robot/vm/qemu.robot
38
39 *** Test Cases ***
40 | VM test
41 | | [Tags] | VPP_VM_ENV
42 | | Qemu Set Node | ${nodes['DUT1']}
43 | | Qemu Add Vhost User If | /tmp/vhost_sock
44 | | ${vm}= | Set Variable | ${None}
45 | | ${vm}= | Qemu Start
46 | | [Teardown] | Stop and Clear QEMU | ${dut1} | ${vm}
47
48 Note that VPP must be started and configured before starting the VM when using
49 Vhost-user interfaces.