Python queue, 2019-01-17
Fixes: * Actually test different Python versions on Travis CI * Fix qemu.py error message when qemu dies from signal Cleanups: * Track Python version on config-host.mak * Remove fixed crashes from scripts/device-crash-test * Acceptance tests: Linux initrd checking test * Fix utf-8 mangling at scripts/replay-dump.py * Remove unused python imports from multiple scripts -----BEGIN PGP SIGNATURE----- iQIbBAABCAAGBQJcQOKpAAoJECgHk2+YTcWmgLAP9iUNYnlap3xhawaeisljxZjZ E0BDyfX2ADelqRTqkueT5g3yfk/3K4C+TeL1cB4R+Y3M3TRj2dnedA55zcfxvgL9 vhJMsVPGW1HMYKghwlXy5OadfBJFJvR5kWST6DsF5ICIfxLluBAKQjQmxZRxnvau 8YnSxel0g2AjOWJ/RH8oDqmj9KJnJ4wwjCPLDc6ciEOWB0JkmkMC4p9Xlrce6y57 SosCAX9+JYRzk/tXgLritYI1zjZDgKVozoL7R4DA1M1wCP+4hWNPxzk8GflcyvvP I/O3A13h2NHIg2naZjXNkHr0Xo1VJMIByx79wDgIsbb3BrvwjoIHxQLwYHo4bpVd qiZ7Sgh9fDbgamMmLeTLrR/h46JR6ywAsK7epx0EgBfIvkWI3SXWXXTyrdl3Av57 EE+sH+p9Q40un4tb/C2+aLn0Q5u2VU6oqotJ3l7kp7DU7ROpsAQwCxOYOHqM+X0g tCQox8ghYOQwoc6+EDQwffJaedoVhlZo+mpXDx8PS9eHYny7nstK9+f7Dr7Q82KL gC8lxMa7g5Dk5MVU63zAPUhwQvakP16IpLbK27EuTC304wAHfbTsuyOYr445IgZc KP4QzcTLcTI9GdEi7R3c2tjDbJXR8tmpUa+4jBfEcCAMiL/ay/z2IcwwPXBBubiA 3BE39e1g/vjKbPXyoPk= =T5Wa -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/ehabkost/tags/python-next-pull-request' into staging Python queue, 2019-01-17 Fixes: * Actually test different Python versions on Travis CI * Fix qemu.py error message when qemu dies from signal Cleanups: * Track Python version on config-host.mak * Remove fixed crashes from scripts/device-crash-test * Acceptance tests: Linux initrd checking test * Fix utf-8 mangling at scripts/replay-dump.py * Remove unused python imports from multiple scripts # gpg: Signature made Thu 17 Jan 2019 20:16:41 GMT # gpg: using RSA key 2807936F984DC5A6 # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6 * remotes/ehabkost/tags/python-next-pull-request: scripts/replay-dump.py: fix utf-8 mangling qemu.py: Fix error message when qemu dies from signal Acceptance tests: add Linux initrd checking test check-help: visual and content improvements Travis CI: make specified Python versions usable on jobs check-venv: use recorded Python version configure: keep track of Python version scripts: Remove unused python imports scripts/device-crash-test: Remove known crashes Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
9bd641b10a
@ -175,12 +175,14 @@ matrix:
|
|||||||
# Python builds
|
# Python builds
|
||||||
- env:
|
- env:
|
||||||
- CONFIG="--target-list=x86_64-softmmu"
|
- CONFIG="--target-list=x86_64-softmmu"
|
||||||
|
language: python
|
||||||
python:
|
python:
|
||||||
- "3.0"
|
- "3.4"
|
||||||
|
|
||||||
|
|
||||||
- env:
|
- env:
|
||||||
- CONFIG="--target-list=x86_64-softmmu"
|
- CONFIG="--target-list=x86_64-softmmu"
|
||||||
|
language: python
|
||||||
python:
|
python:
|
||||||
- "3.6"
|
- "3.6"
|
||||||
|
|
||||||
|
6
configure
vendored
6
configure
vendored
@ -1797,6 +1797,9 @@ if ! $python -c 'import sys; sys.exit(sys.version_info < (2,7))'; then
|
|||||||
"Use --python=/path/to/python to specify a supported Python."
|
"Use --python=/path/to/python to specify a supported Python."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Preserve python version since some functionality is dependent on it
|
||||||
|
python_version=$($python -V 2>&1 | sed -e 's/Python\ //')
|
||||||
|
|
||||||
# Suppress writing compiled files
|
# Suppress writing compiled files
|
||||||
python="$python -B"
|
python="$python -B"
|
||||||
|
|
||||||
@ -6010,7 +6013,7 @@ echo "LDFLAGS $LDFLAGS"
|
|||||||
echo "QEMU_LDFLAGS $QEMU_LDFLAGS"
|
echo "QEMU_LDFLAGS $QEMU_LDFLAGS"
|
||||||
echo "make $make"
|
echo "make $make"
|
||||||
echo "install $install"
|
echo "install $install"
|
||||||
echo "python $python"
|
echo "python $python ($python_version)"
|
||||||
if test "$slirp" = "yes" ; then
|
if test "$slirp" = "yes" ; then
|
||||||
echo "smbd $smbd"
|
echo "smbd $smbd"
|
||||||
fi
|
fi
|
||||||
@ -6959,6 +6962,7 @@ echo "INSTALL_DATA=$install -c -m 0644" >> $config_host_mak
|
|||||||
echo "INSTALL_PROG=$install -c -m 0755" >> $config_host_mak
|
echo "INSTALL_PROG=$install -c -m 0755" >> $config_host_mak
|
||||||
echo "INSTALL_LIB=$install -c -m 0644" >> $config_host_mak
|
echo "INSTALL_LIB=$install -c -m 0644" >> $config_host_mak
|
||||||
echo "PYTHON=$python" >> $config_host_mak
|
echo "PYTHON=$python" >> $config_host_mak
|
||||||
|
echo "PYTHON_VERSION=$python_version" >> $config_host_mak
|
||||||
echo "CC=$cc" >> $config_host_mak
|
echo "CC=$cc" >> $config_host_mak
|
||||||
if $iasl -h > /dev/null 2>&1; then
|
if $iasl -h > /dev/null 2>&1; then
|
||||||
echo "IASL=$iasl" >> $config_host_mak
|
echo "IASL=$iasl" >> $config_host_mak
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import os
|
|
||||||
import simpletrace
|
import simpletrace
|
||||||
import argparse
|
import argparse
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
@ -23,7 +23,6 @@ import json
|
|||||||
import os
|
import os
|
||||||
import argparse
|
import argparse
|
||||||
import collections
|
import collections
|
||||||
import pprint
|
|
||||||
|
|
||||||
def mkdir_p(path):
|
def mkdir_p(path):
|
||||||
try:
|
try:
|
||||||
|
@ -26,7 +26,6 @@ check for crashes and unexpected errors.
|
|||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
|
||||||
import glob
|
import glob
|
||||||
import logging
|
import logging
|
||||||
import traceback
|
import traceback
|
||||||
@ -181,21 +180,6 @@ ERROR_WHITELIST = [
|
|||||||
# other exitcode=1 failures not listed above will just generate INFO messages:
|
# other exitcode=1 failures not listed above will just generate INFO messages:
|
||||||
{'exitcode':1, 'loglevel':logging.INFO},
|
{'exitcode':1, 'loglevel':logging.INFO},
|
||||||
|
|
||||||
# KNOWN CRASHES:
|
|
||||||
# Known crashes will generate error messages, but won't be fatal.
|
|
||||||
# Those entries must be removed once we fix the crashes.
|
|
||||||
{'exitcode':-6, 'log':r"Device 'serial0' is in use", 'loglevel':logging.ERROR},
|
|
||||||
{'exitcode':-6, 'log':r"qemu_net_client_setup: Assertion `!peer->peer' failed", 'loglevel':logging.ERROR},
|
|
||||||
{'exitcode':-6, 'log':r'RAMBlock "[\w.-]+" already registered', 'loglevel':logging.ERROR},
|
|
||||||
{'exitcode':-6, 'log':r"find_ram_offset: Assertion `size != 0' failed.", 'loglevel':logging.ERROR},
|
|
||||||
{'exitcode':-6, 'log':r"add_cpreg_to_hashtable: code should not be reached", 'loglevel':logging.ERROR},
|
|
||||||
{'exitcode':-6, 'log':r"qemu_alloc_display: Assertion `surface->image != NULL' failed", 'loglevel':logging.ERROR},
|
|
||||||
{'exitcode':-6, 'log':r"Unexpected error in error_set_from_qdev_prop_error", 'loglevel':logging.ERROR},
|
|
||||||
{'exitcode':-6, 'log':r"Object .* is not an instance of type spapr-machine", 'loglevel':logging.ERROR},
|
|
||||||
{'exitcode':-6, 'log':r"Object .* is not an instance of type generic-pc-machine", 'loglevel':logging.ERROR},
|
|
||||||
{'exitcode':-6, 'log':r"Object .* is not an instance of type e500-ccsr", 'loglevel':logging.ERROR},
|
|
||||||
{'exitcode':-6, 'log':r"vmstate_register_with_alias_id: Assertion `!se->compat \|\| se->instance_id == 0' failed", 'loglevel':logging.ERROR},
|
|
||||||
|
|
||||||
# everything else (including SIGABRT and SIGSEGV) will be a fatal error:
|
# everything else (including SIGABRT and SIGSEGV) will be a fatal error:
|
||||||
{'exitcode':None, 'fatal':True, 'loglevel':logging.FATAL},
|
{'exitcode':None, 'fatal':True, 'loglevel':logging.FATAL},
|
||||||
]
|
]
|
||||||
|
@ -351,7 +351,7 @@ class QEMUMachine(object):
|
|||||||
command = ' '.join(self._qemu_full_args)
|
command = ' '.join(self._qemu_full_args)
|
||||||
else:
|
else:
|
||||||
command = ''
|
command = ''
|
||||||
LOG.warn(msg, exitcode, command)
|
LOG.warn(msg, -exitcode, command)
|
||||||
|
|
||||||
self._launched = False
|
self._launched = False
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
# Dump the contents of a recorded execution stream
|
# Dump the contents of a recorded execution stream
|
||||||
#
|
#
|
||||||
# Copyright (c) 2017 Alex Bennée <alex.bennee@linaro.org>
|
# Copyright (c) 2017 Alex Bennée <alex.bennee@linaro.org>
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or
|
# This library is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU Lesser General Public
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import struct
|
import struct
|
||||||
import re
|
|
||||||
import inspect
|
import inspect
|
||||||
from tracetool import read_events, Event
|
from tracetool import read_events, Event
|
||||||
from tracetool.backend.simple import is_string
|
from tracetool.backend.simple import is_string
|
||||||
|
@ -15,8 +15,6 @@ __email__ = "stefanha@linux.vnet.ibm.com"
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
import getopt
|
import getopt
|
||||||
import os.path
|
|
||||||
import re
|
|
||||||
|
|
||||||
from tracetool import error_write, out
|
from tracetool import error_write, out
|
||||||
import tracetool.backend
|
import tracetool.backend
|
||||||
|
@ -14,7 +14,7 @@ __email__ = "stefanha@redhat.com"
|
|||||||
|
|
||||||
|
|
||||||
from tracetool import out
|
from tracetool import out
|
||||||
from tracetool.backend.dtrace import binary, probeprefix
|
from tracetool.backend.dtrace import probeprefix
|
||||||
from tracetool.backend.simple import is_string
|
from tracetool.backend.simple import is_string
|
||||||
from tracetool.format.stap import stap_escape
|
from tracetool.format.stap import stap_escape
|
||||||
|
|
||||||
|
@ -3,7 +3,8 @@
|
|||||||
check-help:
|
check-help:
|
||||||
@echo "Regression testing targets:"
|
@echo "Regression testing targets:"
|
||||||
@echo
|
@echo
|
||||||
@echo " $(MAKE) check Run all tests"
|
@echo " $(MAKE) check Run unit, qapi-schema, qtest and decodetree"
|
||||||
|
@echo
|
||||||
@echo " $(MAKE) check-qtest-TARGET Run qtest tests for given target"
|
@echo " $(MAKE) check-qtest-TARGET Run qtest tests for given target"
|
||||||
@echo " $(MAKE) check-qtest Run qtest tests"
|
@echo " $(MAKE) check-qtest Run qtest tests"
|
||||||
@echo " $(MAKE) check-unit Run qobject tests"
|
@echo " $(MAKE) check-unit Run qobject tests"
|
||||||
@ -12,12 +13,13 @@ check-help:
|
|||||||
@echo " $(MAKE) check-block Run block tests"
|
@echo " $(MAKE) check-block Run block tests"
|
||||||
@echo " $(MAKE) check-tcg Run TCG tests"
|
@echo " $(MAKE) check-tcg Run TCG tests"
|
||||||
@echo " $(MAKE) check-acceptance Run all acceptance (functional) tests"
|
@echo " $(MAKE) check-acceptance Run all acceptance (functional) tests"
|
||||||
|
@echo
|
||||||
@echo " $(MAKE) check-report.html Generates an HTML test report"
|
@echo " $(MAKE) check-report.html Generates an HTML test report"
|
||||||
@echo " $(MAKE) check-venv Creates a Python venv for tests"
|
@echo " $(MAKE) check-venv Creates a Python venv for tests"
|
||||||
@echo " $(MAKE) check-clean Clean the tests"
|
@echo " $(MAKE) check-clean Clean the tests and related data"
|
||||||
@echo
|
@echo
|
||||||
@echo "Please note that HTML reports do not regenerate if the unit tests"
|
@echo "Please note that HTML reports do not regenerate if the unit tests"
|
||||||
@echo "has not changed."
|
@echo "have not changed."
|
||||||
@echo
|
@echo
|
||||||
@echo "The variable SPEED can be set to control the gtester speed setting."
|
@echo "The variable SPEED can be set to control the gtester speed setting."
|
||||||
@echo "Default options are -k and (for $(MAKE) V=1) --verbose; they can be"
|
@echo "Default options are -k and (for $(MAKE) V=1) --verbose; they can be"
|
||||||
@ -958,8 +960,7 @@ TESTS_RESULTS_DIR=$(BUILD_DIR)/tests/results
|
|||||||
# information please refer to "avocado --help".
|
# information please refer to "avocado --help".
|
||||||
AVOCADO_SHOW=none
|
AVOCADO_SHOW=none
|
||||||
|
|
||||||
PYTHON3 = $(shell $(PYTHON) -c 'import sys; print(1 if sys.version_info >= (3, 0) else 0)')
|
ifneq ($(findstring v2,"v$(PYTHON_VERSION)"),v2)
|
||||||
ifeq ($(PYTHON3), 1)
|
|
||||||
$(TESTS_VENV_DIR): $(TESTS_VENV_REQ)
|
$(TESTS_VENV_DIR): $(TESTS_VENV_REQ)
|
||||||
$(call quiet-command, \
|
$(call quiet-command, \
|
||||||
$(PYTHON) -m venv --system-site-packages $@, \
|
$(PYTHON) -m venv --system-site-packages $@, \
|
||||||
|
48
tests/acceptance/linux_initrd.py
Normal file
48
tests/acceptance/linux_initrd.py
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
# Linux initrd acceptance test.
|
||||||
|
#
|
||||||
|
# Copyright (c) 2018 Red Hat, Inc.
|
||||||
|
#
|
||||||
|
# Author:
|
||||||
|
# Wainer dos Santos Moschetta <wainersm@redhat.com>
|
||||||
|
#
|
||||||
|
# This work is licensed under the terms of the GNU GPL, version 2 or
|
||||||
|
# later. See the COPYING file in the top-level directory.
|
||||||
|
|
||||||
|
import tempfile
|
||||||
|
from avocado.utils.process import run
|
||||||
|
|
||||||
|
from avocado_qemu import Test
|
||||||
|
|
||||||
|
|
||||||
|
class LinuxInitrd(Test):
|
||||||
|
"""
|
||||||
|
Checks QEMU evaluates correctly the initrd file passed as -initrd option.
|
||||||
|
|
||||||
|
:avocado: enable
|
||||||
|
:avocado: tags=x86_64
|
||||||
|
"""
|
||||||
|
|
||||||
|
timeout = 60
|
||||||
|
|
||||||
|
def test_with_2gib_file_should_exit_error_msg(self):
|
||||||
|
"""
|
||||||
|
Pretends to boot QEMU with an initrd file with size of 2GiB
|
||||||
|
and expect it exits with error message.
|
||||||
|
"""
|
||||||
|
kernel_url = ('https://mirrors.kernel.org/fedora/releases/28/'
|
||||||
|
'Everything/x86_64/os/images/pxeboot/vmlinuz')
|
||||||
|
kernel_hash = '238e083e114c48200f80d889f7e32eeb2793e02a'
|
||||||
|
kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
|
||||||
|
max_size = 2 * (1024 ** 3) - 1
|
||||||
|
|
||||||
|
with tempfile.NamedTemporaryFile() as initrd:
|
||||||
|
initrd.seek(max_size)
|
||||||
|
initrd.write(b'\0')
|
||||||
|
initrd.flush()
|
||||||
|
cmd = "%s -kernel %s -initrd %s" % (self.qemu_bin, kernel_path,
|
||||||
|
initrd.name)
|
||||||
|
res = run(cmd, ignore_status=True)
|
||||||
|
self.assertEqual(res.exit_status, 1)
|
||||||
|
expected_msg = r'.*initrd is too large.*max: \d+, need %s.*' % (
|
||||||
|
max_size + 1)
|
||||||
|
self.assertRegex(res.stderr_text, expected_msg)
|
Loading…
Reference in New Issue
Block a user