summaryrefslogtreecommitdiffstats
path: root/tests/acceptance
Commit message (Collapse)AuthorAgeFilesLines
* tests/acceptance: rename tests acceptance to tests avocadoWillian Rampazzo2021-11-0851-6754/+0Star
| | | | | | | | | | | | | | | | | | | In the discussion about renaming the `tests/acceptance` [1], the conclusion was that the folders inside `tests` are related to the framework running the tests and not directly related to the type of the tests. This changes the folder to `tests/avocado` and adjusts the MAKEFILE, the CI related files and the documentation. [1] https://lists.gnu.org/archive/html/qemu-devel/2021-05/msg06553.html Reviewed-by: Niek Linnenbank <nieklinnenbank@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Willian Rampazzo <willianr@redhat.com> Message-Id: <20211105155354.154864-3-willianr@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
* tests/acceptance: Add a test for the bamboo ppc boardThomas Huth2021-10-211-0/+39
| | | | | | | | | | | The kernel and initrd from the "Aboriginal Linux" project can be used to run some tests on the bamboo ppc machine. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <20211015090008.1299609-1-thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* tests/acceptance: Add tests for the ppc405 boardsThomas Huth2021-10-211-0/+42
| | | | | | | | | | | | Using the U-Boot firmware, we can check that at least the serial console of the ppc405 boards is still usable. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <20211011125930.750217-1-thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> [dwg: Added an extra tag at Philippe's suggestion] Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* tests/acceptance: Test powernv machinesCédric Le Goater2021-09-271-0/+35
| | | | | | | | | | | | | | | Fetch the OpenPOWER images to boot the powernv8 and powernv9 machines with a simple PCI layout. Cc: Cleber Rosa <crosa@redhat.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: Wainer dos Santos Moschetta <wainersm@redhat.com> Signed-off-by: Cédric Le Goater <clg@kaod.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210817093036.1288791-1-clg@kaod.org>
* tests/acceptance/ppc_prep_40p.py: clean up unused importCleber Rosa2021-09-271-1/+0Star
| | | | | | | | | Just a removal of an unused imported symbol. Signed-off-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210924185506.2542588-16-crosa@redhat.com>
* tests/acceptance/ppc_prep_40p.py: NetBSD 7.1.2 location updateCleber Rosa2021-09-271-2/+2
| | | | | | | | | | | | | | The NetBSD-7.1.2-prep.iso is no longer available on the CDN, but it's still available in the archive. Let's update its location so that users without the file on cache can still fetch it and run the test. Signed-off-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210924185506.2542588-15-crosa@redhat.com>
* tests/acceptance/boot_xen.py: removed unused importCleber Rosa2021-09-271-1/+0Star
| | | | | | | | | Just a clean up for an unused import. Signed-off-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210924185506.2542588-13-crosa@redhat.com>
* acceptance/tests/vnc.py: use explicit syntax for enabling passwordsCleber Rosa2021-09-271-1/+1
| | | | | | | | | | This matches the command line on 82a17d1d67, where the "on" or "off" should be explicitly given. Signed-off-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210924185506.2542588-9-crosa@redhat.com>
* qemu: Split machine_ppc.py acceptance testsDavid Gibson2021-09-274-69/+101
| | | | | | | | | | | | | | | | machine_ppc.py contains tests for 3 different ppc based machine types. It is listed in MAINTAINERS along with the PPC TCG cpu code. That's not really accurate though, since it's really more about testing those machines than the CPUs. Therefore, split it up into separate files for the separate machine types, and list those along with their machine types in MAINTAINERS. Suggested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210927044808.73391-2-david@gibson.dropbear.id.au>
* avocado_qemu: fix inheritance order on LinuxTest classWillian Rampazzo2021-09-271-1/+1
| | | | | | | | | | Class hierarchy on Python is defined from right to left. Although the current code is not harmful, let's fix it to avoid problems in the future. Signed-off-by: Willian Rampazzo <willianr@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210920204932.94132-7-willianr@redhat.com>
* avocado_qemu: explicitly return None to avoid R1710Willian Rampazzo2021-09-271-0/+1
| | | | | | | | | | | The linter is complaining the `pick_default_qemu_bin` is not explicitly returning None. Fix it to explicitly return None and avoid R1710 inconsistent-return-statements. Signed-off-by: Willian Rampazzo <willianr@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210920204932.94132-6-willianr@redhat.com>
* avocado_qemu: tweak ssh connect methodWillian Rampazzo2021-09-271-2/+2
| | | | | | | | | | | | The current implementation will crash if the connection fails as the `time` module is not imported. Fix the import problem. While here, tweaks the connection to wait progressively when the connection fails. Signed-off-by: Willian Rampazzo <willianr@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> [PMD: Reworded description] Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210920204932.94132-5-willianr@redhat.com>
* avocado_qemu: fix import module based on isortWillian Rampazzo2021-09-271-13/+5Star
| | | | | | | Signed-off-by: Willian Rampazzo <willianr@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210920204932.94132-4-willianr@redhat.com>
* avocado_qemu: standardize super() call following PEP3135Willian Rampazzo2021-09-271-2/+2
| | | | | | | | | | | PEP3135 states when calling super(), there is no need to use arguments. This changes the calls on avocado_qemu to standardize according to PEP3135 and avoid warnings from linters. Signed-off-by: Willian Rampazzo <willianr@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210920204932.94132-3-willianr@redhat.com>
* Acceptance Tests: add standard clean up at test tearDown()Cleber Rosa2021-09-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | The avocado.Test class, used as the basis of the avocado_qemu.Test class, performs a clean of temporary directories up as part of its own tearDown() implementation. But the avocado_qemu.Test class is currently missing the same clean up, as it implemented its own tearDown() method without resorting to the upper class behavior. This brings avocado_qemu.Test behavior in sync with the standard avocado.Test behavior and prevents temporary directories from cluttering the test results directory (unless instructed to do so with Avocado's "--keep-tmp" option). Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Cleber Rosa <crosa@redhat.com> [willianr: respin to new Python super format] Signed-off-by: Willian Rampazzo <willianr@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210920204932.94132-2-willianr@redhat.com>
* tests/acceptance: Linux boot test for record/replayPavel Dovgalyuk2021-09-271-0/+116
| | | | | | | | | | | | | | | | | | | | | | | This patch adds a test for record/replay, which boots Linux image from the disk and interacts with the network. The idea and code of this test is borrowed from boot_linux.py This test includes only x86_64 platform. Other platforms and machines will be added later after testing and improving record/replay to completely support them. Each test consists of the following phases: - downloading the disk image - recording the execution - replaying the execution Replay does not validates the output, but waits until QEMU finishes the execution. This is reasonable, because QEMU usually hangs when replay goes wrong. Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <162737554047.1735673.13133593401566029378.stgit@pasha-ThinkPad-X280>
* tests/acceptance: add replay kernel test for alphaPavel Dovgalyuk2021-09-271-0/+17
| | | | | | | | | | | This patch adds record/replay test which boots Linux kernel on alpha platform. The test uses kernel binaries taken from boot_linux_console test. Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <162737553482.1735673.10021851966976933952.stgit@pasha-ThinkPad-X280>
* tests/acceptance: add replay kernel test for nios2Pavel Dovgalyuk2021-09-271-0/+11
| | | | | | | | | | | This patch adds record/replay test which boots Linux kernel on nios2 platform. The test uses kernel binaries taken from boot_linux_console test. Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <162737552919.1735673.12493523185952280539.stgit@pasha-ThinkPad-X280>
* tests/acceptance: add replay kernel test for openriscPavel Dovgalyuk2021-09-271-0/+11
| | | | | | | | | | | This patch adds record/replay test which boots Linux kernel on openrisc platform. The test uses kernel binaries taken from boot_linux_console test. Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <162737552350.1735673.14603125561530143423.stgit@pasha-ThinkPad-X280>
* tests/acceptance: add replay kernel test for s390xPavel Dovgalyuk2021-09-271-0/+15
| | | | | | | | | | | | | This patch adds record/replay test which boots Linux kernel on s390x platform. The test uses kernel binaries taken from boot_linux_console test. Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Acked-by: Thomas Huth <thuth@redhat.com> [PMD: Drop default '-smp 1' as suggested by Thomas] Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <162737551785.1735673.6775108576116333386.stgit@pasha-ThinkPad-X280>
* tests: Remove uses of deprecated raspi2/raspi3 machine namesPhilippe Mathieu-Daudé2021-09-011-3/+3
| | | | | | | | | | | Commit 155e1c82ed0 deprecated the raspi2/raspi3 machine names. Use the recommended new names: raspi2b and raspi3b. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Message-id: 20210827060815.2384760-2-f4bug@amsat.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* tests/acceptance/virtio-gpu.py: provide kernel and initrd hashesCleber Rosa2021-07-201-4/+6
| | | | | | | | | | | By providing kernel and initrd hashes, the test guarantees the integrity of the images used and avoids the warnings set by fetch_asset() when hashes are lacking. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20210714174051.28164-7-crosa@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
* tests/acceptance/virtio-gpu.py: use virtio-vga-glCleber Rosa2021-07-201-2/+2
| | | | | | | | | | | | Since 49afbca3b, the use of an optional virgl renderer is not available anymore, and since b36eb8860f, the way to choose a GL based rendered is to use the "virtio-vga-gl" device. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20210714174051.28164-6-crosa@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
* tests/acceptance/virtio-gpu.py: combine kernel command lineCleber Rosa2021-07-201-9/+3Star
| | | | | | | | | | Both tests use the same kernel command line arguments, so there's no need to have a common and then an additional set of arguments. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20210714174051.28164-5-crosa@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
* tests/acceptance/virtio-gpu.py: combine CPU tagsCleber Rosa2021-07-201-2/+1Star
| | | | | | | | | | Like previously done with the arch tags, all tests use the same CPU value so it's possible to combine them at the class level. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20210714174051.28164-4-crosa@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
* tests/acceptance/virtio-gpu.py: combine x86_64 arch tagsCleber Rosa2021-07-201-2/+1Star
| | | | | | | | | | The test class in question is x86_64 specific, so it's possible to set the tags at the class level. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20210714174051.28164-3-crosa@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
* tests/acceptance/virtio-gpu.py: use require_accelerator()Cleber Rosa2021-07-201-8/+2Star
| | | | | | | | | | Since efe30d501 there's a shorthand for requiring specific accelerators, and canceling the test if it's not available. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20210714174051.28164-2-crosa@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
* tests/acceptance/cpu_queries.py: use the proper logging channelsCleber Rosa2021-07-131-3/+1Star
| | | | | | | | | | | | | The test contains methods for the proper log of test related information. Let's use that and remove the print and the unused logging import. Reference: https://avocado-framework.readthedocs.io/en/87.0/api/test/avocado.html#avocado.Test.log Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20210415215141.1865467-6-crosa@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
* tests/acceptance/linux_ssh_mips_malta.py: drop identical setUpCleber Rosa2021-07-131-5/+2Star
| | | | | | | | | | | | | | | | These tests' setUp do not do anything beyong what their base class do. And while they do decorate the setUp() we can decorate the classes instead, so no functionality is lost here. This is possible because since Avocado 76.0 we can decorate setUp() directly. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20210415215141.1865467-4-crosa@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Willian Rampazzo <willianr@redhat.com> [PMD: added note to commit message about Avocado feature/version] Signed-off-by: Cleber Rosa <crosa@redhat.com>
* tests/acceptance: Handle cpu tag on x86_cpu_model_versions testsWainer dos Santos Moschetta2021-07-131-8/+32
| | | | | | | | | | | | Some test cases on x86_cpu_model_versions.py are corner cases because they need to pass extra options to the -cpu argument. Once the avocado_qemu framework will set -cpu automatically, the value should be reset. This changed those tests so to call set_vm_arg() to overwrite the -cpu value. Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Message-Id: <20210430133414.39905-8-wainersm@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
* tests/acceptance: Add set_vm_arg() to the Test classWainer dos Santos Moschetta2021-07-131-0/+21
| | | | | | | | | | | | The set_vm_arg method is added to avocado_qemu.Test class on this change. Use that method to set (or replace) an argument to the list of arguments given to the QEMU binary. Suggested-by: Cleber Rosa <crosa@redhat.com> Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Message-Id: <20210430133414.39905-7-wainersm@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
* tests/acceptance: Tagging tests with "cpu:VALUE"Wainer dos Santos Moschetta2021-07-134-11/+17
| | | | | | | | | | | | The existing tests which are passing "-cpu VALUE" argument to the vm object are now properly "cpu:VALUE" tagged, so letting the avocado_qemu framework to handle that automatically. Reviewed-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Message-Id: <20210430133414.39905-5-wainersm@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
* tests/acceptance: Let the framework handle "cpu:VALUE" tagged testsWainer dos Santos Moschetta2021-07-136-16/+8Star
| | | | | | | | | | | | | The tests that are already tagged with "cpu:VALUE" don't need to add "-cpu VALUE" to the list of arguments of the vm object because the avocado_qemu framework is able to handle it automatically. Reviewed-by: Cleber Rosa <crosa@redhat.com> Tested-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Message-Id: <20210430133414.39905-4-wainersm@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
* tests/acceptance: Fix mismatch on cpu tagged testsWainer dos Santos Moschetta2021-07-132-6/+6
| | | | | | | | | | | | | There are test cases on machine_mips_malta.py and tcg_plugins.py files where the cpu tag does not correspond to the value actually given to the QEMU binary. This fixed those tests tags. Reviewed-by: Cleber Rosa <crosa@redhat.com> Tested-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Message-Id: <20210430133414.39905-3-wainersm@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
* tests/acceptance: Automatic set -cpu to the test vmWainer dos Santos Moschetta2021-07-131-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces a new feature to the functional tests: automatic setting of the '-cpu VALUE' option to the created vm if the test is tagged with 'cpu:VALUE'. The 'cpu' property is made available to the test object as well. For example, for a simple test as: def test(self): """ :avocado: tags=cpu:host """ self.assertEqual(self.cpu, "host") self.vm.launch() The resulting QEMU evocation will be like: qemu-system-x86_64 -display none -vga none \ -chardev socket,id=mon,path=/var/tmp/avo_qemu_sock_pdgzbgd_/qemu-1135557-monitor.sock \ -mon chardev=mon,mode=control -cpu host Reviewed-by: Cleber Rosa <crosa@redhat.com> Tested-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Message-Id: <20210430133414.39905-2-wainersm@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
* tests/acceptance: Tag NetBSD tests as 'os:netbsd'Philippe Mathieu-Daudé2021-07-132-0/+3
| | | | | | | | | | | | | | | | | | | Avocado allows us to select set of tests using tags. When wanting to run all tests using a NetBSD guest OS, it is convenient to have them tagged, add the 'os:netbsd' tag. It allows one to run the NetBSD tests with: $ avocado --show=app,console run -t os:netbsd tests/acceptance/ Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20210623180021.898286-4-f4bug@amsat.org> Reviewed-by: Niek Linnenbank <nieklinnenbank@gmail.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Reviewed-by: Cleber Rosa <crosa@redhat.com> [PMD: ammend the commit message with example command] Signed-off-by: Cleber Rosa <crosa@redhat.com>
* avocado_qemu: Add Intel iommu testsEric Auger2021-07-131-0/+119
| | | | | | | | | | | | | | | | Add Intel IOMMU functional tests based on fedora 31. Different configs are checked: - strict - caching mode, strict - passthrough. Signed-off-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Willian Rampazzo <willianr@redhat.com> Tested-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Acked-by: Peter Xu <peterx@redhat.com> Message-Id: <20210706131729.30749-5-eric.auger@redhat.com> [CR: split long lines] Signed-off-by: Cleber Rosa <crosa@redhat.com>
* avocado_qemu: Add SMMUv3 testsEric Auger2021-07-131-0/+137
| | | | | | | | | | | | | | | | | | Add new tests checking the good behavior of the SMMUv3 protecting 2 virtio pci devices (block and net). We check the guest boots and we are able to install a package. Different guest configs are tested: standard, passthrough an strict=0. This is tested with both fedora 31 and 33. The former uses a 5.3 kernel without range invalidation whereas the latter uses a 5.8 kernel that features range invalidation. Signed-off-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Tested-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Message-Id: <20210706131729.30749-4-eric.auger@redhat.com> [CR: split long lines] [CR: added MAINTAINERS entry] Signed-off-by: Cleber Rosa <crosa@redhat.com>
* Acceptance Tests: Add default kernel params and pxeboot url to the ↵Willian Rampazzo2021-07-131-3/+55
| | | | | | | | | | | | | | | KNOWN_DISTROS collection When running LinuxTests we may need to run the guest with custom params. It is practical to store the pxeboot URL and the default kernel params so that the tests just need to fetch those and augment the kernel params. Signed-off-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Message-Id: <20210706131729.30749-3-eric.auger@redhat.com> [CR: split long lines] Signed-off-by: Cleber Rosa <crosa@redhat.com>
* avocado_qemu: Fix KNOWN_DISTROS map into the LinuxDistro classWillian Rampazzo2021-07-131-37/+49
| | | | | | | | | | | | | | | | | As the KNOWN_DISTROS grows, more loosely methods will be created in the avocado_qemu/__init__.py file. Let's refactor the code so that KNOWN_DISTROS and related methods are packaged in a class Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Signed-off-by: Eric Auger <eric.auger@redhat.com> Message-Id: <20210706131729.30749-2-eric.auger@redhat.com> [CR: moved aarch64 definition from patch 2 to 1] [CR: protect get() when arch is not defined] [CR: split long lines] Acked-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
* tests/acceptance: Ignore binary data sent on serial consolePhilippe Mathieu-Daudé2021-07-131-2/+5
| | | | | | | | | | | | | | | | | | | | If a guest sends binary data on the serial console, we get: File "tests/acceptance/avocado_qemu/__init__.py", line 92, in _console_interaction msg = console.readline().strip() File "/usr/lib64/python3.8/codecs.py", line 322, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa9 in position 2: invalid start byte Since we use the console with readline(), fix it the easiest way possible: ignore binary data (all current tests compare text string anyway). Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20210515134555.307404-2-f4bug@amsat.org> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Tested-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
* Acceptance Tests: support choosing specific distro and versionCleber Rosa2021-07-131-10/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | The tests based on the LinuxTest class give the test writer a ready to use guest operating system, currently pinned to Fedora 31. With this change, it's now possible to choose different distros and versions, similar to how other tags and parameter can be set for the target arch, accelerator, etc. One of the reasons for this work, is that some development features depend on updates on the guest side. For instance the tests on virtiofs_submounts.py, require newer kernels, and may benefit from running, say on Fedora 34, without the need for a custom kernel. Please notice that the pre-caching of the Fedora 31 images done during the early stages of `make check-acceptance` (before the tests are actually executed) are not expanded here to cover every new image added. But, the tests will download other needed images (and cache them) during the first execution. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20210414221457.1653745-4-crosa@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
* Acceptance Tests: move definition of distro checksums to the frameworkCleber Rosa2021-07-132-14/+37
| | | | | | | | | | | | | | | | | | | Instead of having, by default, the checksum in the tests, and the definition of tests in the framework, let's keep them together. A central definition for distributions is available, and it should allow other known distros to be added more easily. No behavior change is expected here, and tests can still define a distro_checksum value if for some reason they want to override the known distribution information. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20210414221457.1653745-3-crosa@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Acked-by: Eric Auger <eric.auger@redhat.com> [CR: split long lines] Signed-off-by: Cleber Rosa <crosa@redhat.com>
* Acceptance Tests: rename attribute holding the distro image checksumCleber Rosa2021-07-132-6/+10
| | | | | | | | | | | | | | | | | | | This renames the attribute that holds the checksum for the image Linux distribution image used. The current name of the attribute is not very descriptive. Also, in preparation for making the distribution used configurable, which will add distro related parameters, attributes and tags, let's make the naming of those more uniform. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20210414221457.1653745-2-crosa@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> [CR: split long lines] Signed-off-by: Cleber Rosa <crosa@redhat.com>
* Acceptance Tests: distinguish between temp and logs dirCleber Rosa2021-07-131-1/+2
| | | | | | | | | | | | | | | Logs can be very important to debug issues, and currently QEMUMachine instances will remove logs that are created under the temporary directories. With this change, the stdout and stderr generated by the QEMU process started by QEMUMachine will always be kept along the test results directory. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20210211220146.2525771-6-crosa@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
* Acceptance Tests: log information when creating QEMUMachineCleber Rosa2021-07-131-2/+4
| | | | | | | | | | Including its base temporary directory, given that information useful for debugging can be put there. Signed-off-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Message-Id: <20210211220146.2525771-5-crosa@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
* Acceptance Tests: use the job work directory for created VMsCleber Rosa2021-07-131-1/+2
| | | | | | | | | | | | | | | | | The QEMUMachine uses a base temporary directory for all temporary needs. By setting it to the Avocado's workdir, it's possible to keep the temporary files during debugging sessions much more easily by setting the "--keep-tmp" command line option. Reference: https://avocado-framework.readthedocs.io/en/85.0/api/test/avocado.html#avocado.Test.workdir Reference: https://avocado-framework.readthedocs.io/en/85.0/config/index.html#run-keep-tmp Signed-off-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-Id: <20210211220146.2525771-4-crosa@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
* Merge remote-tracking branch 'remotes/philmd/tags/mips-20210702' into stagingPeter Maydell2021-07-041-0/+42
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MIPS patches queue - Extract nanoMIPS, microMIPS, Code Compaction from translate.c - Allow PCI config accesses smaller than 32-bit on Bonito64 device - Fix migration of g364fb device on Jazz Magnum - Fix dp8393x PROM checksum on Jazz Magnum and Quadra 800 - Map the UART devices unconditionally on Jazz Magnum - Add functional test booting Linux on the Fuloong 2E # gpg: Signature made Fri 02 Jul 2021 16:36:19 BST # gpg: using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE # gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full] # Primary key fingerprint: FAAB E75E 1291 7221 DCFD 6BB2 E3E3 2C2C DEAD C0DE * remotes/philmd/tags/mips-20210702: hw/mips/jazz: Map the UART devices unconditionally hw/mips/jazz: specify correct endian for dp8393x device hw/m68k/q800: fix PROM checksum and MAC address storage qemu/bitops.h: add bitrev8 implementation dp8393x: remove onboard PROM containing MAC address and checksum hw/m68k/q800: move PROM and checksum calculation from dp8393x device to board hw/mips/jazz: move PROM and checksum calculation from dp8393x device to board dp8393x: convert to trace-events dp8393x: checkpatch fixes g364fb: add VMStateDescription for G364SysBusState g364fb: use RAM memory region for framebuffer tests/acceptance: Test Linux on the Fuloong 2E machine hw/pci-host/bonito: Allow PCI config accesses smaller than 32-bit hw/pci-host/bonito: Trace PCI config accesses smaller than 32-bit target/mips: Extract nanoMIPS ISA translation routines target/mips: Extract the microMIPS ISA translation routines target/mips: Extract Code Compaction ASE translation routines target/mips: Add declarations for generic TCG helpers Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * tests/acceptance: Test Linux on the Fuloong 2E machinePhilippe Mathieu-Daudé2021-07-021-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test the kernel from Lemote rescue image: http://dev.lemote.com/files/resource/download/rescue/rescue-yl Once downloaded, set the RESCUE_YL_PATH environment variable to point to the downloaded image and test as: $ RESCUE_YL_PATH=~/images/fuloong2e/rescue-yl \ AVOCADO_ALLOW_UNTRUSTED_CODE=1 \ avocado --show=app,console run tests/acceptance/machine_mips_fuloong2e.py Fetching asset from tests/acceptance/machine_mips_fuloong2e.py:MipsFuloong2e.test_linux_kernel_isa_serial (1/1) tests/acceptance/machine_mips_fuloong2e.py:MipsFuloong2e.test_linux_kernel_isa_serial: console: Linux version 2.6.27.7lemote (root@debian) (gcc version 4.1.3 20080623 (prerelease) (Debian 4.1.2-23)) #6 Fri Dec 12 00:11:25 CST 2008 console: busclock=33000000, cpuclock=-2145008360,memsize=256,highmemsize=0 console: console [early0] enabled console: CPU revision is: 00006302 (ICT Loongson-2) PASS (0.16 s) JOB TIME : 0.51 s Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Message-Id: <20210624202747.1433023-5-f4bug@amsat.org>
* | tests: Boot and halt a Linux guest on the Raspberry Pi 2 machinePhilippe Mathieu-Daudé2021-07-021-0/+43
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a test booting and quickly shutdown a raspi2 machine, to test the power management model: (1/1) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_raspi2_initrd: console: [ 0.000000] Booting Linux on physical CPU 0xf00 console: [ 0.000000] Linux version 4.14.98-v7+ (dom@dom-XPS-13-9370) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611)) #1200 SMP Tue Feb 12 20:27:48 GMT 2019 console: [ 0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d console: [ 0.000000] CPU: div instructions available: patching division code console: [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache console: [ 0.000000] OF: fdt: Machine model: Raspberry Pi 2 Model B ... console: Boot successful. console: cat /proc/cpuinfo console: / # cat /proc/cpuinfo ... console: processor : 3 console: model name : ARMv7 Processor rev 5 (v7l) console: BogoMIPS : 125.00 console: Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm console: CPU implementer : 0x41 console: CPU architecture: 7 console: CPU variant : 0x0 console: CPU part : 0xc07 console: CPU revision : 5 console: Hardware : BCM2835 console: Revision : 0000 console: Serial : 0000000000000000 console: cat /proc/iomem console: / # cat /proc/iomem console: 00000000-3bffffff : System RAM console: 00008000-00afffff : Kernel code console: 00c00000-00d468ef : Kernel data console: 3f006000-3f006fff : dwc_otg console: 3f007000-3f007eff : /soc/dma@7e007000 console: 3f00b880-3f00b8bf : /soc/mailbox@7e00b880 console: 3f100000-3f100027 : /soc/watchdog@7e100000 console: 3f101000-3f102fff : /soc/cprman@7e101000 console: 3f200000-3f2000b3 : /soc/gpio@7e200000 PASS (24.59 s) RESULTS : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0 JOB TIME : 25.02 s Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Message-id: 20210531113837.1689775-1-f4bug@amsat.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>