Re: [Qemu-devel] [PATCH 1/1] Introduce a Python module structure

2019-02-18 Thread Caio Carrara
e code > * have a proper place for the module's own unittests > * apply a more consistent style > * generate documentation > > Signed-off-by: Cleber Rosa Reviewed-by: Caio Carrara > --- > configure | 1 + >

Re: [Qemu-devel] [PATCH] Acceptance tests: drop usage of ":avocado: enable"

2019-02-18 Thread Caio Carrara
ts that would not inherit > directly from "avocado.Test". This is not necessary anymore, > and because of that the boiler plate statements can now be removed. > > Reference: > https://avocado-framework.readthedocs.io/en/68.0/release_notes/68_0.html#users-test-writer

[Qemu-devel] [PATCH v3 2/2] tests.acceptance: adds simple migration test

2019-02-12 Thread Caio Carrara
This change adds the simplest possible migration test. Beyond the test purpose itself it's also useful to exercise the multi virtual machines capabilities from base avocado qemu test class. Signed-off-by: Cleber Rosa Signed-off-by: Caio Carrara --- tests/acceptance/migration.py

[Qemu-devel] [PATCH v3 0/2] tests.acceptance: adds multi vm capability and basic migration test

2019-02-12 Thread Caio Carrara
tests and test cases that can be added, but I'm assuming this patch is complete enough and other series can be sent after covering the other cases. Caio Carrara (2): tests.acceptance: adds multi vm capability for acceptance tests tests.acceptance: adds simple migration test do

[Qemu-devel] [PATCH v3 1/2] tests.acceptance: adds multi vm capability for acceptance tests

2019-02-12 Thread Caio Carrara
m in tests will not be broken by this change since it keeps a property called vm in the base test class. This property only calls the new method `get_vm` with default parameters (no args and 'default' as machine name). Signed-off-by: Caio Carrara --- docs/devel/testing.rst

Re: [Qemu-devel] [PATCH v2 1/2] tests.acceptance: adds multi vm capability for acceptance tests

2019-01-29 Thread Caio Carrara
Hi, Wainer. On Mon, Jan 28, 2019 at 05:42:24PM -0200, Wainer dos Santos Moschetta wrote: > > On 01/28/2019 03:47 PM, Caio Carrara wrote: > > This change adds the possibility to write acceptance tests with multi > > virtual machine support. It's done keeping the v

[Qemu-devel] [PATCH v2 2/2] Acceptance tests: add simple migration test

2019-01-28 Thread Caio Carrara
From: Cleber Rosa This is the simplest possible migration test, exercising the multi VM capabilities of the test class. Signed-off-by: Cleber Rosa --- tests/acceptance/migration.py | 45 +++ 1 file changed, 45 insertions(+) create mode 100644 tests/acceptance/m

[Qemu-devel] [PATCH v2 0/2] Acceptance tests: adds multi vm capability and basic migration test

2019-01-28 Thread Caio Carrara
dead code". There are more tests and test cases that can be added, but I'm assuming this patch is complete enough and other series can be sent after covering the other cases. Caio Carrara (1): tests.acceptance: adds multi vm capability for acceptance tests Cleber Rosa (1): Acceptan

[Qemu-devel] [PATCH v2 1/2] tests.acceptance: adds multi vm capability for acceptance tests

2019-01-28 Thread Caio Carrara
m in tests will not be broken by this change since it keeps a property called vm in the base test class. This property only calls the new method `get_vm` with default parameters (no args and 'default' as machine name). Signed-off-by: Caio Carrara --- docs/devel/testing.rst

Re: [Qemu-devel] [PATCH 17/18] Boot Linux Console Test: add a test for s390x + s390-ccw-virtio

2019-01-21 Thread Caio Carrara
t the one set with set_console() works > correctly. > > Signed-off-by: Cleber Rosa Reviewed-by: Caio Carrara > --- > .travis.yml| 2 +- > tests/acceptance/boot_linux_console.py | 20 > 2 files changed, 21 insertions(+), 1 dele

Re: [Qemu-devel] [PATCH 12/18] Boot Linux Console Test: add a test for mips + malta

2019-01-21 Thread Caio Carrara
un -t machine:malta tests/acceptance > $ avocado run -t endian:big tests/acceptance > > Signed-off-by: Philippe Mathieu-Daudé > Signed-off-by: Cleber Rosa Reviewed-by: Caio Carrara > --- > .travis.yml| 2 +- > scripts/qemu.py

Re: [Qemu-devel] [PATCH 16/18] Boot Linux Console Test: add a test for arm + virt

2019-01-21 Thread Caio Carrara
On Thu, Jan 17, 2019 at 01:56:26PM -0500, Cleber Rosa wrote: > Just like the previous tests, boots a Linux kernel on an arm target > using the virt machine. > > Signed-off-by: Cleber Rosa Reviewed-by: Caio Carrara > --- > .travis.yml| 2 +- &

Re: [Qemu-devel] [PATCH 11/18] scripts/qemu.py: support adding a console with the default serial device

2019-01-21 Thread Caio Carrara
the behavior of set_console() now flags the intention > to add a console device on launch(), and if no explicit device type is > given, and there's no definition on CONSOLE_DEV_TYPES, the "-serial" > is going to be added to the QEMU command line, instead of rais

Re: [Qemu-devel] [PATCH 14/18] Boot Linux Console Test: add a test for ppc64 + pseries

2019-01-21 Thread Caio Carrara
On Thu, Jan 17, 2019 at 01:56:24PM -0500, Cleber Rosa wrote: > Just like the previous tests, boots a Linux kernel on a ppc64 target > using the pseries machine. > > Signed-off-by: Cleber Rosa Reviewed-by: Caio Carrara > --- > .travis.yml| 2 +-

Re: [Qemu-devel] [PATCH 01/18] scripts/qemu.py: log QEMU launch command line

2019-01-21 Thread Caio Carrara
On Thu, Jan 17, 2019 at 01:56:11PM -0500, Cleber Rosa wrote: > Even when the launch of QEMU succeeds, it's useful to have the command > line recorded. > > Signed-off-by: Cleber Rosa Reviewed-by: Caio Carrara > --- > scripts/qemu.py | 1 + > 1 file changed, 1 inse

Re: [Qemu-devel] [PATCH 15/18] Boot Linux Console Test: add a test for aarch64 + virt

2019-01-21 Thread Caio Carrara
default CPU (cortex-a15). > > Signed-off-by: Cleber Rosa Reviewed-by: Caio Carrara > --- > .travis.yml| 2 +- > tests/acceptance/boot_linux_console.py | 20 > 2 files changed, 21 insertions(+), 1 deletion(-) > {...} > -

Re: [Qemu-devel] [PATCH 13/18] Boot Linux Console Test: add a test for mips64el + malta

2019-01-21 Thread Caio Carrara
is test by the use of the "arch:mips" tags. > > Alternatively, this test can be run using: > > $ avocado run -t arch:mips64el tests/acceptance > $ avocado run -t machine:malta tests/acceptance > > Signed-off-by: Philippe Mathieu-Daudé > Signed-off-by: Cle

Re: [Qemu-devel] [PATCH 18/18] Boot Linux Console Test: add a test for alpha + clipper

2019-01-21 Thread Caio Carrara
eptance > $ avocado run -t machine:clipper tests/acceptance > > Signed-off-by: Philippe Mathieu-Daudé > Signed-off-by: Cleber Rosa Reviewed-by: Caio Carrara > --- > .travis.yml| 2 +- > scripts/qemu.py| 1 - > te

Re: [Qemu-devel] [PATCH 08/18] Boot Linux Console Test: rename the x86_64 after the arch and machine

2019-01-21 Thread Caio Carrara
gt; Signed-off-by: Cleber Rosa Reviewed-by: Caio Carrara > --- > tests/acceptance/boot_linux_console.py | 11 +++ > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/tests/acceptance/boot_linux_console.py > b/tests/acceptance/boot_linux_console.py &g

Re: [Qemu-devel] [PATCH 03/18] Acceptance tests: improve docstring on pick_default_qemu_bin()

2019-01-21 Thread Caio Carrara
On Thu, Jan 17, 2019 at 01:56:13PM -0500, Cleber Rosa wrote: > Making it clear what is returned by this utility function. > > Signed-off-by: Cleber Rosa > Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Caio Carrara > --- > tests/acceptance/avocado_qemu/__init__.py

Re: [Qemu-devel] [PATCH 02/18] Acceptance tests: show avocado test execution by default

2019-01-21 Thread Caio Carrara
can always choose a different output by setting the AVOCADO_SHOW > variable. > > Signed-off-by: Cleber Rosa Reviewed-by: Caio Carrara > --- > .travis.yml| 2 +- > tests/Makefile.include | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a

Re: [Qemu-devel] [PATCH 10/18] Boot Linux Console Test: refactor the console watcher into utility method

2019-01-21 Thread Caio Carrara
On Thu, Jan 17, 2019 at 01:56:20PM -0500, Cleber Rosa wrote: > This introduces a utility method that monitors the console device and > looks for either a message that signals the test success or failure. > > Signed-off-by: Cleber Rosa Reviewed-by: Caio Carrara > --- >

Re: [Qemu-devel] [PATCH 09/18] Boot Linux Console Test: update the x86_64 kernel

2019-01-21 Thread Caio Carrara
On Thu, Jan 17, 2019 at 01:56:19PM -0500, Cleber Rosa wrote: > To the stock Fedora 29 kernel, from the Fedora 28. New tests will be > added using the 29 kernel, so for consistency, let's also update it > here. > > Signed-off-by: Cleber Rosa Reviewed-by: Caio Carrara >

Re: [Qemu-devel] [PATCH 07/18] Acceptance tests: look for target architecture in test tags first

2019-01-21 Thread Caio Carrara
do run aarch64.py > > The target binary selection mechanism will attempt to find a binary > such as "aarch64-softmmu/qemu-system-aarch64". > > At this time, no provision is made to cancel the execution of tests if > the arch parameter given (manually) does not

Re: [Qemu-devel] [PATCH 06/18] Acceptance tests: use "arch:" tag to filter target specific tests

2019-01-21 Thread Caio Carrara
64 > > This means that it can be filtered (out) when no x86_64 target is > available. At the same time, tests that don't have a "arch:" tag, > will not be filtered out. > > Signed-off-by: Cleber Rosa Reviewed-by: Caio Carrara > --- > tests/Makefile.

Re: [Qemu-devel] [PATCH 04/18] Acceptance tests: fix doc reference to avocado_qemu directory

2019-01-21 Thread Caio Carrara
hat text was moved to the top level docs directory, the > reference was not updated. > > Signed-off-by: Cleber Rosa Reviewed-by: Caio Carrara > --- > docs/devel/testing.rst | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/docs/devel/tes

Re: [Qemu-devel] [PATCH 05/18] Acceptance tests: introduce arch parameter and attribute

2019-01-18 Thread Caio Carrara
> default=pick_default_qemu_bin(self.arch)) Since it was used the named argument in function declaration I think it's more consistent also use the argument name here in the function call: `pick_default_qemu_bin(arch=self.arch)` > if self.qemu_bin is None: > self.cancel("No QEMU binary defined or found in the source tree") > self.vm = QEMUMachine(self.qemu_bin) > -- > 2.20.1 > Thanks, -- Caio Carrara Software Engineer, Virt Team - Red Hat ccarr...@redhat.com

[Qemu-devel] [PATCH] tests.acceptance: adds multi vm capability for acceptance tests

2019-01-14 Thread Caio Carrara
m in tests will not be broken by this change since it keeps a property called vm in the base test class. This property only calls the new method `get_vm` with default parameters (no args and 'default' as machine name). Signed-off-by: Caio Carrara --- docs/devel/testing.rst

Re: [Qemu-devel] [PATCH] target/i386: Fixes to the check missing features routine

2018-12-09 Thread Caio Carrara
al testing only because the list of > expected > +unavailable features depend on the actual host CPU knowledge. > +""" > +expected_cpu = 'Cascadelake-Server' > +expected_unavailable_features = ["hle", "rtm",

Re: [Qemu-devel] [PATCH for-4.0 v4 2/2] virtio: Provide version-specific variants of virtio PCI devices

2018-12-07 Thread Caio Carrara
casts in the code will keep > working for all variants. > > A simple test script (tests/acceptance/virtio_version.py) is > included, to check if the new device types are equivalent to > using the `disable-legacy` and `disable-modern` options. > > Acked-by: Andrea Bolognani &g

Re: [Qemu-devel] [PATCH v2] scripts/qemu.py: allow to launch the VM without a monitor

2018-11-29 Thread Caio Carrara
Hi Wainer, Thanks for your reply. I pretty much agreed with most of it. I just added a comment about that new method that is not used anywere. On Thu, Nov 29, 2018 at 10:45:33AM -0200, Wainer dos Santos Moschetta wrote: > > On 11/26/2018 10:58 AM, Caio Carrara wrote: > > On Wed, Nov

Re: [Qemu-devel] [RFC PATCH] Introduce Python module structure

2018-11-27 Thread Caio Carrara
On Tue, Nov 27, 2018 at 03:02:03PM -0500, Cleber Rosa wrote: > > > On 11/27/18 2:00 PM, Caio Carrara wrote: > > Hi, Cleber. > > > > On Tue, Nov 27, 2018 at 05:50:34AM -0500, Cleber Rosa wrote: > >> This is a simple move of Python code that wraps common QEMU &

Re: [Qemu-devel] [RFC PATCH] Introduce Python module structure

2018-11-27 Thread Caio Carrara
lable > import subprocess > import hashlib > import optparse > @@ -28,6 +26,13 @@ import shutil > import multiprocessing > import traceback > > +THIS_DIR = os.path.dirname(os.path.abspath(__file__)) > +TOP_DIR = os.path.dirname(os.path.dirname(THIS_DIR)) > +PYTHON_MODULE_PATH = os.path.join(TOP_DIR, 'python') > +sys.path.append(PYTHON_MODULE_PATH) > + > +from qemu import QEMUMachine, kvm_available > + > SSH_KEY = open(os.path.join(os.path.dirname(__file__), > "..", "keys", "id_rsa")).read() > SSH_PUB_KEY = open(os.path.join(os.path.dirname(__file__), > -- > 2.19.1 > Thanks, -- Caio Carrara Software Engineer, Virt Team - Red Hat ccarr...@redhat.com

Re: [Qemu-devel] [PATCH for-4.0 v3 2/2] virtio: Provide version-specific variants of virtio PCI devices

2018-11-27 Thread Caio Carrara
On Tue, Nov 27, 2018 at 11:06:17AM -0200, Eduardo Habkost wrote: > On Tue, Nov 27, 2018 at 10:56:21AM -0200, Caio Carrara wrote: > > Hello, Eduardo. > > > > Just some minor comments regarding the Python code. > > > [...] > > > +def devtype_implements(vm,

Re: [Qemu-devel] [PATCH for-4.0 v3 2/2] virtio: Provide version-specific variants of virtio PCI devices

2018-11-27 Thread Caio Carrara
; +self.check_all_variants('virtio-scsi-pci', VIRTIO_SCSI) > +# virtio-9p requires 'fsdev' parameter > +#self.check_all_variants('virtio-9p-pci', VIRTIO_9P) > + > +def check_modern_only(self, qemu_devtype, virtio_devid): > +"""Check if a modern-only virtio device type behaves as expected""" > +# Force modern mode: > +dev_modern,_ = self.run_device(qemu_devtype, > + > 'disable-modern=off,disable-legacy=on') > +self.assert_devids(dev_modern, pci_modern_device_id(virtio_devid), > + non_transitional=True) > + > +# No options: should be modern anyway > +dev_no_opts,ifaces = self.run_device(qemu_devtype) > +self.assertEqual(dev_modern, dev_no_opts) > + > +self.assertIn('conventional-pci-device', ifaces) > +self.assertIn('pci-express-device', ifaces) > + > +def test_modern_only_devs(self): > +self.check_modern_only('virtio-vga', VIRTIO_GPU) > +self.check_modern_only('virtio-gpu-pci', VIRTIO_GPU) > +self.check_modern_only('virtio-mouse-pci', VIRTIO_INPUT) > +self.check_modern_only('virtio-tablet-pci', VIRTIO_INPUT) > +self.check_modern_only('virtio-keyboard-pci', VIRTIO_INPUT) > -- > 2.18.0.rc1.1.g3f1ff2140 > Thanks, -- Caio Carrara Software Engineer, Virt Team - Red Hat ccarr...@redhat.com

Re: [Qemu-devel] [PATCH v2] scripts/qemu.py: allow to launch the VM without a monitor

2018-11-26 Thread Caio Carrara
m.shutdown() > > self.vm.set_qmp_monitor(disabled=False) > self.vm._args.remove('--foobar') # Hack > self.vm.launch() > res = self.vm.command('human-monitor-command', > command_line='info version'

Re: [Qemu-devel] [PATCH] scripts/qemu.py: allow to launch the VM without a monitor

2018-11-21 Thread Caio Carrara
x27;none'] if self._with_qmp: args.extend(['-chardev', self._get_moncdev_args(), '-mon', 'chardev=mon,mode=control']) if self._machine is not None: ``` Does it make sense? > {...} > > -- > Eduardo -- Caio Carrara Software Engineer, Virt Team - Red Hat ccarr...@redhat.com

Re: [Qemu-devel] [PATCH] Acceptance tests: add Linux initrd checking test

2018-10-18 Thread Caio Carrara
thod). AFIK we're moving towards only Py3 support on the acceptance tests, right? The current behavior (error) is the expected? Since the comment above is just for clarification and not a blocking issue: Reviewed-by: Caio Carrara Tested-by: Caio Carrara -- Caio Carrara Software Engineer, Virt Team Red Hat ccarr...@redhat.com

Re: [Qemu-devel] [PATCH v6 0/3] Bootstrap Python venv and acceptance/functional tests

2018-10-17 Thread Caio Carrara
ain the exact environment that > tests may require. > > There's one current caveat: it requires Python 3, as it's based on the > venv module. This was based on some discussions and perception about > standardizing on Python 3, but can easily be made to accommodate Python >

Re: [Qemu-devel] [PATCH v4 1/3] Bootstrap Python venv for tests

2018-10-15 Thread Caio Carrara
equirements.txt b/tests/venv-requirements.txt > new file mode 100644 > index 000000..d39f9d1576 > --- /dev/null > +++ b/tests/venv-requirements.txt > @@ -0,0 +1,3 @@ > +# Add Python module requirements, one per line, to be installed > +# in the tests/venv Python virtual environment. For more info, > +# refer to: https://pip.pypa.io/en/stable/user_guide/#id1 > -- Caio Carrara Software Engineer, Virt Team Red Hat ccarr...@redhat.com

Re: [Qemu-devel] [PATCH v4 1/3] Bootstrap Python venv for tests

2018-10-15 Thread Caio Carrara
VENV_DIR) >>> + >>> # Consolidated targets >>> >>> .PHONY: check-qapi-schema check-qtest check-unit check check-clean >>> @@ -1030,6 +1049,7 @@ check-clean: >>> rm -rf $(check-unit-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y) >>> rm -rf $(sort $(foreach target,$(SYSEMU_TARGET_LIST), >>> $(check-qtest-$(target)-y)) $(check-qtest-generic-y)) >>> rm -f tests/test-qapi-gen-timestamp >>> + rm -rf $(TESTS_VENV_DIR) >>> >>> clean: check-clean >>> >>> diff --git a/tests/venv-requirements.txt b/tests/venv-requirements.txt >>> new file mode 100644 >>> index 00..d39f9d1576 >>> --- /dev/null >>> +++ b/tests/venv-requirements.txt >>> @@ -0,0 +1,3 @@ >>> +# Add Python module requirements, one per line, to be installed >>> +# in the tests/venv Python virtual environment. For more info, >>> +# refer to: https://pip.pypa.io/en/stable/user_guide/#id1 >>> >> >> Tested-by: Philippe Mathieu-Daudé > -- Caio Carrara Software Engineer, Virt Team Red Hat ccarr...@redhat.com