aboutsummaryrefslogtreecommitdiff
path: root/tests/acceptance
AgeCommit message (Collapse)AuthorFilesLines
2019-12-17Merge remote-tracking branch 'remotes/cleber/tags/python-next-pull-request' ↵Peter Maydell10-128/+121
into staging Python queue 2019-12-17 # gpg: Signature made Tue 17 Dec 2019 05:12:43 GMT # gpg: using RSA key 7ABB96EB8B46B94D5E0FE9BB657E8D33A5F209F3 # gpg: Good signature from "Cleber Rosa <crosa@redhat.com>" [marginal] # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 7ABB 96EB 8B46 B94D 5E0F E9BB 657E 8D33 A5F2 09F3 * remotes/cleber/tags/python-next-pull-request: python/qemu: Remove unneeded imports in __init__ python/qemu: accel: Add tcg_available() method python/qemu: accel: Strengthen kvm_available() checks python/qemu: accel: Add list_accel() method python/qemu: Move kvm_available() to its own module Acceptance tests: use relative location for tests Acceptance tests: use avocado tags for machine type Acceptance tests: introduce utility method for tags unique vals Acceptance test x86_cpu_model_versions: use default vm tests/acceptance: Makes linux_initrd and empty_cpu_model use QEMUMachine python/qemu: Add set_qmp_monitor() to QEMUMachine analyze-migration.py: replace numpy with python 3.2 analyze-migration.py: fix find() type error Revert "Acceptance test: cancel test if m68k kernel packages goes missing" tests/boot_linux_console: Fetch assets from Debian snapshot archives Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-12-16Acceptance tests: use avocado tags for machine typeCleber Rosa9-59/+54
The same way the arch tag is being used as a fallback for the arch parameter, let's do the same for QEMU's machine and avoid some boiler plate code. This is now possible because, since Avocado 72.0, it's possible to use tags with names that match the machine types on QEMU. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20191104151323.9883-4-crosa@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
2019-12-16Acceptance tests: introduce utility method for tags unique valsCleber Rosa1-6/+13
Currently a test can describe the target architecture binary that it should primarily be run with, be setting a single tag value. The same approach is expected to be done with other QEMU aspects to be tested, for instance, the machine type and accelerator, so let's generalize the logic into a utility method. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20190924194501.9303-3-crosa@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
2019-12-16Acceptance test x86_cpu_model_versions: use default vmCleber Rosa1-54/+46
The default vm provided by the test, available as self.vm, serves the same purpose of the one obtained by self.get_vm(), but saves a line and matches the style of other tests. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20190924194501.9303-2-crosa@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
2019-12-16tests/acceptance: Makes linux_initrd and empty_cpu_model use QEMUMachineWainer dos Santos Moschetta2-12/+13
On linux_initrd and empty_cpu_model tests the same effect of calling QEMU through run() to inspect the terminated process is achieved with a sequence of set_qmp_monitor() / launch() / wait() commands on an QEMUMachine object. This patch changes those tests to use QEMUMachine instead, so they follow the same pattern to launch QEMU found on other acceptance tests. Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Reviewed-by: Cleber Rosa <crosa@redhat.com> Tested-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20191211185536.16962-3-wainersm@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
2019-12-16Revert "Acceptance test: cancel test if m68k kernel packages goes missing"Philippe Mathieu-Daudé1-4/+1
Now than we use the stable snapshot archive, we can remove this check. This reverts commit d2499aca4bac613d837e2720e7bbe3378bc91245. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20191126223810.20180-3-philmd@redhat.com> Tested-by: Willian Rampazzo <wrampazz@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
2019-12-16tests/boot_linux_console: Fetch assets from Debian snapshot archivesPhilippe Mathieu-Daudé1-1/+2
The kernel packaged was fetched from an unstable repository. Use the stable snapshot archive instead. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20191126223810.20180-2-philmd@redhat.com> Tested-by: Willian Rampazzo <wrampazz@redhat.com> Reviewed-by: Cleber Rosa <crosa@redhat.com> Tested-by: Cleber Rosa <crosa@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
2019-12-16mips: malta: Renovate coding styleFilip Bozuta1-2/+4
The script checkpatch.pl located in scripts folder was used to detect all errors and warrnings in files: hw/mips/mips_malta.c hw/mips/gt64xxx_pci.c tests/acceptance/linux_ssh_mips_malta.py All these mips malta machine files were edited and all the errors and warrings generated by the checkpatch.pl script were corrected and then the script was ran again to make sure there are no more errors and warnings. Signed-off-by: Filip Bozuta <Filip.Bozuta@rt-rk.com> Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com> Message-Id: <1575640687-20744-3-git-send-email-Filip.Bozuta@rt-rk.com>
2019-10-31Acceptance test: update kernel for m68k/q800 testCleber Rosa1-3/+3
There's an updated version of the Debian package containing the m68k Kernel. Now, if the package gets updated again, the test won't fail, but will be canceled. A more permanent solution is certainly needed. Signed-off-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Tested-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20191029232320.12419-3-crosa@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2019-10-31Acceptance test: cancel test if m68k kernel packages goes missingCleber Rosa1-1/+4
The Linux kernel that is extracted from a Debian package for the q800 machine test is hosted on a "pool" location. AFAICT, it gets updated without too much ceremony, and I don't see any archival location that is stable enough. For now, to avoid test errors, let's cancel the test if fetching the package fails. Signed-off-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20191029232320.12419-2-crosa@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2019-10-30Merge remote-tracking branch 'remotes/cleber/tags/python-next-pull-request' ↵Peter Maydell5-52/+297
into staging Python (acceptance tests) queue, 2019-10-28 # gpg: Signature made Mon 28 Oct 2019 23:43:11 GMT # gpg: using RSA key 7ABB96EB8B46B94D5E0FE9BB657E8D33A5F209F3 # gpg: Good signature from "Cleber Rosa <crosa@redhat.com>" [marginal] # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 7ABB 96EB 8B46 B94D 5E0F E9BB 657E 8D33 A5F2 09F3 * remotes/cleber/tags/python-next-pull-request: tests/boot_linux_console: Run BusyBox on 5KEc 64-bit cpu tests/boot_linux_console: Add initrd test for the Exynos4210 tests/boot_linux_console: Add a test for the Raspberry Pi 2 tests/boot_linux_console: Use Avocado archive::gzip_uncompress() .travis.yml: Let the avocado job run the 40p tests tests/acceptance: Test OpenBIOS on the PReP/40p tests/acceptance: Add test that runs NetBSD 4.0 installer on PRep/40p .travis.yml: Let the avocado job run the Leon3 test tests/acceptance: Add test that boots the HelenOS microkernel on Leon3 tests/acceptance: Refactor exec_command_and_wait_for_pattern() tests/acceptance: Send <carriage return> on serial lines tests/acceptance: Fix wait_for_console_pattern() hangs Acceptance tests: refactor wait_for_console_pattern Python libs: close console sockets before shutting down the VMs Acceptance tests: work around socket dir MAINTAINERS: update location of Python libraries Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-10-29Merge remote-tracking branch 'remotes/vivier/tags/q800-branch-pull-request' ↵Peter Maydell1-0/+24
into staging Add Macintosh Quadra 800 machine in hw/m68k # gpg: Signature made Mon 28 Oct 2019 18:14:25 GMT # gpg: using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C # gpg: issuer "laurent@vivier.eu" # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full] # gpg: aka "Laurent Vivier <laurent@vivier.eu>" [full] # gpg: aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full] # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F 5173 F30C 38BD 3F2F BE3C * remotes/vivier/tags/q800-branch-pull-request: BootLinuxConsoleTest: Test the Quadra 800 hw/m68k: define Macintosh Quadra 800 hw/m68k: add a dummy SWIM floppy controller hw/m68k: add Nubus macfb video card hw/m68k: add Nubus support hw/m68k: implement ADB bus support for via hw/m68k: add VIA support dp8393x: manage big endian bus esp: add pseudo-DMA as used by Macintosh esp: move get_cmd() post-DMA code to get_cmd_cb() esp: move handle_ti_cmd() cleanup code to esp_do_dma(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-10-28tests/boot_linux_console: Run BusyBox on 5KEc 64-bit cpuPhilippe Mathieu-Daudé1-0/+42
This tests boots a Linux kernel on a Malta machine up to a busybox shell on the serial console. Few commands are executed before halting the machine (via reboot). We use the Fedora 24 kernel extracted from the image at: https://fedoraproject.org/wiki/Architectures/MIPS and the initrd cpio image from the kerneltests project: https://kerneltests.org/ If MIPS is a target being built, "make check-acceptance" will automatically include this test by the use of the "arch:mips" tags. Alternatively, this test can be run using: $ AVOCADO_ALLOW_UNTRUSTED_CODE=yes \ avocado --show=console run -t arch:mips64el \ tests/acceptance/boot_linux_console.py console: [ 0.000000] Linux version 3.19.3.mtoman.20150408 (mtoman@debian-co3-1) (gcc version 5.0.0 20150316 (Red Hat 5.0.0-0.20) (GCC) ) #3 Wed Apr 8 14:32:50 UTC 2015 console: [ 0.000000] Early serial console at I/O port 0x3f8 (options '38400n8') console: [ 0.000000] bootconsole [uart0] enabled console: [ 0.000000] CPU0 revision is: 00018900 (MIPS 5KE) console: [ 0.000000] Checking for the multiply/shift bug... no. console: [ 0.000000] Checking for the daddiu bug... no. [...] console: Boot successful. console: cat /proc/cpuinfo console: / # cat /proc/cpuinfo console: system type : MIPS Malta console: machine : Unknown console: processor : 0 console: cpu model : MIPS 5KE V0.0 console: : 1616.89 console: wait instruction : nouname -a console: microsecond timers : yes console: tlb_entries : 32 console: extra interrupt vector : yes console: hardware watchpoint : yes, count: 1, address/irw mask: [0x0ff8] console: isa : mips1 mips2 mips3 mips4 mips5 mips32r1 mips32r2 mips64r1 mips64r2 console: ASEs implemented : console: shadow register sets : 1 console: kscratch registers : 0 console: package : 0 console: core : 0 console: VCED exceptions : not available console: VCEI exceptions : not available console: / # console: / # uname -a console: Linux buildroot 3.19.3.mtoman.20150408 #3 Wed Apr 8 14:32:50 UTC 2015 mips64 GNU/Linux console: reboot console: / # console: / # reboot console: / # console: / # reboot: Restarting system PASS (7.04 s) JOB TIME : 7.20 s Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20191028073441.6448-27-philmd@redhat.com> Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Cleber Rosa <crosa@redhat.com> Tested-by: Cleber Rosa <crosa@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
2019-10-28tests/boot_linux_console: Add initrd test for the Exynos4210Philippe Mathieu-Daudé1-0/+41
This test boots a Linux kernel on a smdkc210 board and verify the serial output is working. The cpio image used comes from the linux-build-test project: https://github.com/groeck/linux-build-test If ARM is a target being built, "make check-acceptance" will automatically include this test by the use of the "arch:arm" tags. This test can be run using: $ IGNORE_AVOCADO_CONSOLE_BUG=yes \ avocado --show=app,console run -t machine:smdkc210 \ tests/acceptance/boot_linux_console.py console: Booting Linux on physical CPU 0x900 console: Linux version 4.19.0-6-armmp (debian-kernel@lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-6)) #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20) console: CPU: ARMv7 Processor [410fc090] revision 0 (ARMv7), cr=10c5387d console: CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache console: OF: fdt: Machine model: Samsung smdkv310 evaluation board based on Exynos4210 [...] console: Samsung CPU ID: 0x43210211 console: random: get_random_bytes called from start_kernel+0xa0/0x504 with crng_init=0 console: percpu: Embedded 17 pages/cpu s39756 r8192 d21684 u69632 console: Built 1 zonelists, mobility grouping on. Total pages: 249152 console: Kernel command line: printk.time=0 console=ttySAC0,115200n8 earlyprintk random.trust_cpu=off cryptomgr.notests cpuidle.off=1 panic=-1 noreboot [...] console: L2C: platform modifies aux control register: 0x02020000 -> 0x3e420001 console: L2C: platform provided aux values permit register corruption. console: L2C: DT/platform modifies aux control register: 0x02020000 -> 0x3e420001 console: L2C-310 erratum 769419 enabled console: L2C-310 enabling early BRESP for Cortex-A9 console: L2C-310: enabling full line of zeros but not enabled in Cortex-A9 console: L2C-310 ID prefetch enabled, offset 1 lines console: L2C-310 dynamic clock gating disabled, standby mode disabled console: L2C-310 cache controller enabled, 8 ways, 128 kB console: L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x7e420001 console: Exynos4210 clocks: sclk_apll = 12000000, sclk_mpll = 12000000 console: sclk_epll = 12000000, sclk_vpll = 12000000, arm_clk = 12000000 [...] console: s3c-i2c 13860000.i2c: slave address 0x00 console: s3c-i2c 13860000.i2c: bus frequency set to 93 KHz console: s3c-i2c 13860000.i2c: i2c-0: S3C I2C adapter [...] console: dma-pl330 12680000.pdma: Loaded driver for PL330 DMAC-241330 console: dma-pl330 12680000.pdma: DBUFF-256x8bytes Num_Chans-8 Num_Peri-32 Num_Events-16 console: dma-pl330 12690000.pdma: Loaded driver for PL330 DMAC-241330 console: dma-pl330 12690000.pdma: DBUFF-256x8bytes Num_Chans-8 Num_Peri-32 Num_Events-16 console: dma-pl330 12850000.mdma: Loaded driver for PL330 DMAC-241330 console: dma-pl330 12850000.mdma: DBUFF-256x8bytes Num_Chans-8 Num_Peri-1 Num_Events-16 console: dma-pl330 12850000.mdma: PM domain LCD0 will not be powered off console: Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled console: Serial: AMBA driver console: 13800000.serial: ttySAC0 at MMIO 0x13800000 (irq = 40, base_baud = 0) is a S3C6400/10 console: console [ttySAC0] enabled console: 13810000.serial: ttySAC1 at MMIO 0x13810000 (irq = 41, base_baud = 0) is a S3C6400/10 console: 13820000.serial: ttySAC2 at MMIO 0x13820000 (irq = 42, base_baud = 0) is a S3C6400/10 console: 13830000.serial: ttySAC3 at MMIO 0x13830000 (irq = 43, base_baud = 0) is a S3C6400/10 [...] console: Freeing unused kernel memory: 2048K console: Run /init as init process console: mount: mounting devtmpfs on /dev failed: Device or resource busy console: Starting logging: OK console: Initializing random number generator... random: dd: uninitialized urandom read (512 bytes read) console: done. console: Starting network: OK console: Found console ttySAC0 console: Linux version 4.19.0-6-armmp (debian-kernel@lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-6)) #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20) console: Boot successful. PASS (37.98 s) Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20191028073441.6448-25-philmd@redhat.com> Reviewed-by: Cleber Rosa <crosa@redhat.com> Tested-by: Cleber Rosa <crosa@redhat.com> [Cleber: removed conditional to skip test] Signed-off-by: Cleber Rosa <crosa@redhat.com>
2019-10-28tests/boot_linux_console: Add a test for the Raspberry Pi 2Philippe Mathieu-Daudé1-0/+36
Similar to the x86_64/pc test, it boots a Linux kernel on a raspi2 board and verify the serial is working. The kernel image and DeviceTree blob are built by the Raspbian project (based on Debian): https://www.raspbian.org/RaspbianImages as recommended by the Raspberry Pi project: https://www.raspberrypi.org/downloads/raspbian/ If ARM is a target being built, "make check-acceptance" will automatically include this test by the use of the "arch:arm" tags. Alternatively, this test can be run using: $ avocado run -t arch:arm tests/acceptance $ avocado run -t machine:raspi2 tests/acceptance Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Cleber Rosa <crosa@redhat.com> Tested-by: Cleber Rosa <crosa@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20191028073441.6448-21-philmd@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
2019-10-28tests/boot_linux_console: Use Avocado archive::gzip_uncompress()Philippe Mathieu-Daudé1-4/+1
Avocado 67.0 [*] introduced the avocado.utils.archive module which provides handling of gzip files. Use the gzip_uncompress() method. [*] https://avocado-framework.readthedocs.io/en/67.0/api/utils/avocado.utils.html#avocado.utils.archive.gzip_uncompress Suggested-by: Cleber Rosa <crosa@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20191028073441.6448-20-philmd@redhat.com> Reviewed-by: Cleber Rosa <crosa@redhat.com> Tested-by: Cleber Rosa <crosa@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
2019-10-28tests/acceptance: Test OpenBIOS on the PReP/40pPhilippe Mathieu-Daudé1-0/+33
User case from: https://mail.coreboot.org/pipermail/openbios/2018-May/010360.html Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20191028073441.6448-16-philmd@redhat.com> Reviewed-by: Cleber Rosa <crosa@redhat.com> Tested-by: Cleber Rosa <crosa@redhat.com> [Cleber: added skip conditional for Travis] Signed-off-by: Cleber Rosa <crosa@redhat.com>
2019-10-28tests/acceptance: Add test that runs NetBSD 4.0 installer on PRep/40pPhilippe Mathieu-Daudé1-0/+49
As of this commit, NetBSD 4.0 is very old. However it is enough to test the PRep/40p machine. User case from: http://mail-index.netbsd.org/port-prep/2017/04/11/msg000112.html Reviewed-by: Hervé Poussineau <hpoussin@reactos.org> Acked-by: David Gibson <david@gibson.dropbear.id.au> Acked-by: Artyom Tarasenko <atar4qemu@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20191028073441.6448-14-philmd@redhat.com> Reviewed-by: Cleber Rosa <crosa@redhat.com> Tested-by: Cleber Rosa <crosa@redhat.com> [Cleber: fixed file name and imports] Signed-off-by: Cleber Rosa <crosa@redhat.com>
2019-10-28tests/acceptance: Add test that boots the HelenOS microkernel on Leon3Philippe Mathieu-Daudé1-0/+34
Release notes: http://www.helenos.org/wiki/Download#HelenOS0.6.0 Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20191028073441.6448-11-philmd@redhat.com> Reviewed-by: Cleber Rosa <crosa@redhat.com> Tested-by: Cleber Rosa <crosa@redhat.com> [Cleber: added/removed needed/unneeded imports] Signed-off-by: Cleber Rosa <crosa@redhat.com>
2019-10-28tests/acceptance: Refactor exec_command_and_wait_for_pattern()Philippe Mathieu-Daudé2-11/+26
Refactor the exec_command_and_wait_for_pattern() utility method so we can reuse it in other files. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20191028073441.6448-6-philmd@redhat.com> Reviewed-by: Cleber Rosa <crosa@redhat.com> Tested-by: Cleber Rosa <crosa@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
2019-10-28tests/acceptance: Send <carriage return> on serial linesPhilippe Mathieu-Daudé1-1/+1
Some firmwares don't parse the <Newline> control character and expect a <carriage return>. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20191028073441.6448-5-philmd@redhat.com> Reviewed-by: Cleber Rosa <crosa@redhat.com> Tested-by: Cleber Rosa <crosa@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
2019-10-28tests/acceptance: Fix wait_for_console_pattern() hangsPhilippe Mathieu-Daudé1-0/+1
Because of a possible deadlock (QEMU waiting for the socket to become writable) let's close the console socket as soon as we stop to use it. Suggested-by: Cleber Rosa <crosa@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20191028073441.6448-4-philmd@redhat.com> Reviewed-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com> [Cleber: corrected small typo in commit message] Signed-off-by: Cleber Rosa <crosa@redhat.com>
2019-10-28Acceptance tests: refactor wait_for_console_patternCleber Rosa3-37/+33
The same utility method is already present in two different test files, so let's consolidate it into a single utility function. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20190916164011.7653-1-crosa@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> [PMD: failure_message is optional] Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com> Message-Id: <20191028073441.6448-3-philmd@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
2019-10-28Acceptance tests: work around socket dirCleber Rosa1-1/+2
Change 32558ce7a4 introduced specific directories for the socket dir when using python/qemu/machine.py:QEMUMachine. iotests probably didn't catch the condition that two simultaneous QEMUMachine instances, without manually set temporary or socket dirs would clash. Having two QEMUMachine instances is a condition expected for many acceptance tests, and it's already used by the migration tests. Signed-off-by: Cleber Rosa <crosa@redhat.com>
2019-10-28BootLinuxConsoleTest: Test the Quadra 800Philippe Mathieu-Daudé1-0/+24
This test boots a Linux kernel on a Quadra 800 board and verify the serial is working. Example: $ avocado --show=app,console run -t machine:q800 tests/acceptance/boot_linux_console.py console: ABCFGHIJK console: Linux version 5.2.0-2-m68k (debian-kernel@lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-21)) #1 Debian 5.2.9-2 (2019-08-21) console: Detected Macintosh model: 35 console: Apple Macintosh Quadra 800 console: Built 1 zonelists, mobility grouping on. Total pages: 32448 console: Kernel command line: printk.time=0 console=ttyS0 vga=off [...] console: Calibrating delay loop... 1236.99 BogoMIPS (lpj=6184960) [...] console: NuBus: Scanning NuBus slots. console: Slot 9: Board resource not found! console: SCSI subsystem initialized console: clocksource: Switched to clocksource via1 [...] console: macfb: framebuffer at 0xf9001000, mapped to 0x(ptrval), size 468k console: macfb: mode is 800x600x8, linelength=800 console: Console: switching to colour frame buffer device 100x37 console: fb0: DAFB frame buffer device console: pmac_zilog: 0.6 (Benjamin Herrenschmidt <benh@kernel.crashing.org>) console: scc.0: ttyS0 at MMIO 0x50f0c022 (irq = 4, base_baud = 230400) is a Z85c30 ESCC - Serial port console: scc.1: ttyS1 at MMIO 0x50f0c020 (irq = 4, base_baud = 230400) is a Z85c30 ESCC - Serial port console: Non-volatile memory driver v1.3 console: adb: Mac II ADB Driver v1.0 for Unified ADB console: mousedev: PS/2 mouse device common for all mice console: random: fast init done console: Detected ADB keyboard, type <unknown>. console: input: ADB keyboard as /devices/virtual/input/input0 console: input: ADB mouse as /devices/virtual/input/input1 console: rtc-generic rtc-generic: registered as rtc0 console: ledtrig-cpu: registered to indicate activity on CPUs [...] console: rtc-generic rtc-generic: setting system clock to 2019-09-10T16:20:25 UTC (1568132425) console: List of all partitions: console: No filesystem could mount root, tried: JOB TIME : 2.91 s Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Tested-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20190910163430.11326-1-f4bug@amsat.org> Signed-off-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20191026164546.30020-12-laurent@vivier.eu> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2019-10-25tests/ssh_linux_malta: Fix 64-bit target testsPhilippe Mathieu-Daudé1-6/+6
Commit 9090d3332cdcc added tests for specific to the 32-bit machines, which inadvertently make the 64-bit tests failing. Now than we have this information available in the CPU_INFO array, use it to have the 64-bit tests back. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com> Message-Id: <20191019153437.9820-12-f4bug@amsat.org>
2019-10-25tests/ssh_linux_malta: Refactor how to get image/kernel infoPhilippe Mathieu-Daudé1-31/+44
The qcow and kernel images use a similar pattern regarding they are for big/little endianess, or 32/64 bit. Refactor using more dictionary keys. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com> Message-Id: <20191019153437.9820-11-f4bug@amsat.org>
2019-10-25tests/ssh_linux_malta: Match stricter console outputPhilippe Mathieu-Daudé1-9/+9
Match on stricter console output. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com> Message-Id: <20191019153437.9820-10-f4bug@amsat.org>
2019-10-25tests/ssh_linux_malta: Remove duplicated testPhilippe Mathieu-Daudé1-3/+0
Remove duplicated test (probably copy/paste error in commit 9090d3332cdcc). Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com> Message-Id: <20191019153437.9820-9-f4bug@amsat.org>
2019-10-25tests/ssh_linux_malta: Run tests using a snapshot imagePhilippe Mathieu-Daudé1-1/+1
If a test fails, it can corrupt the underlying QCow2 image, making further tests failing. Fix this by running each test with a snapshot. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com> Message-Id: <20191019153437.9820-8-f4bug@amsat.org>
2019-09-20Acceptance tests: use avocado.utils.ssh for SSH interactionCleber Rosa1-54/+24
This replaces paramiko with avocado.utils.ssh module, which is based on a (open)ssh binary, supposedly more ubiquitous. Signed-off-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20190919225905.10829-1-crosa@redhat.com> [Cleber: consolidated existing skipUnless from tests to setUp] Signed-off-by: Cleber Rosa <crosa@redhat.com>
2019-09-20tests/acceptance: Add new test cases in linux_ssh_mips_malta.pyAleksandar Markovic1-0/+45
Add 15 new tests cases. They all rely on simple commands used for detecting hardware configuration information. Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com> Message-Id: <1564760158-27536-3-git-send-email-aleksandar.markovic@rt-rk.com> Reviewed-by: Cleber Rosa <crosa@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2019-09-20tests/acceptance: Refactor and improve reporting in linux_ssh_mips_malta.pyAleksandar Markovic1-15/+21
This patch restructures code organization around the test case executions. At the same time, rather than outputing a cryptic message: FAIL: True not found in [False], the following will be reported too, if the command output does not meet specified expectations: 'lspci -d 11ab:4620' output doesn't contain the word 'GT-64120' Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com> Message-Id: <1564760158-27536-2-git-send-email-aleksandar.markovic@rt-rk.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2019-09-20Acceptance test x86_cpu_model_versions: split into smaller testsCleber Rosa1-8/+15
The justifications being automatic destruction of the vm instances when no longer needed and more compact test naming under a common class. Besides those, a smaller test makes the one and only assertion rather obvious, which suggests that we could even get rid of the more verbose (and manual) error messages (to be decided). Naming of the tests tries to follow the following pattern: test_($cpu_version)_($no_arch_capabitilies_set_or_unset)_($machine_version) The presence of each naming component is optional, depending on whether the test manually sets it or not. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20190828193628.7687-4-crosa@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2019-09-20Acceptance test x86_cpu_model_versions: fix mismatches between test and messagesCleber Rosa1-3/+3
This fixes a few mismatches between the test and the error messages produced in case of failures. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20190828193628.7687-3-crosa@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2019-09-20Acceptance test x86_cpu_model_versions: shutdown VMsCleber Rosa1-0/+7
This shuts down the VMs that won't be used any longer during the remainder of the test. It's debatable if the very last one should also be shutdown manually, and my opinion is that it shouldn't because that's taken care by the immediately following tearDown(). Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20190828193628.7687-2-crosa@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2019-09-20Acceptance test machine_m68k_nextcube.py: relax the error code patternCleber Rosa1-1/+1
Instead of looking for a specific error, let's relax the pattern because different errors have been seen (I'm consistenly getting 52) and the real goal of this test is to validate the framebuffer operation, and not to reproduce one specific error. Signed-off-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Thomas Huth <huth@tuxfamily.org> Message-Id: <20190919161400.26399-1-crosa@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
2019-09-19BootLinuxSshTest: Only run the tests when explicitly requestedPhilippe Mathieu-Daudé1-5/+5
Currently the Avocado framework does not distinct the time spent downloading assets vs. the time spent running a test. With big assets (like a full VM image) the tests likely fail. This is a limitation known by the Avocado team. Until this issue get fixed, do not run this tests automatically. Tests can still be run setting the AVOCADO_TIMEOUT_EXPECTED environment variable. Reported-by: Gerd Hoffmann <kraxel@redhat.com> Reported-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20190918122748.2144-1-philmd@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
2019-09-18tests/acceptance: Specify arch for QueryCPUModelExpansionDavid Gibson1-0/+3
At the moment this test runs on whatever the host arch is. But it looks for 'unavailable-features' which is an x86 specific cpu property. Tag it to always use qemu-system-x86_64. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20190918070654.19356-1-david@gibson.dropbear.id.au> Signed-off-by: Cleber Rosa <crosa@redhat.com>
2019-09-10Fedora images: use URLs from stable "archives.fedoraproject.org"Cleber Rosa2-12/+18
The LinuxInitrd.test_with_2gib_file_should_work_with_linux_v4_16 test, from tests/acceptance/linux_initrd.py, is currently failing to fetch the "vmlinuz" file. The reason for the failure is that the Fedora project retires older versions from the "dl.fedoraproject.org" URL, and keeps them in "archives.fedoraproject.org". As an added note, that test uses a Fedora 28 image, because of the specific Linux kernel version requirements of the test. For the sake of stability, let's use URLs from the archived and supposedely ever stable URLs. The good news is that the currently supported versions are also hosted on the later. This change limits itself to change the URLs, while keeping the fetched files the same (as can be evidenced by the unchanged hashes). Documentation and the "vm tests" fedora definition were also updated. Signed-off-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Yash Mankad <ymankad@redhat.com> Message-Id: <20190904005218.12536-1-crosa@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2019-09-07tests/acceptance: Add test of NeXTcube framebuffer using OCRPhilippe Mathieu-Daudé1-0/+121
Add a test of the NeXTcube framebuffer using the Tesseract OCR engine on a screenshot of the framebuffer device. The test is very quick: $ avocado --show=app,console run tests/acceptance/machine_m68k_nextcube.py JOB ID : 78844a92424cc495bd068c3874d542d1e20f24bc JOB LOG : /home/phil/avocado/job-results/job-2019-08-13T13.16-78844a9/job.log (1/3) tests/acceptance/machine_m68k_nextcube.py:NextCubeMachine.test_bootrom_framebuffer_size: PASS (2.16 s) (2/3) tests/acceptance/machine_m68k_nextcube.py:NextCubeMachine.test_bootrom_framebuffer_ocr_with_tesseract_v3: - ue r pun Honl'flx ; 5‘ 55‘ avg ncaaaaa 25 MHZ, memary jag m Backplane slat «a Ethernet address a a r a r3 2 Memgry sackets aea canflqured far 16MB Darlly page made stMs but have 16MB page made stMs )nstalled Memgry sackets a and 1 canflqured far 16MB Darlly page made stMs but have 16MB page made stMs )nstalled [...] Yestlnq the rpu, 5:: system test raneg Errar egge 51 Egg: cammand Default pggc devlce nut fauna NEXY>I PASS (2.64 s) (3/3) tests/acceptance/machine_m68k_nextcube.py:NextCubeMachine.test_bootrom_framebuffer_ocr_with_tesseract_v4: SKIP: tesseract v4 OCR tool not available RESULTS : PASS 2 | ERROR 0 | FAIL 0 | SKIP 1 | WARN 0 | INTERRUPT 0 | CANCEL 0 JOB TIME : 5.35 s Documentation on how to install tesseract: https://github.com/tesseract-ocr/tesseract/wiki#installation Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20190813134921.30602-2-philmd@redhat.com> Signed-off-by: Thomas Huth <huth@tuxfamily.org>
2019-09-04Merge remote-tracking branch ↵Peter Maydell1-0/+35
'remotes/ehabkost/tags/machine-next-pull-request' into staging Machine + x86 queue, 2019-09-03 Bug fixes: * Fix die-id validation regression (Eduardo Habkost) * vmmouse: Properly reset state (Jan Kiszka) * hostmem-file: fix pmem file size check (Stefan Hajnoczi) * Keep query-hotpluggable-cpus output compatible with older QEMU if '-smp dies' is not set (Igor Mammedov) * migration: Do not re-read the clock on pre_save in case of paused guest (Maxiwell S. Garcia) Cleanups: * NUMA code cleanups (Tao Xu) * Remove stale externs from includes (Alex Bennée) Features: * qapi: report the default CPU type for each machine (Daniel P. Berrangé) # gpg: Signature made Tue 03 Sep 2019 21:57:37 BST # gpg: using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6 # gpg: issuer "ehabkost@redhat.com" # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full] # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6 * remotes/ehabkost/tags/machine-next-pull-request: migration: Do not re-read the clock on pre_save in case of paused guest x86: do not advertise die-id in query-hotpluggbale-cpus if '-smp dies' is not set i386/vmmouse: Properly reset state hostmem-file: fix pmem file size check qapi: report the default CPU type for each machine pc: Don't make die-id mandatory unless necessary pc: Improve error message when die-id is omitted pc: Fix error message on die-id validation numa: move numa global variable numa_info into MachineState numa: move numa global variable have_numa_distance into MachineState numa: move numa global variable nb_numa_nodes into MachineState hw/arm: simplify arm_load_dtb includes: remove stale [smp|max]_cpus externs Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-09-03pc: Don't make die-id mandatory unless necessaryEduardo Habkost1-0/+35
We have this issue reported when using libvirt to hotplug CPUs: https://bugzilla.redhat.com/show_bug.cgi?id=1741451 Basically, libvirt is not copying die-id from query-hotpluggable-cpus, but die-id is now mandatory. We could blame libvirt and say it is not following the documented interface, because we have this buried in the QAPI schema documentation: > Note: currently there are 5 properties that could be present > but management should be prepared to pass through other > properties with device_add command to allow for future > interface extension. This also requires the filed names to be kept in > sync with the properties passed to -device/device_add. But I don't think this would be reasonable from us. We can just make QEMU more flexible and let die-id to be omitted when there's no ambiguity. This will allow us to keep compatibility with existing libvirt versions. Test case included to ensure we don't break this again. Fixes: commit 176d2cda0dee ("i386/cpu: Consolidate die-id validity in smp context") Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20190816170750.23910-1-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2019-09-03Merge remote-tracking branch 'remotes/cleber/tags/python-next-pull-request' ↵Peter Maydell4-5/+24
into staging Python (acceptance tests) queue, 2019-08-28 # gpg: Signature made Thu 29 Aug 2019 02:11:22 BST # gpg: using RSA key 7ABB96EB8B46B94D5E0FE9BB657E8D33A5F209F3 # gpg: Good signature from "Cleber Rosa <crosa@redhat.com>" [marginal] # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 7ABB 96EB 8B46 B94D 5E0F E9BB 657E 8D33 A5F2 09F3 * remotes/cleber/tags/python-next-pull-request: VNC Acceptance test: simplify test names Boot Linux Console Test: add a test for ppc64 + pseries Acceptance tests: drop left over usage of ":avocado: enable" tests/requirements.txt: pin paramiko version requirement tests.acceptance.avocado_qemu: Add support for powerpc Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-08-28VNC Acceptance test: simplify test namesCleber Rosa1-2/+2
The test name is composed of the class name and method name, so it looks like there's some redundancy here that we can eliminate. Signed-off-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20190607152223.9467-7-crosa@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
2019-08-28Boot Linux Console Test: add a test for ppc64 + pseriesCleber Rosa1-0/+19
Just like the previous tests, boots a Linux kernel on a ppc64 target using the pseries machine. Signed-off-by: Cleber Rosa <crosa@redhat.com> CC: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Message-Id: <20190607152223.9467-5-crosa@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
2019-08-28Acceptance tests: drop left over usage of ":avocado: enable"Cleber Rosa1-3/+0
Commit 9531d26c10 removed all of ":avocado: enable" tags, but then a new entry was added with the introduction of migration.py. Let's remove it for consistency. Signed-off-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20190607152223.9467-4-crosa@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
2019-08-28tests.acceptance.avocado_qemu: Add support for powerpcSatheesh Rajendran1-0/+3
Current acceptance test will not run properly in powerpc environment due qemu target is different from arch, this usually matches, except with bi-endian architectures like ppc64. uname would return `ppc64` or `ppc64le` based `big` or `little` endian but qemu `target` is always `ppc64`. Let's handle it. Reviewed-by: Cédric Le Goater <clg@kaod.org> Signed-off-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com> Message-Id: <20190819082820.14817-1-sathnaga@linux.vnet.ibm.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Cleber Rosa <crosa@redhat.com>
2019-08-27BootLinuxSshTest: Only use 'test' for unittest.TestCase method namesPhilippe Mathieu-Daudé1-5/+5
In commit f6e501a28ef9, Eduardo started to use "check_" as a prefix for methods of similar purpose. Follow this prior art, since it might become the conventions when writting Avocado tests. Suggested-by: Cleber Rosa <crosa@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20190607174953.22342-1-philmd@redhat.com> Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Cleber Rosa <crosa@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2019-07-05i386: Add Cascadelake-Server-v2 CPU modelEduardo Habkost1-0/+73
Add new version of Cascadelake-Server CPU model, setting stepping=5 and enabling the IA32_ARCH_CAPABILITIES MSR with some flags. The new feature will introduce a new host software requirement, breaking our CPU model runnability promises. This means we can't enable the new CPU model version by default in QEMU 4.1, because management software isn't ready yet to resolve CPU model aliases. This is why "pc-*-4.1" will keep returning Cascadelake-Server-v1 if "-cpu Cascadelake-Server" is specified. Includes a test case to ensure the right combinations of machine-type + CPU model + command-line feature flags will work as expected. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20190628002844.24894-10-ehabkost@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20190703221723.8161-1-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>