On Thu, Apr 08, 2021 at 04:52:31PM -0300, Wainer dos Santos Moschetta wrote: > 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() >
So I tried a few tests with different CPU models and it works as expected. One minor caveat is that using "host" has side effects in some cases, causing tests to fail because they may also require KVM to be enabled. But this is a generic mechanism so I don't think it should be concerned with that. > 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 Only thing is: can we please just break this line (I could not ignore a 174 character line :). > > Signed-off-by: Wainer dos Santos Moschetta <waine...@redhat.com> > --- > docs/devel/testing.rst | 17 +++++++++++++++++ > tests/acceptance/avocado_qemu/__init__.py | 5 +++++ > 2 files changed, 22 insertions(+) With the line broken mentioned above (which I can take care of when queueing this patch): Reviewed-by: Cleber Rosa <cr...@redhat.com> Tested-by: Cleber Rosa <cr...@redhat.com>
signature.asc
Description: PGP signature