]> Git Repo - qemu.git/blobdiff - scripts/device-crash-test
virtio-iommu: Fix coverity issue in virtio_iommu_handle_command()
[qemu.git] / scripts / device-crash-test
index 483dafb2fc019c281eab5076460a4811e3d21014..305d0427af61430dfe920c597e4d0bed36018369 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 #
 #  Copyright (c) 2017 Red Hat Inc
 #
 #
 #  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.
 """
 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
 import sys
 import glob
 import logging
@@ -34,7 +34,8 @@ import random
 import argparse
 from itertools import chain
 
 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
 
 logger = logging.getLogger('device-crash-test')
 dbg = logger.debug
@@ -557,7 +558,8 @@ def main():
         logger.info("Skipped %d test cases", skipped)
 
     if args.debug:
         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)
 
         for count, wl in stats:
             dbg("whitelist entry stats: %d: %r", count, wl)
 
This page took 0.023718 seconds and 4 git commands to generate.