mbox series

[0/8] tests/vm: Add support for aarch64 VMs

Message ID 20200124165335.422-1-robert.foley@linaro.org (mailing list archive)
Headers show
Series tests/vm: Add support for aarch64 VMs | expand

Message

Robert Foley Jan. 24, 2020, 4:53 p.m. UTC
This patch adds support for 2 aarch64 VMs.  
 - Ubuntu 18.04 aarch64 VM
 - CentOS 8 aarch64 VM

In order to add support for the two new aarch64 VMs, we
generalized and parameterized basevm.py.  
We added a new concept of a configuration, which is really just a 
set of parameters which define how to configure the VM.  
Some examples of parameters are "machine", "memory" and "cpu".
We preserved current default parameters.
Current configuration of pre-existing VMs is supported by default
without need to override default parameters.
 
For example, previously only the 'pc' machine was supported in basevm.py. 
The new aarch64 VMs will override machine to use virt. 
There are a few other examples where we needed to add parameters 
in order to add support for these aarch64 VMs.
In some other cases we added parameters that we thought would be useful
in general, for example username/password, ssh keys, 

In the case of the aarch64 VMs, they override certain parameters
by default.  However, it is also of value to be able to 
dynamically specify other values for these parameters.
Take the case where you create a new VM using vm-build,
but then want to test it using various hardware configurations
such as for example different NUMA topologies. 
Or maybe you want to use a different amount of memory or a different cpu type.

In order to support these use cases we added support
for a configuration .yml file, which allows the user to
specify certain values dynamically such as:
 - machine
 - cpu
 - memory size
 - other qemu args, which allow configuring alternate
   hardware topologies such as NUMA nodes.
 - username, password
 - ssh keys
 For an example of a .yml file, see the included config_example.yml
 
The main use case for using this config.yml file is for where we
are testing/debugging with qemu (vm-build), and need to configure
the VM differently.  However, there is another use case we have
developed, which is a project called lisa-qemu 
(https://github.com/rf972/lisa-qemu).  
This project is an integration between the LISA tool and QEMU.  
This project uses the VMs created by
QEMU's vm-build scripts for use in testing with LISA.  
This use case is similar to the vm-build case in that,
the VM gets created once, and we want to launch the VM with different
configurations (memory, cpu, etc.).
 
As part of developing the scripts for these VMs, we implemented
a few enhancements to help with testing.
For example, we added support for allowing debug mode to
show the ssh output.
We also added support for a new --boot-console option which
will show the boot console as the VM boots up to aid in 
debugging problems during VM boot.

Robert Foley (8):
  tests/vm: Debug mode shows ssh output.
  tests/vm: increased max timeout for vm boot.
  tests/vm: change wait_ssh to optionally wait for root.
  tests/vm: Add configuration to basevm.py
  tests/vm: Added configuration file support
  tests/vm: add --boot-console switch
  tests/vm: Added a new script for ubuntu.aarch64.
  tests/vm: Added a new script for centos.aarch64.

 tests/vm/Makefile.include    |   8 +-
 tests/vm/aarch64vm.py        |  41 +++++++
 tests/vm/basevm.py           | 192 +++++++++++++++++++++++++-----
 tests/vm/centos-8-aarch64.ks |  52 +++++++++
 tests/vm/centos.aarch64      | 218 +++++++++++++++++++++++++++++++++++
 tests/vm/config_example.yml  |  52 +++++++++
 tests/vm/ubuntu.aarch64      | 144 +++++++++++++++++++++++
 7 files changed, 675 insertions(+), 32 deletions(-)
 create mode 100644 tests/vm/aarch64vm.py
 create mode 100644 tests/vm/centos-8-aarch64.ks
 create mode 100755 tests/vm/centos.aarch64
 create mode 100644 tests/vm/config_example.yml
 create mode 100755 tests/vm/ubuntu.aarch64

Comments

Alex Bennée Jan. 28, 2020, 5:52 p.m. UTC | #1
Robert Foley <robert.foley@linaro.org> writes:

> This patch adds support for 2 aarch64 VMs.  
>  - Ubuntu 18.04 aarch64 VM
>  - CentOS 8 aarch64 VM
<snip>

Another failure to note - under TCG:

  make vm-build-ubuntu.aarch64 V=1 QEMU=aarch64-softmmu/qemu-system-aarch64

Gives:

Not run: 172 186 192 220
Failures: 001 002 003 004 005 007 008 009 010 011 012 013 017 018 019 020 021 022 024 025 027 029 031 032 033 034 035 036 037 038 039 042 043 046 047 048 049 050 052 053 054 060 061 062 063 066 069 071 072 073 074 079 080 086 089 090 097 098 099 103 104 105 107 108 110 111 114 117 120 126 133 134 137 138 140 141 143 150 154 156 158 159 161 170
174 176 177 179 184 187 190 191 195 214 217 226 229 244 249 251 252 265 267 268
Failed 104 of 104 iotests
/tmp/tmp.EjcqWtvHwd/tests/Makefile.include:840: recipe for target 'check-tests/check-block.sh' failed
make: *** [check-tests/check-block.sh] Error 1
rm tests/qemu-iotests/socket_scm_helper.o
Connection to 127.0.0.1 closed.
DEBUG:QMP:>>> {'execute': 'quit'}
DEBUG:QMP:<<< {'timestamp': {'seconds': 1580134315, 'microseconds': 216297}, 'event': 'NIC_RX_FILTER_CHANGED', 'data': {'path': '/machine/peripheral-anon/device[0]/virtio-backend'}}
DEBUG:QMP:<<< {'return': {}}
/home/alex.bennee/lsrc/qemu.git/tests/vm/Makefile.include:63: recipe for target 'vm-build-ubuntu.aarch64' failed
make: *** [vm-build-ubuntu.aarch64] Error 3

With things like:

--- /tmp/tmp.EjcqWtvHwd/tests/qemu-iotests/063.out      2020-01-27 10:54:38.000000000 +0000
+++ /tmp/tmp.EjcqWtvHwd/tests/qemu-iotests/063.out.bad  2020-01-28 01:20:28.563789323 +0000
@@ -1,3 +1,4 @@
+bash: warning: setlocale: LC_ALL: cannot change locale (en_GB.UTF-8)
 QA output created by 063
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4194304
 == Testing conversion with -n fails with no target file ==
  TEST    iotest-qcow2: 066 [fail]
QEMU          -- "/tmp/tmp.EjcqWtvHwd/tests/qemu-iotests/../../aarch64-softmmu/qemu-system-aarch64" -nodefaults -display none -machine virt -accel qtest
QEMU_IMG      -- "/tmp/tmp.EjcqWtvHwd/tests/qemu-iotests/../../qemu-img"
QEMU_IO       -- "/tmp/tmp.EjcqWtvHwd/tests/qemu-iotests/../../qemu-io"  --cache writeback -f qcow2
QEMU_NBD      -- "/tmp/tmp.EjcqWtvHwd/tests/qemu-iotests/../../qemu-nbd"
IMGFMT        -- qcow2 (compat=1.1)
IMGPROTO      -- file
PLATFORM      -- Linux/aarch64 ubuntu-guest 4.15.0-74-generic
TEST_DIR      -- /tmp/tmp.EjcqWtvHwd/tests/qemu-iotests/scratch
SOCK_DIR      -- /tmp/tmp.BJ9gTNMmv1
SOCKET_SCM_HELPER -- /tmp/tmp.EjcqWtvHwd/tests/qemu-iotests/socket_scm_helper

So I suspect a locale issue is breaking things.
Robert Foley Jan. 29, 2020, 12:59 p.m. UTC | #2
Thanks for the details on the failure.   I have not been able to
reproduce it yet, but digging into it further.

On Tue, 28 Jan 2020 at 12:52, Alex Bennée <alex.bennee@linaro.org> wrote:
>
>
> Robert Foley <robert.foley@linaro.org> writes:
>
> > This patch adds support for 2 aarch64 VMs.
> >  - Ubuntu 18.04 aarch64 VM
> >  - CentOS 8 aarch64 VM
> <snip>
>
> Another failure to note - under TCG:
>
>   make vm-build-ubuntu.aarch64 V=1 QEMU=aarch64-softmmu/qemu-system-aarch64
>
> Gives:
>
> Not run: 172 186 192 220
> Failures: 001 002 003 004 005 007 008 009 010 011 012 013 017 018 019 020 021 022 024 025 027 029 031 032 033 034 035 036 037 038 039 042 043 046 047 048 049 050 052 053 054 060 061 062 063 066 069 071 072 073 074 079 080 086 089 090 097 098 099 103 104 105 107 108 110 111 114 117 120 126 133 134 137 138 140 141 143 150 154 156 158 159 161 170
> 174 176 177 179 184 187 190 191 195 214 217 226 229 244 249 251 252 265 267 268
> Failed 104 of 104 iotests
> /tmp/tmp.EjcqWtvHwd/tests/Makefile.include:840: recipe for target 'check-tests/check-block.sh' failed
> make: *** [check-tests/check-block.sh] Error 1
> rm tests/qemu-iotests/socket_scm_helper.o
> Connection to 127.0.0.1 closed.
> DEBUG:QMP:>>> {'execute': 'quit'}
> DEBUG:QMP:<<< {'timestamp': {'seconds': 1580134315, 'microseconds': 216297}, 'event': 'NIC_RX_FILTER_CHANGED', 'data': {'path': '/machine/peripheral-anon/device[0]/virtio-backend'}}
> DEBUG:QMP:<<< {'return': {}}
> /home/alex.bennee/lsrc/qemu.git/tests/vm/Makefile.include:63: recipe for target 'vm-build-ubuntu.aarch64' failed
> make: *** [vm-build-ubuntu.aarch64] Error 3
>
> With things like:
>
> --- /tmp/tmp.EjcqWtvHwd/tests/qemu-iotests/063.out      2020-01-27 10:54:38.000000000 +0000
> +++ /tmp/tmp.EjcqWtvHwd/tests/qemu-iotests/063.out.bad  2020-01-28 01:20:28.563789323 +0000
> @@ -1,3 +1,4 @@
> +bash: warning: setlocale: LC_ALL: cannot change locale (en_GB.UTF-8)
>  QA output created by 063
>  Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4194304
>  == Testing conversion with -n fails with no target file ==
>   TEST    iotest-qcow2: 066 [fail]
> QEMU          -- "/tmp/tmp.EjcqWtvHwd/tests/qemu-iotests/../../aarch64-softmmu/qemu-system-aarch64" -nodefaults -display none -machine virt -accel qtest
> QEMU_IMG      -- "/tmp/tmp.EjcqWtvHwd/tests/qemu-iotests/../../qemu-img"
> QEMU_IO       -- "/tmp/tmp.EjcqWtvHwd/tests/qemu-iotests/../../qemu-io"  --cache writeback -f qcow2
> QEMU_NBD      -- "/tmp/tmp.EjcqWtvHwd/tests/qemu-iotests/../../qemu-nbd"
> IMGFMT        -- qcow2 (compat=1.1)
> IMGPROTO      -- file
> PLATFORM      -- Linux/aarch64 ubuntu-guest 4.15.0-74-generic
> TEST_DIR      -- /tmp/tmp.EjcqWtvHwd/tests/qemu-iotests/scratch
> SOCK_DIR      -- /tmp/tmp.BJ9gTNMmv1
> SOCKET_SCM_HELPER -- /tmp/tmp.EjcqWtvHwd/tests/qemu-iotests/socket_scm_helper
>
> So I suspect a locale issue is breaking things.
>
> --
> Alex Bennée