X-Git-Url: https://repo.jachan.dev/qemu.git/blobdiff_plain/9ab5a24b5298ae8272607a8ffc9ba20c15acefaa..e95e05dab6607d9e86cd2eaa3ae4508bf7bb8fbb:/scripts/device-crash-test diff --git a/scripts/device-crash-test b/scripts/device-crash-test index b32aa93f89..305d0427af 100755 --- a/scripts/device-crash-test +++ b/scripts/device-crash-test @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright (c) 2017 Red Hat Inc # @@ -23,8 +23,8 @@ Run QEMU with all combinations of -machine and -device types, check for crashes and unexpected errors. """ -from __future__ import print_function +import os import sys import glob import logging @@ -34,7 +34,8 @@ import random import argparse from itertools import chain -from qemu import QEMUMachine +sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'python')) +from qemu.machine import QEMUMachine logger = logging.getLogger('device-crash-test') dbg = logger.debug @@ -82,7 +83,6 @@ ERROR_WHITELIST = [ {'device':'isa-ipmi-bt', 'expected':True}, # IPMI device requires a bmc attribute to be set {'device':'isa-ipmi-kcs', 'expected':True}, # IPMI device requires a bmc attribute to be set {'device':'isa-parallel', 'expected':True}, # Can't create serial device, empty char device - {'device':'ivshmem', 'expected':True}, # You must specify either 'shm' or 'chardev' {'device':'ivshmem-doorbell', 'expected':True}, # You must specify a 'chardev' {'device':'ivshmem-plain', 'expected':True}, # You must specify a 'memdev' {'device':'loader', 'expected':True}, # please include valid arguments @@ -558,7 +558,8 @@ def main(): logger.info("Skipped %d test cases", skipped) if args.debug: - stats = sorted([(len(wl_stats.get(i, [])), wl) for i, wl in enumerate(ERROR_WHITELIST)]) + stats = sorted([(len(wl_stats.get(i, [])), wl) for i, wl in + enumerate(ERROR_WHITELIST)], key=lambda x: x[0]) for count, wl in stats: dbg("whitelist entry stats: %d: %r", count, wl)