Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20190719' into staging
[qemu/ar7.git] / tests / acceptance / cpu_queries.py
blobe71edec39fcbd98f178c55b7215479a53b67ccaa
1 # Sanity check of query-cpu-* results
3 # Copyright (c) 2019 Red Hat, Inc.
5 # Author:
6 # Eduardo Habkost <ehabkost@redhat.com>
8 # This work is licensed under the terms of the GNU GPL, version 2 or
9 # later. See the COPYING file in the top-level directory.
11 import logging
13 from avocado_qemu import Test
15 class QueryCPUModelExpansion(Test):
16 """
17 Run query-cpu-model-expansion for each CPU model, and validate results
18 """
20 def test(self):
21 self.vm.set_machine('none')
22 self.vm.add_args('-S')
23 self.vm.launch()
25 cpus = self.vm.command('query-cpu-definitions')
26 for c in cpus:
27 print(repr(c))
28 self.assertNotIn('', c['unavailable-features'], c['name'])
30 for c in cpus:
31 model = {'name': c['name']}
32 e = self.vm.command('query-cpu-model-expansion', model=model, type='full')
33 self.assertEquals(e['model']['name'], c['name'])