summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.include25
-rw-r--r--tests/acceptance/boot_linux_console.py25
-rw-r--r--tests/acceptance/linux_initrd.py5
-rw-r--r--tests/docker/Makefile.include58
-rwxr-xr-xtests/docker/common.rc4
-rwxr-xr-xtests/docker/docker.py51
-rw-r--r--tests/docker/dockerfiles/debian-alpha-cross.docker7
-rw-r--r--tests/docker/dockerfiles/debian-amd64-cross.docker22
-rw-r--r--tests/docker/dockerfiles/debian-arm64-cross.docker7
-rw-r--r--tests/docker/dockerfiles/debian-armel-cross.docker3
-rw-r--r--tests/docker/dockerfiles/debian-armhf-cross.docker3
-rw-r--r--tests/docker/dockerfiles/debian-buster-arm64-cross.docker16
-rw-r--r--tests/docker/dockerfiles/debian-hppa-cross.docker5
-rw-r--r--tests/docker/dockerfiles/debian-m68k-cross.docker5
-rw-r--r--tests/docker/dockerfiles/debian-mips-cross.docker7
-rw-r--r--tests/docker/dockerfiles/debian-mips64-cross.docker5
-rw-r--r--tests/docker/dockerfiles/debian-mips64el-cross.docker3
-rw-r--r--tests/docker/dockerfiles/debian-mipsel-cross.docker2
-rw-r--r--tests/docker/dockerfiles/debian-powerpc-cross.docker8
-rw-r--r--tests/docker/dockerfiles/debian-powerpc-user-cross.docker8
-rw-r--r--tests/docker/dockerfiles/debian-ppc64-cross.docker7
-rw-r--r--tests/docker/dockerfiles/debian-ppc64el-cross.docker3
-rw-r--r--tests/docker/dockerfiles/debian-riscv64-cross.docker5
-rw-r--r--tests/docker/dockerfiles/debian-s390x-cross.docker3
-rw-r--r--tests/docker/dockerfiles/debian-sh4-cross.docker5
-rw-r--r--tests/docker/dockerfiles/debian-sid.docker24
-rw-r--r--tests/docker/dockerfiles/debian-sparc64-cross.docker5
-rw-r--r--tests/docker/dockerfiles/ubuntu1804.docker3
-rwxr-xr-xtests/docker/run4
-rwxr-xr-xtests/docker/test-build1
-rwxr-xr-xtests/docker/test-mingw1
-rwxr-xr-xtests/docker/test-quick1
-rwxr-xr-xtests/qemu-iotests/0286
-rwxr-xr-xtests/qemu-iotests/0303
-rwxr-xr-xtests/qemu-iotests/0395
-rw-r--r--tests/qemu-iotests/039.out30
-rwxr-xr-xtests/qemu-iotests/0403
-rwxr-xr-xtests/qemu-iotests/0413
-rwxr-xr-xtests/qemu-iotests/0443
-rwxr-xr-xtests/qemu-iotests/0453
-rwxr-xr-xtests/qemu-iotests/0514
-rwxr-xr-xtests/qemu-iotests/0553
-rwxr-xr-xtests/qemu-iotests/0563
-rwxr-xr-xtests/qemu-iotests/0573
-rwxr-xr-xtests/qemu-iotests/0612
-rw-r--r--tests/qemu-iotests/061.out12
-rwxr-xr-xtests/qemu-iotests/0653
-rwxr-xr-xtests/qemu-iotests/0963
-rwxr-xr-xtests/qemu-iotests/1183
-rwxr-xr-xtests/qemu-iotests/1243
-rwxr-xr-xtests/qemu-iotests/1293
-rwxr-xr-xtests/qemu-iotests/1323
-rwxr-xr-xtests/qemu-iotests/1371
-rw-r--r--tests/qemu-iotests/137.out6
-rwxr-xr-xtests/qemu-iotests/1393
-rwxr-xr-xtests/qemu-iotests/1475
-rwxr-xr-xtests/qemu-iotests/1483
-rwxr-xr-xtests/qemu-iotests/1513
-rwxr-xr-xtests/qemu-iotests/1523
-rwxr-xr-xtests/qemu-iotests/1553
-rwxr-xr-xtests/qemu-iotests/1633
-rwxr-xr-xtests/qemu-iotests/1653
-rwxr-xr-xtests/qemu-iotests/1693
-rwxr-xr-xtests/qemu-iotests/1839
-rwxr-xr-xtests/qemu-iotests/1926
-rwxr-xr-xtests/qemu-iotests/1963
-rwxr-xr-xtests/qemu-iotests/1993
-rwxr-xr-xtests/qemu-iotests/2053
-rwxr-xr-xtests/qemu-iotests/2326
-rw-r--r--tests/qemu-iotests/2453
-rwxr-xr-xtests/qemu-iotests/2476
-rwxr-xr-xtests/qemu-iotests/2573
-rwxr-xr-xtests/qemu-iotests/26567
-rw-r--r--tests/qemu-iotests/265.out6
-rwxr-xr-xtests/qemu-iotests/266153
-rw-r--r--tests/qemu-iotests/266.out137
-rw-r--r--tests/qemu-iotests/common.rc105
-rw-r--r--tests/qemu-iotests/group2
-rw-r--r--tests/qemu-iotests/iotests.py4
-rw-r--r--tests/tcg/.gitignore5
-rw-r--r--tests/tcg/Makefile.include88
-rw-r--r--tests/tcg/Makefile.prereqs18
-rw-r--r--tests/tcg/Makefile.probe31
-rw-r--r--tests/tcg/Makefile.qemu95
-rw-r--r--tests/tcg/Makefile.target (renamed from tests/tcg/Makefile)15
-rw-r--r--tests/tcg/aarch64/Makefile.include8
-rw-r--r--tests/tcg/aarch64/Makefile.softmmu-target4
-rw-r--r--tests/tcg/aarch64/Makefile.target12
-rw-r--r--tests/tcg/alpha/Makefile.include2
-rw-r--r--tests/tcg/alpha/Makefile.softmmu-target4
-rw-r--r--tests/tcg/arm/Makefile.include8
-rw-r--r--tests/tcg/arm/Makefile.softmmu-target6
-rwxr-xr-xtests/tcg/configure.sh234
-rw-r--r--tests/tcg/cris/Makefile.include6
-rw-r--r--tests/tcg/hppa/Makefile.include2
-rw-r--r--tests/tcg/i386/Makefile.include9
-rw-r--r--tests/tcg/i386/Makefile.softmmu-target12
-rw-r--r--tests/tcg/i386/Makefile.target13
-rw-r--r--tests/tcg/m68k/Makefile.include2
-rw-r--r--tests/tcg/minilib/Makefile.target2
-rw-r--r--tests/tcg/mips/Makefile.include20
-rw-r--r--tests/tcg/multiarch/Makefile.target7
-rw-r--r--tests/tcg/ppc/Makefile.include10
-rw-r--r--tests/tcg/riscv/Makefile.include10
-rw-r--r--tests/tcg/s390x/Makefile.include2
-rw-r--r--tests/tcg/sh4/Makefile.include4
-rw-r--r--tests/tcg/sparc64/Makefile.include2
-rw-r--r--tests/tcg/x86_64/Makefile.softmmu-target36
-rw-r--r--tests/tcg/x86_64/Makefile.target7
-rw-r--r--tests/tcg/xtensa/Makefile.include11
-rw-r--r--tests/tcg/xtensa/Makefile.softmmu-target4
-rw-r--r--tests/test-bdrv-drain.c3
-rw-r--r--tests/test-block-iothread.c1
-rw-r--r--tests/test-blockjob-txn.c1
-rw-r--r--tests/test-blockjob.c2
-rw-r--r--tests/test-util-filemonitor.c43
-rwxr-xr-xtests/vm/fedora2
117 files changed, 1204 insertions, 521 deletions
diff --git a/tests/Makefile.include b/tests/Makefile.include
index f5ac09549c..b39860a8d0 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -1059,26 +1059,29 @@ BUILD_TCG_TARGET_RULES=$(patsubst %,build-tcg-tests-%, $(TARGET_DIRS))
CLEAN_TCG_TARGET_RULES=$(patsubst %,clean-tcg-tests-%, $(TARGET_DIRS))
RUN_TCG_TARGET_RULES=$(patsubst %,run-tcg-tests-%, $(TARGET_DIRS))
-ifeq ($(HAVE_USER_DOCKER),y)
# Probe for the Docker Builds needed for each build
$(foreach PROBE_TARGET,$(TARGET_DIRS), \
- $(eval -include $(SRC_PATH)/tests/tcg/Makefile.probe) \
- $(if $(DOCKER_PREREQ), \
- $(eval build-tcg-tests-$(PROBE_TARGET): $(DOCKER_PREREQ))))
-endif
+ $(eval -include $(SRC_PATH)/tests/tcg/Makefile.prereqs))
build-tcg-tests-%:
- $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" \
- SKIP_DOCKER_BUILD=1 TARGET_DIR="$*/" guest-tests, \
+ $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) \
+ -f $(SRC_PATH)/tests/tcg/Makefile.qemu \
+ SRC_PATH=$(SRC_PATH) \
+ V="$(V)" TARGET="$*" guest-tests, \
"BUILD", "TCG tests for $*")
-run-tcg-tests-%: % build-tcg-tests-%
- $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" \
- SKIP_DOCKER_BUILD=1 TARGET_DIR="$*/" run-guest-tests, \
+run-tcg-tests-%: build-tcg-tests-% %/all
+ $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) \
+ -f $(SRC_PATH)/tests/tcg/Makefile.qemu \
+ SRC_PATH=$(SRC_PATH) SPEED="$(SPEED)" \
+ V="$(V)" TARGET="$*" run-guest-tests, \
"RUN", "TCG tests for $*")
clean-tcg-tests-%:
- $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" clean-guest-tests,)
+ $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) \
+ -f $(SRC_PATH)/tests/tcg/Makefile.qemu \
+ SRC_PATH=$(SRC_PATH) TARGET="$*" clean-guest-tests, \
+ "CLEAN", "TCG tests for $*")
.PHONY: build-tcg
build-tcg: $(BUILD_TCG_TARGET_RULES)
diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index 2504ef0150..8a9a314ab4 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -76,8 +76,9 @@ class BootLinuxConsole(Test):
:avocado: tags=arch:x86_64
:avocado: tags=machine:pc
"""
- kernel_url = ('https://download.fedoraproject.org/pub/fedora/linux/'
- 'releases/29/Everything/x86_64/os/images/pxeboot/vmlinuz')
+ kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora'
+ '/linux/releases/29/Everything/x86_64/os/images/pxeboot'
+ '/vmlinuz')
kernel_hash = '23bebd2680757891cf7adedb033532163a792495'
kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
@@ -250,8 +251,9 @@ class BootLinuxConsole(Test):
:avocado: tags=arch:aarch64
:avocado: tags=machine:virt
"""
- kernel_url = ('https://download.fedoraproject.org/pub/fedora/linux/'
- 'releases/29/Everything/aarch64/os/images/pxeboot/vmlinuz')
+ kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora'
+ '/linux/releases/29/Everything/aarch64/os/images/pxeboot'
+ '/vmlinuz')
kernel_hash = '8c73e469fc6ea06a58dc83a628fc695b693b8493'
kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
@@ -271,8 +273,9 @@ class BootLinuxConsole(Test):
:avocado: tags=arch:arm
:avocado: tags=machine:virt
"""
- kernel_url = ('https://download.fedoraproject.org/pub/fedora/linux/'
- 'releases/29/Everything/armhfp/os/images/pxeboot/vmlinuz')
+ kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora'
+ '/linux/releases/29/Everything/armhfp/os/images/pxeboot'
+ '/vmlinuz')
kernel_hash = 'e9826d741b4fb04cadba8d4824d1ed3b7fb8b4d4'
kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
@@ -318,8 +321,9 @@ class BootLinuxConsole(Test):
:avocado: tags=arch:s390x
:avocado: tags=machine:s390_ccw_virtio
"""
- kernel_url = ('https://download.fedoraproject.org/pub/fedora-secondary/'
- 'releases/29/Everything/s390x/os/images/kernel.img')
+ kernel_url = ('https://archives.fedoraproject.org/pub/archive'
+ '/fedora-secondary/releases/29/Everything/s390x/os/images'
+ '/kernel.img')
kernel_hash = 'e8e8439103ef8053418ef062644ffd46a7919313'
kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
@@ -360,8 +364,9 @@ class BootLinuxConsole(Test):
:avocado: tags=arch:ppc64
:avocado: tags=machine:pseries
"""
- kernel_url = ('https://download.fedoraproject.org/pub/fedora-secondary/'
- 'releases/29/Everything/ppc64le/os/ppc/ppc64/vmlinuz')
+ kernel_url = ('https://archives.fedoraproject.org/pub/archive'
+ '/fedora-secondary/releases/29/Everything/ppc64le/os'
+ '/ppc/ppc64/vmlinuz')
kernel_hash = '3fe04abfc852b66653b8c3c897a59a689270bc77'
kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
diff --git a/tests/acceptance/linux_initrd.py b/tests/acceptance/linux_initrd.py
index 23be5a63aa..c61d9826a4 100644
--- a/tests/acceptance/linux_initrd.py
+++ b/tests/acceptance/linux_initrd.py
@@ -54,8 +54,9 @@ class LinuxInitrd(Test):
QEMU has supported up to 4 GiB initrd for recent kernel
Expect guest can reach 'Unpacking initramfs...'
"""
- kernel_url = ('https://mirrors.kernel.org/fedora/releases/28/'
- 'Everything/x86_64/os/images/pxeboot/vmlinuz')
+ kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora'
+ '/linux/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
diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index cf535cbd19..50a400b573 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -6,7 +6,8 @@ DOCKER_SUFFIX := .docker
DOCKER_FILES_DIR := $(SRC_PATH)/tests/docker/dockerfiles
DOCKER_DEPRECATED_IMAGES := debian
# we don't run tests on intermediate images (used as base by another image)
-DOCKER_PARTIAL_IMAGES := debian debian8 debian9 debian8-mxe debian-ports debian-sid debian-bootstrap
+DOCKER_PARTIAL_IMAGES := debian debian8 debian9 debian10 debian-sid
+DEBIAN_PARTIAL_IMAGES += debian8-mxe debian-9-mxe debian-ports debian-bootstrap
DOCKER_IMAGES := $(filter-out $(DOCKER_DEPRECATED_IMAGES),$(sort $(notdir $(basename $(wildcard $(DOCKER_FILES_DIR)/*.docker)))))
DOCKER_TARGETS := $(patsubst %,docker-image-%,$(DOCKER_IMAGES))
# Use a global constant ccache directory to speed up repetitive builds
@@ -71,7 +72,8 @@ docker-binfmt-image-debian-%: $(DOCKER_FILES_DIR)/debian-bootstrap.docker
$(if $(wildcard $(EXECUTABLE)), \
$(call quiet-command, \
DEB_ARCH=$(DEB_ARCH) \
- DEB_TYPE=$(DEB_TYPE) \
+ DEB_TYPE=$(DEB_TYPE) \
+ $(if $(DEB_URL),DEB_URL=$(DEB_URL),) \
$(DOCKER_SCRIPT) build qemu:debian-$* $< \
$(if $V,,--quiet) $(if $(NOCACHE),--no-cache) \
$(if $(NOUSER),,--add-current-user) \
@@ -86,13 +88,16 @@ docker-binfmt-image-debian-%: $(DOCKER_FILES_DIR)/debian-bootstrap.docker
endif
# Enforce dependencies for composite images
-docker-image-debian: docker-image-debian9
docker-image-debian9-mxe: docker-image-debian9
+ifeq ($(ARCH),x86_64)
docker-image-debian-amd64: docker-image-debian9
+DOCKER_PARTIAL_IMAGES += debian-amd64-cross
+else
+docker-image-debian-amd64-cross: docker-image-debian10
+DOCKER_PARTIAL_IMAGES += debian-amd64
+endif
docker-image-debian-armel-cross: docker-image-debian9
docker-image-debian-armhf-cross: docker-image-debian9
-docker-image-debian-arm64-cross: docker-image-debian9
-docker-image-debian-buster-arm64-cross: docker-image-debian10
docker-image-debian-mips-cross: docker-image-debian9
docker-image-debian-mipsel-cross: docker-image-debian9
docker-image-debian-mips64el-cross: docker-image-debian9
@@ -101,25 +106,41 @@ docker-image-debian-s390x-cross: docker-image-debian9
docker-image-debian-win32-cross: docker-image-debian9-mxe
docker-image-debian-win64-cross: docker-image-debian9-mxe
-docker-image-debian-alpha-cross: docker-image-debian-sid
-docker-image-debian-hppa-cross: docker-image-debian-sid
-docker-image-debian-m68k-cross: docker-image-debian-sid
-docker-image-debian-sh4-cross: docker-image-debian-sid
-docker-image-debian-sparc64-cross: docker-image-debian-sid
-docker-image-debian-mips64-cross: docker-image-debian-sid
-docker-image-debian-riscv64-cross: docker-image-debian-sid
-docker-image-debian-powerpc-cross: docker-image-debian-sid
-docker-image-debian-ppc64-cross: docker-image-debian-sid
+# For non-x86 hosts not all cross-compilers have been packaged
+ifneq ($(ARCH),x86_64)
+DOCKER_PARTIAL_IMAGES += debian-mips-cross debian-mipsel-cross debian-mips64el-cross
+DOCKER_PARTIAL_IMAGES += debian-ppc64el-cross
+DOCKER_PARTIAL_IMAGES += debian-s390x-cross
+DOCKER_PARTIAL_IMAGES += debian-win32-cross debian-win64-cross
+DOCKER_PARTIAL_IMAGES += fedora travis
+endif
+
+docker-image-debian-alpha-cross: docker-image-debian10
+docker-image-debian-arm64-cross: docker-image-debian10
+docker-image-debian-hppa-cross: docker-image-debian10
+docker-image-debian-m68k-cross: docker-image-debian10
+docker-image-debian-mips64-cross: docker-image-debian10
+docker-image-debian-powerpc-cross: docker-image-debian10
+docker-image-debian-ppc64-cross: docker-image-debian10
+docker-image-debian-riscv64-cross: docker-image-debian10
+docker-image-debian-sh4-cross: docker-image-debian10
+docker-image-debian-sparc64-cross: docker-image-debian10
+
docker-image-travis: NOUSER=1
# Specialist build images, sometimes very limited tools
docker-image-tricore-cross: docker-image-debian9
# These images may be good enough for building tests but not for test builds
-DOCKER_PARTIAL_IMAGES += debian-alpha-cross debian-hppa-cross debian-m68k-cross debian-sh4-cross
-DOCKER_PARTIAL_IMAGES += debian-sparc64-cross debian-mips64-cross debian-riscv64-cross
-DOCKER_PARTIAL_IMAGES += debian-tricore-cross debian-powerpc-cross fedora-i386-cross
-DOCKER_PARTIAL_IMAGES += fedora-cris-cross
+DOCKER_PARTIAL_IMAGES += debian-alpha-cross
+DOCKER_PARTIAL_IMAGES += debian-hppa-cross
+DOCKER_PARTIAL_IMAGES += debian-m68k-cross debian-mips64-cross
+DOCKER_PARTIAL_IMAGES += debian-powerpc-cross debian-ppc64-cross
+DOCKER_PARTIAL_IMAGES += debian-riscv64-cross
+DOCKER_PARTIAL_IMAGES += debian-sh4-cross debian-sparc64-cross
+DOCKER_PARTIAL_IMAGES += debian-tricore-cross
+DOCKER_PARTIAL_IMAGES += debian-xtensa-cross
+DOCKER_PARTIAL_IMAGES += fedora-i386-cross fedora-cris-cross
# Rules for building linux-user powered images
#
@@ -131,6 +152,7 @@ DOCKER_PARTIAL_IMAGES += fedora-cris-cross
# broken so we need a qemu-linux-user for this target
docker-binfmt-image-debian-powerpc-user: DEB_ARCH = powerpc
docker-binfmt-image-debian-powerpc-user: DEB_TYPE = jessie
+docker-binfmt-image-debian-powerpc-user: DEB_URL = http://snapshot.debian.org/archive/debian/20180615T211437Z
docker-binfmt-image-debian-powerpc-user: EXECUTABLE = ${BUILD_DIR}/ppc-linux-user/qemu-ppc
docker-image-debian-powerpc-user-cross: docker-binfmt-image-debian-powerpc-user
DOCKER_USER_IMAGES += debian-powerpc-user
diff --git a/tests/docker/common.rc b/tests/docker/common.rc
index 4011561587..512202b0a1 100755
--- a/tests/docker/common.rc
+++ b/tests/docker/common.rc
@@ -11,6 +11,10 @@
# or (at your option) any later version. See the COPYING file in
# the top-level directory.
+# This might be set by ENV of a docker container... it is always
+# overriden by TARGET_LIST if the user sets it.
+DEF_TARGET_LIST=${DEF_TARGET_LIST:-"x86_64-softmmu,aarch64-softmmu"}
+
requires()
{
for c in $@; do
diff --git a/tests/docker/docker.py b/tests/docker/docker.py
index 4bba29e104..29613afd48 100755
--- a/tests/docker/docker.py
+++ b/tests/docker/docker.py
@@ -111,7 +111,7 @@ def _get_so_libs(executable):
libs = []
ldd_re = re.compile(r"(/.*/)(\S*)")
try:
- ldd_output = subprocess.check_output(["ldd", executable])
+ ldd_output = subprocess.check_output(["ldd", executable]).decode('utf-8')
for line in ldd_output.split("\n"):
search = ldd_re.search(line)
if search and len(search.groups()) == 2:
@@ -258,10 +258,16 @@ class Docker(object):
return self._do_kill_instances(True)
def _output(self, cmd, **kwargs):
- return subprocess.check_output(self._command + cmd,
- stderr=subprocess.STDOUT,
- encoding='utf-8',
- **kwargs)
+ if sys.version_info[1] >= 6:
+ return subprocess.check_output(self._command + cmd,
+ stderr=subprocess.STDOUT,
+ encoding='utf-8',
+ **kwargs)
+ else:
+ return subprocess.check_output(self._command + cmd,
+ stderr=subprocess.STDOUT,
+ **kwargs).decode('utf-8')
+
def inspect_tag(self, tag):
try:
@@ -318,10 +324,18 @@ class Docker(object):
return False
return checksum == _text_checksum(_dockerfile_preprocess(dockerfile))
- def run(self, cmd, keep, quiet):
+ def run(self, cmd, keep, quiet, as_user=False):
label = uuid.uuid1().hex
if not keep:
self._instances.append(label)
+
+ if as_user:
+ uid = os.getuid()
+ cmd = [ "-u", str(uid) ] + cmd
+ # podman requires a bit more fiddling
+ if self._command[0] == "podman":
+ argv.insert(0, '--userns=keep-id')
+
ret = self._do_check(["run", "--label",
"com.qemu.instance.uuid=" + label] + cmd,
quiet=quiet)
@@ -364,15 +378,8 @@ class RunCommand(SubCommand):
help="Run container using the current user's uid")
def run(self, args, argv):
- if args.run_as_current_user:
- uid = os.getuid()
- argv = [ "-u", str(uid) ] + argv
- docker = Docker()
- if docker._command[0] == "podman":
- argv = [ "--uidmap", "%d:0:1" % uid,
- "--uidmap", "0:1:%d" % uid,
- "--uidmap", "%d:%d:64536" % (uid + 1, uid + 1)] + argv
- return Docker().run(argv, args.keep, quiet=args.quiet)
+ return Docker().run(argv, args.keep, quiet=args.quiet,
+ as_user=args.run_as_current_user)
class BuildCommand(SubCommand):
@@ -536,9 +543,9 @@ class ProbeCommand(SubCommand):
try:
docker = Docker()
if docker._command[0] == "docker":
- print("yes")
+ print("docker")
elif docker._command[0] == "sudo":
- print("sudo")
+ print("sudo docker")
elif docker._command[0] == "podman":
print("podman")
except Exception:
@@ -556,8 +563,6 @@ class CcCommand(SubCommand):
help="The docker image in which to run cc")
parser.add_argument("--cc", default="cc",
help="The compiler executable to call")
- parser.add_argument("--user",
- help="The user-id to run under")
parser.add_argument("--source-path", "-s", nargs="*", dest="paths",
help="""Extra paths to (ro) mount into container for
reading sources""")
@@ -571,11 +576,10 @@ class CcCommand(SubCommand):
if args.paths:
for p in args.paths:
cmd += ["-v", "%s:%s:ro,z" % (p, p)]
- if args.user:
- cmd += ["-u", args.user]
cmd += [args.image, args.cc]
cmd += argv
- return Docker().command("run", cmd, args.quiet)
+ return Docker().run(cmd, False, quiet=args.quiet,
+ as_user=True)
class CheckCommand(SubCommand):
@@ -651,7 +655,8 @@ def main():
cmd.args(subp)
subp.set_defaults(cmdobj=cmd)
args, argv = parser.parse_known_args()
- USE_ENGINE = args.engine
+ if args.engine:
+ USE_ENGINE = args.engine
return args.cmdobj.run(args, argv)
diff --git a/tests/docker/dockerfiles/debian-alpha-cross.docker b/tests/docker/dockerfiles/debian-alpha-cross.docker
index 23444342f0..74bcabfdb1 100644
--- a/tests/docker/dockerfiles/debian-alpha-cross.docker
+++ b/tests/docker/dockerfiles/debian-alpha-cross.docker
@@ -1,13 +1,12 @@
#
# Docker cross-compiler target
#
-# This docker target builds on the debian sid base image which
-# contains cross compilers for Debian "ports" targets.
+# This docker target builds on the debian Buster base image.
#
-FROM qemu:debian-sid
+FROM qemu:debian10
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
gcc-alpha-linux-gnu \
- libc6.1-dev-alpha-cross || { echo "Failed to build - see debian-sid.docker notes"; exit 1; }
+ libc6.1-dev-alpha-cross
diff --git a/tests/docker/dockerfiles/debian-amd64-cross.docker b/tests/docker/dockerfiles/debian-amd64-cross.docker
new file mode 100644
index 0000000000..5d89041925
--- /dev/null
+++ b/tests/docker/dockerfiles/debian-amd64-cross.docker
@@ -0,0 +1,22 @@
+#
+# Docker x86_64 cross target
+#
+# This docker target is used on non-x86_64 machines which need the
+# x86_64 cross compilers installed.
+#
+FROM qemu:debian10
+MAINTAINER Alex Bennée <alex.bennee@linaro.org>
+
+# Add the foreign architecture we want and install dependencies
+RUN dpkg --add-architecture amd64
+RUN apt update && \
+ DEBIAN_FRONTEND=noninteractive eatmydata \
+ apt install -y --no-install-recommends \
+ crossbuild-essential-amd64
+RUN apt update && \
+ DEBIAN_FRONTEND=noninteractive eatmydata \
+ apt build-dep -yy -a amd64 --arch-only qemu
+
+# Specify the cross prefix for this image (see tests/docker/common.rc)
+ENV QEMU_CONFIGURE_OPTS --cross-prefix=x86_64-linux-gnu-
+ENV DEF_TARGET_LIST x86_64-softmmu,x86_64-linux-user,i386-softmmu,i386-linux-user
diff --git a/tests/docker/dockerfiles/debian-arm64-cross.docker b/tests/docker/dockerfiles/debian-arm64-cross.docker
index 7c2cc93daf..09ca0a1ba7 100644
--- a/tests/docker/dockerfiles/debian-arm64-cross.docker
+++ b/tests/docker/dockerfiles/debian-arm64-cross.docker
@@ -1,9 +1,9 @@
#
# Docker arm64 cross-compiler target
#
-# This docker target builds on the debian Stretch base image.
+# This docker target builds on the debian Buster base image.
#
-FROM qemu:debian9
+FROM qemu:debian10
# Add the foreign architecture we want and install dependencies
RUN dpkg --add-architecture arm64
@@ -13,10 +13,11 @@ RUN apt update && \
crossbuild-essential-arm64
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
- apt build-dep -yy -a arm64 qemu
+ apt build-dep -yy -a arm64 --arch-only qemu
# Specify the cross prefix for this image (see tests/docker/common.rc)
ENV QEMU_CONFIGURE_OPTS --cross-prefix=aarch64-linux-gnu-
+ENV DEF_TARGET_LIST aarch64-softmmu,aarch64-linux-user
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
diff --git a/tests/docker/dockerfiles/debian-armel-cross.docker b/tests/docker/dockerfiles/debian-armel-cross.docker
index d866fe5d75..15378f8ea2 100644
--- a/tests/docker/dockerfiles/debian-armel-cross.docker
+++ b/tests/docker/dockerfiles/debian-armel-cross.docker
@@ -11,10 +11,11 @@ RUN dpkg --add-architecture armel && \
apt update && \
apt install -yy crossbuild-essential-armel && \
DEBIAN_FRONTEND=noninteractive eatmydata \
- apt build-dep -yy -a armel qemu
+ apt build-dep -yy -a armel --arch-only qemu
# Specify the cross prefix for this image (see tests/docker/common.rc)
ENV QEMU_CONFIGURE_OPTS --cross-prefix=arm-linux-gnueabi-
+ENV DEF_TARGET_LIST arm-softmmu,arm-linux-user,armeb-linux-user
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
diff --git a/tests/docker/dockerfiles/debian-armhf-cross.docker b/tests/docker/dockerfiles/debian-armhf-cross.docker
index 2b8627673c..4a20af6fe1 100644
--- a/tests/docker/dockerfiles/debian-armhf-cross.docker
+++ b/tests/docker/dockerfiles/debian-armhf-cross.docker
@@ -13,10 +13,11 @@ RUN apt update && \
crossbuild-essential-armhf
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
- apt build-dep -yy -a armhf qemu
+ apt build-dep -yy -a armhf --arch-only qemu
# Specify the cross prefix for this image (see tests/docker/common.rc)
ENV QEMU_CONFIGURE_OPTS --cross-prefix=arm-linux-gnueabihf-
+ENV DEF_TARGET_LIST arm-softmmu,arm-linux-user,armeb-linux-user
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
diff --git a/tests/docker/dockerfiles/debian-buster-arm64-cross.docker b/tests/docker/dockerfiles/debian-buster-arm64-cross.docker
deleted file mode 100644
index 52787edcc2..0000000000
--- a/tests/docker/dockerfiles/debian-buster-arm64-cross.docker
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# Docker arm64 cross-compiler target
-#
-# This docker target builds on the Debian's Buster base image. There
-# are no QEMU pre-requistes so this image can only be used to build
-# test cases.
-#
-FROM qemu:debian10
-
-# Add the foreign architecture we want and install dependencies
-RUN dpkg --add-architecture arm64
-RUN apt update && \
- DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \
- DEBIAN_FRONTEND=noninteractive eatmydata \
- apt-get install -y --no-install-recommends \
- crossbuild-essential-arm64
diff --git a/tests/docker/dockerfiles/debian-hppa-cross.docker b/tests/docker/dockerfiles/debian-hppa-cross.docker
index ee6d9a24ce..5c68b2d330 100644
--- a/tests/docker/dockerfiles/debian-hppa-cross.docker
+++ b/tests/docker/dockerfiles/debian-hppa-cross.docker
@@ -1,10 +1,9 @@
#
# Docker cross-compiler target
#
-# This docker target builds on the debian sid base image which
-# contains cross compilers for Debian "ports" targets.
+# This docker target builds on the debian Buster base image.
#
-FROM qemu:debian-sid
+FROM qemu:debian10
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
diff --git a/tests/docker/dockerfiles/debian-m68k-cross.docker b/tests/docker/dockerfiles/debian-m68k-cross.docker
index 4311c9cf86..25edc80e9a 100644
--- a/tests/docker/dockerfiles/debian-m68k-cross.docker
+++ b/tests/docker/dockerfiles/debian-m68k-cross.docker
@@ -1,10 +1,9 @@
#
# Docker cross-compiler target
#
-# This docker target builds on the debian sid base image which
-# contains cross compilers for Debian "ports" targets.
+# This docker target builds on the debian Buster base image.
#
-FROM qemu:debian-sid
+FROM qemu:debian10
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
diff --git a/tests/docker/dockerfiles/debian-mips-cross.docker b/tests/docker/dockerfiles/debian-mips-cross.docker
index 3c4d6f9ec1..08a8e1c29c 100644
--- a/tests/docker/dockerfiles/debian-mips-cross.docker
+++ b/tests/docker/dockerfiles/debian-mips-cross.docker
@@ -1,9 +1,9 @@
#
# Docker mips cross-compiler target
#
-# This docker target builds on the debian Stretch base image.
+# This docker target builds on the debian Buster base image.
#
-FROM qemu:debian9
+FROM qemu:debian10
MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
@@ -16,10 +16,11 @@ RUN apt update && \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
- apt build-dep -yy -a mips qemu
+ apt build-dep -yy -a mips --arch-only qemu
# Specify the cross prefix for this image (see tests/docker/common.rc)
ENV QEMU_CONFIGURE_OPTS --cross-prefix=mips-linux-gnu-
+ENV DEF_TARGET_LIST mips-softmmu,mipsel-linux-user
# Install extra libraries to increase code coverage
RUN apt update && \
diff --git a/tests/docker/dockerfiles/debian-mips64-cross.docker b/tests/docker/dockerfiles/debian-mips64-cross.docker
index bf0073a466..1a79505d69 100644
--- a/tests/docker/dockerfiles/debian-mips64-cross.docker
+++ b/tests/docker/dockerfiles/debian-mips64-cross.docker
@@ -1,10 +1,9 @@
#
# Docker cross-compiler target
#
-# This docker target builds on the debian sid base image which
-# contains cross compilers for Debian "ports" targets.
+# This docker target builds on the debian Buster base image.
#
-FROM qemu:debian-sid
+FROM qemu:debian10
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
diff --git a/tests/docker/dockerfiles/debian-mips64el-cross.docker b/tests/docker/dockerfiles/debian-mips64el-cross.docker
index 34b0b82895..2fca112405 100644
--- a/tests/docker/dockerfiles/debian-mips64el-cross.docker
+++ b/tests/docker/dockerfiles/debian-mips64el-cross.docker
@@ -17,10 +17,11 @@ RUN dpkg --add-architecture mips64el && \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
- apt build-dep -yy -a mips64el qemu
+ apt build-dep -yy -a mips64el --arch-only qemu
# Specify the cross prefix for this image (see tests/docker/common.rc)
ENV QEMU_CONFIGURE_OPTS --cross-prefix=mips64el-linux-gnuabi64-
+ENV DEF_TARGET_LIST mips64el-softmmu,mips64el-linux-user
# Install extra libraries to increase code coverage
RUN apt update && \
diff --git a/tests/docker/dockerfiles/debian-mipsel-cross.docker b/tests/docker/dockerfiles/debian-mipsel-cross.docker
index 88accad269..4abf7832ac 100644
--- a/tests/docker/dockerfiles/debian-mipsel-cross.docker
+++ b/tests/docker/dockerfiles/debian-mipsel-cross.docker
@@ -16,7 +16,7 @@ RUN apt update && \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
- apt build-dep -yy -a mipsel qemu
+ apt build-dep -yy -a mipsel --arch-only qemu
# Specify the cross prefix for this image (see tests/docker/common.rc)
ENV QEMU_CONFIGURE_OPTS --cross-prefix=mipsel-linux-gnu-
diff --git a/tests/docker/dockerfiles/debian-powerpc-cross.docker b/tests/docker/dockerfiles/debian-powerpc-cross.docker
index 5d08fad7cd..89dd4fbf87 100644
--- a/tests/docker/dockerfiles/debian-powerpc-cross.docker
+++ b/tests/docker/dockerfiles/debian-powerpc-cross.docker
@@ -1,14 +1,12 @@
#
# Docker powerpc cross-compiler target
#
-# This docker target builds on the debian sid base image which
-# contains cross compilers for Debian "ports" targets. The original
-# Jessie based no longer builds.
+# This docker target builds on the debian Buster base image.
#
-FROM qemu:debian-sid
+FROM qemu:debian10
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
gcc-powerpc-linux-gnu \
- libc6-dev-powerpc-cross || { echo "Failed to build - see debian-sid.docker notes"; exit 1; }
+ libc6-dev-powerpc-cross
diff --git a/tests/docker/dockerfiles/debian-powerpc-user-cross.docker b/tests/docker/dockerfiles/debian-powerpc-user-cross.docker
index 6938a845ee..83749b0abb 100644
--- a/tests/docker/dockerfiles/debian-powerpc-user-cross.docker
+++ b/tests/docker/dockerfiles/debian-powerpc-user-cross.docker
@@ -8,8 +8,14 @@
# debootstrapped qemu:debian-powerpc-user but doesn't need any extra
# magic once it is setup.
#
+# It can be used to build old versions of QEMU, current versions need
+# newer dependencies than Jessie provides.
+#
FROM qemu:debian-powerpc-user
RUN echo man-db man-db/auto-update boolean false | debconf-set-selections
RUN apt-get update && \
- DEBIAN_FRONTEND=noninteractive apt-get build-dep -yy qemu
+ DEBIAN_FRONTEND=noninteractive apt-get build-dep -yy qemu
+
+ENV QEMU_CONFIGURE_OPTS --disable-werror
+ENV DEF_TARGET_LIST powerpc-softmmu,arm-linux-user,aarch64-linux-user
diff --git a/tests/docker/dockerfiles/debian-ppc64-cross.docker b/tests/docker/dockerfiles/debian-ppc64-cross.docker
index e5757fe46e..4bf88ab02d 100644
--- a/tests/docker/dockerfiles/debian-ppc64-cross.docker
+++ b/tests/docker/dockerfiles/debian-ppc64-cross.docker
@@ -1,12 +1,11 @@
#
# Docker ppc64 cross-compiler target
#
-# This docker target builds on the debian sid base image which
-# contains cross compilers for Debian "ports" targets.
-FROM qemu:debian-sid
+# This docker target builds on the debian Buster base image.
+FROM qemu:debian10
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
gcc-powerpc64-linux-gnu \
- libc6-dev-ppc64-cross || { echo "Failed to build - see debian-sid.docker notes"; exit 1; }
+ libc6-dev-ppc64-cross
diff --git a/tests/docker/dockerfiles/debian-ppc64el-cross.docker b/tests/docker/dockerfiles/debian-ppc64el-cross.docker
index fc056d7bc3..9973df9ff7 100644
--- a/tests/docker/dockerfiles/debian-ppc64el-cross.docker
+++ b/tests/docker/dockerfiles/debian-ppc64el-cross.docker
@@ -12,10 +12,11 @@ RUN dpkg --add-architecture ppc64el && \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
- apt build-dep -yy -a ppc64el qemu
+ apt build-dep -yy -a ppc64el --arch-only qemu
# Specify the cross prefix for this image (see tests/docker/common.rc)
ENV QEMU_CONFIGURE_OPTS --cross-prefix=powerpc64le-linux-gnu-
+ENV DEF_TARGET_LIST ppc64-softmmu,ppc64-linux-user,ppc64abi32-linux-user
# Install extra libraries to increase code coverage
RUN apt update && \
diff --git a/tests/docker/dockerfiles/debian-riscv64-cross.docker b/tests/docker/dockerfiles/debian-riscv64-cross.docker
index 221697f9d1..5e2d6ddb60 100644
--- a/tests/docker/dockerfiles/debian-riscv64-cross.docker
+++ b/tests/docker/dockerfiles/debian-riscv64-cross.docker
@@ -1,10 +1,9 @@
#
# Docker cross-compiler target
#
-# This docker target builds on the debian sid base image which
-# contains cross compilers for Debian "ports" targets.
+# This docker target builds on the debian Buster base image.
#
-FROM qemu:debian-sid
+FROM qemu:debian10
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
diff --git a/tests/docker/dockerfiles/debian-s390x-cross.docker b/tests/docker/dockerfiles/debian-s390x-cross.docker
index 6732f9ec78..eb73c98855 100644
--- a/tests/docker/dockerfiles/debian-s390x-cross.docker
+++ b/tests/docker/dockerfiles/debian-s390x-cross.docker
@@ -17,10 +17,11 @@ RUN apt update && \
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
- apt build-dep -yy -a s390x qemu
+ apt build-dep -yy -a s390x --arch-only qemu
# Specify the cross prefix for this image (see tests/docker/common.rc)
ENV QEMU_CONFIGURE_OPTS --cross-prefix=s390x-linux-gnu-
+ENV DEF_TARGET_LIST s390x-softmmu,s390x-linux-user
# Install extra libraries to increase code coverage
RUN apt update && \
diff --git a/tests/docker/dockerfiles/debian-sh4-cross.docker b/tests/docker/dockerfiles/debian-sh4-cross.docker
index 29983b2d75..9d7663764e 100644
--- a/tests/docker/dockerfiles/debian-sh4-cross.docker
+++ b/tests/docker/dockerfiles/debian-sh4-cross.docker
@@ -1,10 +1,9 @@
#
# Docker cross-compiler target
#
-# This docker target builds on the debian sid base image which
-# contains cross compilers for Debian "ports" targets.
+# This docker target builds on the debian Buster base image.
#
-FROM qemu:debian-sid
+FROM qemu:debian10
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
diff --git a/tests/docker/dockerfiles/debian-sid.docker b/tests/docker/dockerfiles/debian-sid.docker
index 513459ca7f..2a1bcc33b2 100644
--- a/tests/docker/dockerfiles/debian-sid.docker
+++ b/tests/docker/dockerfiles/debian-sid.docker
@@ -1,25 +1,19 @@
#
# Debian Sid Base
#
-# A number of our guests exist as ports only. We can either use the
-# ports repo or get everything from Sid. However Sid is a rolling
-# distro which may be broken at any particular time. If you are
-# unlucky and try and build your images while gcc is in the process of
-# being uploaded this can fail. Your only recourse is to try again in
-# a few hours when the repos have re-synced. Once built however you
-# won't be affected by repo changes unless the docker recipies are
-# updated and trigger a re-build.
+# Currently we can build all our guests with cross-compilers in the
+# latest Debian release (Buster). However new compilers will first
+# arrive in Sid. However Sid is a rolling distro which may be broken
+# at any particular time. To try and mitigate this we use Debian's
+# snapshot archive which provides a "stable" view of what state Sid
+# was in.
#
# This must be earlier than the snapshot date we are aiming for
-FROM debian:sid-20181011-slim
+FROM debian:sid-20190812-slim
-# Use a snapshot known to work (see http://snapshot.debian.org/#Usage)
-ENV DEBIAN_SNAPSHOT_DATE "20181030"
-RUN sed -i "s%^deb \(https\?://\)deb.debian.org/debian/\? \(.*\)%deb [check-valid-until=no] \1snapshot.debian.org/archive/debian/${DEBIAN_SNAPSHOT_DATE} \2%" /etc/apt/sources.list
-
-# Use a snapshot known to work (see http://snapshot.debian.org/#Usage)
-ENV DEBIAN_SNAPSHOT_DATE "20181030"
+ # Use a snapshot known to work (see http://snapshot.debian.org/#Usage)
+ENV DEBIAN_SNAPSHOT_DATE "20190820"
RUN sed -i "s%^deb \(https\?://\)deb.debian.org/debian/\? \(.*\)%deb [check-valid-until=no] \1snapshot.debian.org/archive/debian/${DEBIAN_SNAPSHOT_DATE} \2%" /etc/apt/sources.list
# Duplicate deb line as deb-src
diff --git a/tests/docker/dockerfiles/debian-sparc64-cross.docker b/tests/docker/dockerfiles/debian-sparc64-cross.docker
index 7a2c2ab19c..31fd34f120 100644
--- a/tests/docker/dockerfiles/debian-sparc64-cross.docker
+++ b/tests/docker/dockerfiles/debian-sparc64-cross.docker
@@ -1,10 +1,9 @@
#
# Docker cross-compiler target
#
-# This docker target builds on the debian sid base image which
-# contains cross compilers for Debian "ports" targets.
+# This docker target builds on the debian Buster base image.
#
-FROM qemu:debian-sid
+FROM qemu:debian10
RUN apt update && \
DEBIAN_FRONTEND=noninteractive eatmydata \
diff --git a/tests/docker/dockerfiles/ubuntu1804.docker b/tests/docker/dockerfiles/ubuntu1804.docker
index 44bbf0f77a..883f9bcf31 100644
--- a/tests/docker/dockerfiles/ubuntu1804.docker
+++ b/tests/docker/dockerfiles/ubuntu1804.docker
@@ -56,3 +56,6 @@ RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get -y install $PACKAGES
RUN dpkg -l $PACKAGES | sort > /packages.txt
ENV FEATURES clang pyyaml sdl2
+
+# https://bugs.launchpad.net/qemu/+bug/1838763
+ENV QEMU_CONFIGURE_OPTS --disable-libssh
diff --git a/tests/docker/run b/tests/docker/run
index 1014871fec..8edc7026ee 100755
--- a/tests/docker/run
+++ b/tests/docker/run
@@ -62,7 +62,7 @@ echo "* Prepared to run command:"
echo " $CMD"
echo "* Hit Ctrl-D to continue, or type 'exit 1' to abort"
echo
-$SHELL --noprofile --norc
+env bash --noprofile --norc
if "$CMD"; then
exit 0
@@ -72,7 +72,7 @@ elif test -n "$DEBUG"; then
echo "* Hit Ctrl-D to exit"
echo
# Force error after shell exits
- $SHELL --noprofile --norc && exit 1
+ env bash --noprofile --norc && exit 1
else
exit 1
fi
diff --git a/tests/docker/test-build b/tests/docker/test-build
index 22766cfacc..2b2a7832f1 100755
--- a/tests/docker/test-build
+++ b/tests/docker/test-build
@@ -15,7 +15,6 @@
cd "$BUILD_DIR"
-DEF_TARGET_LIST="x86_64-softmmu,aarch64-softmmu"
TARGET_LIST=${TARGET_LIST:-$DEF_TARGET_LIST} \
build_qemu
install_qemu
diff --git a/tests/docker/test-mingw b/tests/docker/test-mingw
index fdb1c2c879..c30eb654eb 100755
--- a/tests/docker/test-mingw
+++ b/tests/docker/test-mingw
@@ -16,7 +16,6 @@
requires mingw dtc
cd "$BUILD_DIR"
-DEF_TARGET_LIST="x86_64-softmmu,aarch64-softmmu"
for prefix in x86_64-w64-mingw32- i686-w64-mingw32-; do
TARGET_LIST=${TARGET_LIST:-$DEF_TARGET_LIST} \
diff --git a/tests/docker/test-quick b/tests/docker/test-quick
index eee59c55fb..feee44b247 100755
--- a/tests/docker/test-quick
+++ b/tests/docker/test-quick
@@ -15,7 +15,6 @@
cd "$BUILD_DIR"
-DEF_TARGET_LIST="x86_64-softmmu,aarch64-softmmu"
TARGET_LIST=${TARGET_LIST:-$DEF_TARGET_LIST} \
build_qemu
check_qemu
diff --git a/tests/qemu-iotests/028 b/tests/qemu-iotests/028
index 01f495912f..71301ec6e5 100755
--- a/tests/qemu-iotests/028
+++ b/tests/qemu-iotests/028
@@ -110,7 +110,11 @@ echo
qemu_comm_method="monitor"
_launch_qemu -drive file="${TEST_IMG}",cache=${CACHEMODE},id=disk
h=$QEMU_HANDLE
-QEMU_COMM_TIMEOUT=1
+if [ "${VALGRIND_QEMU}" == "y" ]; then
+ QEMU_COMM_TIMEOUT=7
+else
+ QEMU_COMM_TIMEOUT=1
+fi
# Silence output since it contains the disk image path and QEMU's readline
# character echoing makes it very hard to filter the output. Plus, there
diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030
index 1b69f318c6..f3766f2a81 100755
--- a/tests/qemu-iotests/030
+++ b/tests/qemu-iotests/030
@@ -957,4 +957,5 @@ class TestSetSpeed(iotests.QMPTestCase):
self.cancel_and_wait(resume=True)
if __name__ == '__main__':
- iotests.main(supported_fmts=['qcow2', 'qed'])
+ iotests.main(supported_fmts=['qcow2', 'qed'],
+ supported_protocols=['file'])
diff --git a/tests/qemu-iotests/039 b/tests/qemu-iotests/039
index 7c730d94a7..325da63a4c 100755
--- a/tests/qemu-iotests/039
+++ b/tests/qemu-iotests/039
@@ -65,6 +65,7 @@ echo "== Creating a dirty image file =="
IMGOPTS="compat=1.1,lazy_refcounts=on"
_make_test_img $size
+_NO_VALGRIND \
$QEMU_IO -c "write -P 0x5a 0 512" \
-c "sigraise $(kill -l KILL)" "$TEST_IMG" 2>&1 \
| _filter_qemu_io
@@ -100,6 +101,7 @@ echo "== Opening a dirty image read/write should repair it =="
IMGOPTS="compat=1.1,lazy_refcounts=on"
_make_test_img $size
+_NO_VALGRIND \
$QEMU_IO -c "write -P 0x5a 0 512" \
-c "sigraise $(kill -l KILL)" "$TEST_IMG" 2>&1 \
| _filter_qemu_io
@@ -118,6 +120,7 @@ echo "== Creating an image file with lazy_refcounts=off =="
IMGOPTS="compat=1.1,lazy_refcounts=off"
_make_test_img $size
+_NO_VALGRIND \
$QEMU_IO -c "write -P 0x5a 0 512" \
-c "sigraise $(kill -l KILL)" "$TEST_IMG" 2>&1 \
| _filter_qemu_io
@@ -151,6 +154,7 @@ echo "== Changing lazy_refcounts setting at runtime =="
IMGOPTS="compat=1.1,lazy_refcounts=off"
_make_test_img $size
+_NO_VALGRIND \
$QEMU_IO -c "reopen -o lazy-refcounts=on" \
-c "write -P 0x5a 0 512" \
-c "sigraise $(kill -l KILL)" "$TEST_IMG" 2>&1 \
@@ -163,6 +167,7 @@ _check_test_img
IMGOPTS="compat=1.1,lazy_refcounts=on"
_make_test_img $size
+_NO_VALGRIND \
$QEMU_IO -c "reopen -o lazy-refcounts=off" \
-c "write -P 0x5a 0 512" \
-c "sigraise $(kill -l KILL)" "$TEST_IMG" 2>&1 \
diff --git a/tests/qemu-iotests/039.out b/tests/qemu-iotests/039.out
index 724d7b2508..2e356d51b6 100644
--- a/tests/qemu-iotests/039.out
+++ b/tests/qemu-iotests/039.out
@@ -11,11 +11,7 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
wrote 512/512 bytes at offset 0
512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-./common.rc: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then
- exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
-else
- exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
-fi )
+./common.rc: Killed ( VALGRIND_QEMU="${VALGRIND_QEMU_IO}" _qemu_proc_exec "${VALGRIND_LOGFILE}" "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@" )
incompatible_features 0x1
ERROR cluster 5 refcount=0 reference=1
ERROR OFLAG_COPIED data cluster: l2_entry=8000000000050000 refcount=0
@@ -50,11 +46,7 @@ read 512/512 bytes at offset 0
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
wrote 512/512 bytes at offset 0
512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-./common.rc: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then
- exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
-else
- exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
-fi )
+./common.rc: Killed ( VALGRIND_QEMU="${VALGRIND_QEMU_IO}" _qemu_proc_exec "${VALGRIND_LOGFILE}" "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@" )
incompatible_features 0x1
ERROR cluster 5 refcount=0 reference=1
Rebuilding refcount structure
@@ -68,11 +60,7 @@ incompatible_features 0x0
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
wrote 512/512 bytes at offset 0
512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-./common.rc: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then
- exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
-else
- exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
-fi )
+./common.rc: Killed ( VALGRIND_QEMU="${VALGRIND_QEMU_IO}" _qemu_proc_exec "${VALGRIND_LOGFILE}" "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@" )
incompatible_features 0x0
No errors were found on the image.
@@ -91,11 +79,7 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
wrote 512/512 bytes at offset 0
512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-./common.rc: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then
- exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
-else
- exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
-fi )
+./common.rc: Killed ( VALGRIND_QEMU="${VALGRIND_QEMU_IO}" _qemu_proc_exec "${VALGRIND_LOGFILE}" "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@" )
incompatible_features 0x1
ERROR cluster 5 refcount=0 reference=1
ERROR OFLAG_COPIED data cluster: l2_entry=8000000000050000 refcount=0
@@ -105,11 +89,7 @@ Data may be corrupted, or further writes to the image may corrupt it.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
wrote 512/512 bytes at offset 0
512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-./common.rc: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then
- exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
-else
- exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
-fi )
+./common.rc: Killed ( VALGRIND_QEMU="${VALGRIND_QEMU_IO}" _qemu_proc_exec "${VALGRIND_LOGFILE}" "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@" )
incompatible_features 0x0
No errors were found on the image.
*** done
diff --git a/tests/qemu-iotests/040 b/tests/qemu-iotests/040
index 6db9abf8e6..762ad1ebcb 100755
--- a/tests/qemu-iotests/040
+++ b/tests/qemu-iotests/040
@@ -429,4 +429,5 @@ class TestReopenOverlay(ImageCommitTestCase):
self.run_commit_test(self.img1, self.img0)
if __name__ == '__main__':
- iotests.main(supported_fmts=['qcow2', 'qed'])
+ iotests.main(supported_fmts=['qcow2', 'qed'],
+ supported_protocols=['file'])
diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041
index 8bc8f81db7..8568426311 100755
--- a/tests/qemu-iotests/041
+++ b/tests/qemu-iotests/041
@@ -1122,4 +1122,5 @@ class TestOrphanedSource(iotests.QMPTestCase):
self.assert_qmp(result, 'error/class', 'GenericError')
if __name__ == '__main__':
- iotests.main(supported_fmts=['qcow2', 'qed'])
+ iotests.main(supported_fmts=['qcow2', 'qed'],
+ supported_protocols=['file'])
diff --git a/tests/qemu-iotests/044 b/tests/qemu-iotests/044
index 9ec3dba734..05ea1f49c5 100755
--- a/tests/qemu-iotests/044
+++ b/tests/qemu-iotests/044
@@ -118,4 +118,5 @@ class TestRefcountTableGrowth(iotests.QMPTestCase):
pass
if __name__ == '__main__':
- iotests.main(supported_fmts=['qcow2'])
+ iotests.main(supported_fmts=['qcow2'],
+ supported_protocols=['file'])
diff --git a/tests/qemu-iotests/045 b/tests/qemu-iotests/045
index d5484a0ee1..01cc038884 100755
--- a/tests/qemu-iotests/045
+++ b/tests/qemu-iotests/045
@@ -175,4 +175,5 @@ class TestSCMFd(iotests.QMPTestCase):
"File descriptor named '%s' not found" % fdname)
if __name__ == '__main__':
- iotests.main(supported_fmts=['raw'])
+ iotests.main(supported_fmts=['raw'],
+ supported_protocols=['file'])
diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
index ce942a5444..53bcdbc911 100755
--- a/tests/qemu-iotests/051
+++ b/tests/qemu-iotests/051
@@ -377,6 +377,10 @@ printf %b "qemu-io $device_id \"write -P 0x33 0 4k\"\ncommit $device_id\n" |
$QEMU_IO -c "read -P 0x33 0 4k" "$TEST_IMG" | _filter_qemu_io
# Using snapshot=on with a non-existent TMPDIR
+if [ "${VALGRIND_QEMU_VM}" == "y" ]; then
+ _casenotrun "Valgrind needs a valid TMPDIR for itself"
+fi
+VALGRIND_QEMU_VM= \
TMPDIR=/nonexistent run_qemu -drive driver=null-co,snapshot=on
# Using snapshot=on together with read-only=on
diff --git a/tests/qemu-iotests/055 b/tests/qemu-iotests/055
index 3437c11507..c732a112d6 100755
--- a/tests/qemu-iotests/055
+++ b/tests/qemu-iotests/055
@@ -563,4 +563,5 @@ class TestDriveCompression(iotests.QMPTestCase):
target='drive1')
if __name__ == '__main__':
- iotests.main(supported_fmts=['raw', 'qcow2'])
+ iotests.main(supported_fmts=['raw', 'qcow2'],
+ supported_protocols=['file'])
diff --git a/tests/qemu-iotests/056 b/tests/qemu-iotests/056
index e761e465ae..98c55d8e5a 100755
--- a/tests/qemu-iotests/056
+++ b/tests/qemu-iotests/056
@@ -335,4 +335,5 @@ class BackupTest(iotests.QMPTestCase):
self.dismissal_failure(True)
if __name__ == '__main__':
- iotests.main(supported_fmts=['qcow2', 'qed'])
+ iotests.main(supported_fmts=['qcow2', 'qed'],
+ supported_protocols=['file'])
diff --git a/tests/qemu-iotests/057 b/tests/qemu-iotests/057
index 9f0a5a3057..9fbba759b6 100755
--- a/tests/qemu-iotests/057
+++ b/tests/qemu-iotests/057
@@ -256,4 +256,5 @@ class TestSnapshotDelete(ImageSnapshotTestCase):
self.assert_qmp(result, 'error/class', 'GenericError')
if __name__ == '__main__':
- iotests.main(supported_fmts=['qcow2'])
+ iotests.main(supported_fmts=['qcow2'],
+ supported_protocols=['file'])
diff --git a/tests/qemu-iotests/061 b/tests/qemu-iotests/061
index d7dbd7e2c7..4eac5b83bd 100755
--- a/tests/qemu-iotests/061
+++ b/tests/qemu-iotests/061
@@ -73,6 +73,7 @@ echo
echo "=== Testing dirty version downgrade ==="
echo
IMGOPTS="compat=1.1,lazy_refcounts=on" _make_test_img 64M
+_NO_VALGRIND \
$QEMU_IO -c "write -P 0x2a 0 128k" -c flush \
-c "sigraise $(kill -l KILL)" "$TEST_IMG" 2>&1 | _filter_qemu_io
$PYTHON qcow2.py "$TEST_IMG" dump-header
@@ -107,6 +108,7 @@ echo
echo "=== Testing dirty lazy_refcounts=off ==="
echo
IMGOPTS="compat=1.1,lazy_refcounts=on" _make_test_img 64M
+_NO_VALGRIND \
$QEMU_IO -c "write -P 0x2a 0 128k" -c flush \
-c "sigraise $(kill -l KILL)" "$TEST_IMG" 2>&1 | _filter_qemu_io
$PYTHON qcow2.py "$TEST_IMG" dump-header
diff --git a/tests/qemu-iotests/061.out b/tests/qemu-iotests/061.out
index 1aa7d37ff9..d6a7c2af95 100644
--- a/tests/qemu-iotests/061.out
+++ b/tests/qemu-iotests/061.out
@@ -118,11 +118,7 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
wrote 131072/131072 bytes at offset 0
128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-./common.rc: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then
- exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
-else
- exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
-fi )
+./common.rc: Killed ( VALGRIND_QEMU="${VALGRIND_QEMU_IO}" _qemu_proc_exec "${VALGRIND_LOGFILE}" "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@" )
magic 0x514649fb
version 3
backing_file_offset 0x0
@@ -280,11 +276,7 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
wrote 131072/131072 bytes at offset 0
128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-./common.rc: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then
- exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
-else
- exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
-fi )
+./common.rc: Killed ( VALGRIND_QEMU="${VALGRIND_QEMU_IO}" _qemu_proc_exec "${VALGRIND_LOGFILE}" "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@" )
magic 0x514649fb
version 3
backing_file_offset 0x0
diff --git a/tests/qemu-iotests/065 b/tests/qemu-iotests/065
index 8bac383ea7..5b21eb96bd 100755
--- a/tests/qemu-iotests/065
+++ b/tests/qemu-iotests/065
@@ -129,4 +129,5 @@ TestQemuImgInfo = None
TestQMP = None
if __name__ == '__main__':
- iotests.main(supported_fmts=['qcow2'])
+ iotests.main(supported_fmts=['qcow2'],
+ supported_protocols=['file'])
diff --git a/tests/qemu-iotests/096 b/tests/qemu-iotests/096
index a69439602d..ab9cb47822 100755
--- a/tests/qemu-iotests/096
+++ b/tests/qemu-iotests/096
@@ -67,4 +67,5 @@ class TestLiveSnapshot(iotests.QMPTestCase):
self.checkConfig('target')
if __name__ == '__main__':
- iotests.main(supported_fmts=['qcow2'])
+ iotests.main(supported_fmts=['qcow2'],
+ supported_protocols=['file'])
diff --git a/tests/qemu-iotests/118 b/tests/qemu-iotests/118
index 6f45779ee9..ea0b326ae0 100755
--- a/tests/qemu-iotests/118
+++ b/tests/qemu-iotests/118
@@ -717,4 +717,5 @@ if __name__ == '__main__':
iotests.qemu_default_machine)
# Need to support image creation
iotests.main(supported_fmts=['vpc', 'parallels', 'qcow', 'vdi', 'qcow2',
- 'vmdk', 'raw', 'vhdx', 'qed'])
+ 'vmdk', 'raw', 'vhdx', 'qed'],
+ supported_protocols=['file'])
diff --git a/tests/qemu-iotests/124 b/tests/qemu-iotests/124
index 3440f54781..ca40ba3be2 100755
--- a/tests/qemu-iotests/124
+++ b/tests/qemu-iotests/124
@@ -779,4 +779,5 @@ class TestIncrementalBackupBlkdebug(TestIncrementalBackupBase):
if __name__ == '__main__':
- iotests.main(supported_fmts=['qcow2'])
+ iotests.main(supported_fmts=['qcow2'],
+ supported_protocols=['file'])
diff --git a/tests/qemu-iotests/129 b/tests/qemu-iotests/129
index 9e87e1c8d9..cd6b9e9ce7 100755
--- a/tests/qemu-iotests/129
+++ b/tests/qemu-iotests/129
@@ -83,4 +83,5 @@ class TestStopWithBlockJob(iotests.QMPTestCase):
self.do_test_stop("block-commit", device="drive0")
if __name__ == '__main__':
- iotests.main(supported_fmts=["qcow2"])
+ iotests.main(supported_fmts=["qcow2"],
+ supported_protocols=["file"])
diff --git a/tests/qemu-iotests/132 b/tests/qemu-iotests/132
index f53ef6e391..0f2a106c81 100755
--- a/tests/qemu-iotests/132
+++ b/tests/qemu-iotests/132
@@ -56,4 +56,5 @@ class TestSingleDrive(iotests.QMPTestCase):
'target image does not match source after mirroring')
if __name__ == '__main__':
- iotests.main(supported_fmts=['raw', 'qcow2'])
+ iotests.main(supported_fmts=['raw', 'qcow2'],
+ supported_protocols=['file'])
diff --git a/tests/qemu-iotests/137 b/tests/qemu-iotests/137
index 0c3d2a1cf0..089821da0c 100755
--- a/tests/qemu-iotests/137
+++ b/tests/qemu-iotests/137
@@ -130,6 +130,7 @@ echo
# Whether lazy-refcounts was actually enabled can easily be tested: Check if
# the dirty bit is set after a crash
+_NO_VALGRIND \
$QEMU_IO \
-c "reopen -o lazy-refcounts=on,overlap-check=blubb" \
-c "write -P 0x5a 0 512" \
diff --git a/tests/qemu-iotests/137.out b/tests/qemu-iotests/137.out
index 22d59df40c..1c6569eb2c 100644
--- a/tests/qemu-iotests/137.out
+++ b/tests/qemu-iotests/137.out
@@ -35,11 +35,7 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
qemu-io: Unsupported value 'blubb' for qcow2 option 'overlap-check'. Allowed are any of the following: none, constant, cached, all
wrote 512/512 bytes at offset 0
512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-./common.rc: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then
- exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
-else
- exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
-fi )
+./common.rc: Killed ( VALGRIND_QEMU="${VALGRIND_QEMU_IO}" _qemu_proc_exec "${VALGRIND_LOGFILE}" "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@" )
incompatible_features 0x0
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
wrote 65536/65536 bytes at offset 0
diff --git a/tests/qemu-iotests/139 b/tests/qemu-iotests/139
index 2176ea51ba..cbb5a76530 100755
--- a/tests/qemu-iotests/139
+++ b/tests/qemu-iotests/139
@@ -358,4 +358,5 @@ class TestBlockdevDel(iotests.QMPTestCase):
if __name__ == '__main__':
- iotests.main(supported_fmts=["qcow2"])
+ iotests.main(supported_fmts=["qcow2"],
+ supported_protocols=["file"])
diff --git a/tests/qemu-iotests/147 b/tests/qemu-iotests/147
index 2d84fddb01..ab8480b9a4 100755
--- a/tests/qemu-iotests/147
+++ b/tests/qemu-iotests/147
@@ -287,6 +287,5 @@ class BuiltinNBD(NBDBlockdevAddBase):
if __name__ == '__main__':
- # Need to support image creation
- iotests.main(supported_fmts=['vpc', 'parallels', 'qcow', 'vdi', 'qcow2',
- 'vmdk', 'raw', 'vhdx', 'qed'])
+ iotests.main(supported_fmts=['raw'],
+ supported_protocols=['nbd'])
diff --git a/tests/qemu-iotests/148 b/tests/qemu-iotests/148
index e01b061fe7..8c11c53cba 100755
--- a/tests/qemu-iotests/148
+++ b/tests/qemu-iotests/148
@@ -137,4 +137,5 @@ class TestFifoQuorumEvents(TestQuorumEvents):
if __name__ == '__main__':
iotests.verify_quorum()
- iotests.main(supported_fmts=["raw"])
+ iotests.main(supported_fmts=["raw"],
+ supported_protocols=["file"])
diff --git a/tests/qemu-iotests/151 b/tests/qemu-iotests/151
index ad7359fc8d..76ae265cc1 100755
--- a/tests/qemu-iotests/151
+++ b/tests/qemu-iotests/151
@@ -142,4 +142,5 @@ class TestActiveMirror(iotests.QMPTestCase):
if __name__ == '__main__':
- iotests.main(supported_fmts=['qcow2', 'raw'])
+ iotests.main(supported_fmts=['qcow2', 'raw'],
+ supported_protocols=['file'])
diff --git a/tests/qemu-iotests/152 b/tests/qemu-iotests/152
index fec546d033..732bf5f062 100755
--- a/tests/qemu-iotests/152
+++ b/tests/qemu-iotests/152
@@ -59,4 +59,5 @@ class TestUnaligned(iotests.QMPTestCase):
if __name__ == '__main__':
- iotests.main(supported_fmts=['raw', 'qcow2'])
+ iotests.main(supported_fmts=['raw', 'qcow2'],
+ supported_protocols=['file'])
diff --git a/tests/qemu-iotests/155 b/tests/qemu-iotests/155
index 63a5b5e2c0..e19485911c 100755
--- a/tests/qemu-iotests/155
+++ b/tests/qemu-iotests/155
@@ -258,4 +258,5 @@ BaseClass = None
MirrorBaseClass = None
if __name__ == '__main__':
- iotests.main(supported_fmts=['qcow2'])
+ iotests.main(supported_fmts=['qcow2'],
+ supported_protocols=['file'])
diff --git a/tests/qemu-iotests/163 b/tests/qemu-iotests/163
index 158ba5d092..081ccc8ac1 100755
--- a/tests/qemu-iotests/163
+++ b/tests/qemu-iotests/163
@@ -170,4 +170,5 @@ class TestShrink1M(ShrinkBaseClass):
ShrinkBaseClass = None
if __name__ == '__main__':
- iotests.main(supported_fmts=['raw', 'qcow2'])
+ iotests.main(supported_fmts=['raw', 'qcow2'],
+ supported_protocols=['file'])
diff --git a/tests/qemu-iotests/165 b/tests/qemu-iotests/165
index 88f62d3c6d..5650dc7c87 100755
--- a/tests/qemu-iotests/165
+++ b/tests/qemu-iotests/165
@@ -103,4 +103,5 @@ class TestPersistentDirtyBitmap(iotests.QMPTestCase):
self.vm.shutdown()
if __name__ == '__main__':
- iotests.main(supported_fmts=['qcow2'])
+ iotests.main(supported_fmts=['qcow2'],
+ supported_protocols=['file'])
diff --git a/tests/qemu-iotests/169 b/tests/qemu-iotests/169
index 7e06cc1145..8c204caf20 100755
--- a/tests/qemu-iotests/169
+++ b/tests/qemu-iotests/169
@@ -227,4 +227,5 @@ for cmb in list(itertools.product((True, False), repeat=2)):
'do_test_migration_resume_source', *list(cmb))
if __name__ == '__main__':
- iotests.main(supported_fmts=['qcow2'])
+ iotests.main(supported_fmts=['qcow2'],
+ supported_protocols=['file'])
diff --git a/tests/qemu-iotests/183 b/tests/qemu-iotests/183
index fbe5a99beb..04fb344d08 100755
--- a/tests/qemu-iotests/183
+++ b/tests/qemu-iotests/183
@@ -94,8 +94,15 @@ if echo "$reply" | grep "compiled without old-style" > /dev/null; then
_notrun "migrate -b support not compiled in"
fi
-QEMU_COMM_TIMEOUT=0.1 qemu_cmd_repeat=50 silent=yes \
+timeout_comm=$QEMU_COMM_TIMEOUT
+if [ "${VALGRIND_QEMU}" == "y" ]; then
+ QEMU_COMM_TIMEOUT=4
+else
+ QEMU_COMM_TIMEOUT=0.1
+fi
+qemu_cmd_repeat=50 silent=yes \
_send_qemu_cmd $src "{ 'execute': 'query-migrate' }" '"status": "completed"'
+QEMU_COMM_TIMEOUT=$timeout_comm
_send_qemu_cmd $src "{ 'execute': 'query-status' }" "return"
echo
diff --git a/tests/qemu-iotests/192 b/tests/qemu-iotests/192
index 6193257764..034432272f 100755
--- a/tests/qemu-iotests/192
+++ b/tests/qemu-iotests/192
@@ -60,7 +60,11 @@ fi
qemu_comm_method="monitor"
_launch_qemu -drive $DRIVE_ARG -incoming defer
h=$QEMU_HANDLE
-QEMU_COMM_TIMEOUT=1
+if [ "${VALGRIND_QEMU}" == "y" ]; then
+ QEMU_COMM_TIMEOUT=7
+else
+ QEMU_COMM_TIMEOUT=1
+fi
_send_qemu_cmd $h "nbd_server_start unix:$TEST_DIR/nbd" "(qemu)"
_send_qemu_cmd $h "nbd_server_add -w drive0" "(qemu)"
diff --git a/tests/qemu-iotests/196 b/tests/qemu-iotests/196
index 4116ebc92b..92fe9244f8 100755
--- a/tests/qemu-iotests/196
+++ b/tests/qemu-iotests/196
@@ -63,4 +63,5 @@ class TestInvalidateAutoclear(iotests.QMPTestCase):
self.assertEqual(f.read(1), b'\x00')
if __name__ == '__main__':
- iotests.main(supported_fmts=['qcow2'])
+ iotests.main(supported_fmts=['qcow2'],
+ supported_protocols=['file'])
diff --git a/tests/qemu-iotests/199 b/tests/qemu-iotests/199
index 651e8df5d9..a2c8ecab5a 100755
--- a/tests/qemu-iotests/199
+++ b/tests/qemu-iotests/199
@@ -115,4 +115,5 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
self.assert_qmp(result, 'return/sha256', sha256);
if __name__ == '__main__':
- iotests.main(supported_fmts=['qcow2'], supported_cache_modes=['none'])
+ iotests.main(supported_fmts=['qcow2'], supported_cache_modes=['none'],
+ supported_protocols=['file'])
diff --git a/tests/qemu-iotests/205 b/tests/qemu-iotests/205
index b8a86c446e..76f6c5fa2b 100755
--- a/tests/qemu-iotests/205
+++ b/tests/qemu-iotests/205
@@ -153,4 +153,5 @@ class TestNbdServerRemove(iotests.QMPTestCase):
if __name__ == '__main__':
- iotests.main(supported_fmts=['generic'])
+ iotests.main(supported_fmts=['raw'],
+ supported_protocols=['nbd'])
diff --git a/tests/qemu-iotests/232 b/tests/qemu-iotests/232
index 2063f78876..65b0e42063 100755
--- a/tests/qemu-iotests/232
+++ b/tests/qemu-iotests/232
@@ -74,6 +74,12 @@ if [ -n "$TEST_IMG_FILE" ]; then
TEST_IMG=$TEST_IMG_FILE
fi
+chmod a-w $TEST_IMG
+(echo test > $TEST_IMG) 2>/dev/null && \
+ _notrun "Readonly attribute is ignored, probably you run this test as" \
+ "root, which is unsupported."
+chmod a+w $TEST_IMG
+
echo
echo "=== -drive with read-write image: read-only/auto-read-only combinations ==="
echo
diff --git a/tests/qemu-iotests/245 b/tests/qemu-iotests/245
index bc1ceb9792..41218d5f1d 100644
--- a/tests/qemu-iotests/245
+++ b/tests/qemu-iotests/245
@@ -1000,4 +1000,5 @@ class TestBlockdevReopen(iotests.QMPTestCase):
self.reopen(opts, {'backing': 'hd2'})
if __name__ == '__main__':
- iotests.main(supported_fmts=["qcow2"])
+ iotests.main(supported_fmts=["qcow2"],
+ supported_protocols=["file"])
diff --git a/tests/qemu-iotests/247 b/tests/qemu-iotests/247
index 546a794d3d..c853b73819 100755
--- a/tests/qemu-iotests/247
+++ b/tests/qemu-iotests/247
@@ -57,7 +57,11 @@ TEST_IMG="$TEST_IMG.4" _make_test_img $size
{"execute":"block-commit",
"arguments":{"device":"format-4", "top-node": "format-2", "base-node":"format-0", "job-id":"job0"}}
EOF
-sleep 1
+if [ "${VALGRIND_QEMU}" == "y" ]; then
+ sleep 10
+else
+ sleep 1
+fi
echo '{"execute":"quit"}'
) | $QEMU -qmp stdio -nographic -nodefaults \
-blockdev file,node-name=file-0,filename=$TEST_IMG.0,auto-read-only=on \
diff --git a/tests/qemu-iotests/257 b/tests/qemu-iotests/257
index c2a72c577a..4a636d8ab2 100755
--- a/tests/qemu-iotests/257
+++ b/tests/qemu-iotests/257
@@ -557,4 +557,5 @@ def main():
test_backup_api()
if __name__ == '__main__':
- iotests.script_main(main, supported_fmts=['qcow2'])
+ iotests.script_main(main, supported_fmts=['qcow2'],
+ supported_protocols=['file'])
diff --git a/tests/qemu-iotests/265 b/tests/qemu-iotests/265
new file mode 100755
index 0000000000..dce6f77be3
--- /dev/null
+++ b/tests/qemu-iotests/265
@@ -0,0 +1,67 @@
+#!/usr/bin/env bash
+#
+# Test reverse-ordered qcow2 writes on a sub-cluster level
+#
+# Copyright (C) 2019 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+seq=$(basename $0)
+echo "QA output created by $seq"
+
+status=1 # failure is the default!
+
+_cleanup()
+{
+ _cleanup_test_img
+}
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+# qcow2-specific test
+_supported_fmt qcow2
+_supported_proto file
+_supported_os Linux
+
+echo '--- Writing to the image ---'
+
+# Reduce cluster size so we get more and quicker I/O
+IMGOPTS='cluster_size=4096' _make_test_img 1M
+(for ((kb = 1024 - 4; kb >= 0; kb -= 4)); do \
+ echo "aio_write -P 42 $((kb + 1))k 2k"; \
+ done) \
+ | $QEMU_IO "$TEST_IMG" > /dev/null
+
+echo '--- Verifying its content ---'
+
+(for ((kb = 0; kb < 1024; kb += 4)); do \
+ echo "read -P 0 ${kb}k 1k"; \
+ echo "read -P 42 $((kb + 1))k 2k"; \
+ echo "read -P 0 $((kb + 3))k 1k"; \
+ done) \
+ | $QEMU_IO "$TEST_IMG" | _filter_qemu_io | grep 'verification'
+
+# Status of qemu-io
+if [ ${PIPESTATUS[1]} = 0 ]; then
+ echo 'Content verified.'
+fi
+
+# success, all done
+echo "*** done"
+rm -f $seq.full
+status=0
diff --git a/tests/qemu-iotests/265.out b/tests/qemu-iotests/265.out
new file mode 100644
index 0000000000..6eac620f25
--- /dev/null
+++ b/tests/qemu-iotests/265.out
@@ -0,0 +1,6 @@
+QA output created by 265
+--- Writing to the image ---
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576
+--- Verifying its content ---
+Content verified.
+*** done
diff --git a/tests/qemu-iotests/266 b/tests/qemu-iotests/266
new file mode 100755
index 0000000000..5b35cd67e4
--- /dev/null
+++ b/tests/qemu-iotests/266
@@ -0,0 +1,153 @@
+#!/usr/bin/env python
+#
+# Test VPC and file image creation
+#
+# Copyright (C) 2019 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+import iotests
+from iotests import imgfmt
+
+
+def blockdev_create(vm, options):
+ result = vm.qmp_log('blockdev-create', job_id='job0', options=options,
+ filters=[iotests.filter_qmp_testfiles])
+
+ if 'return' in result:
+ assert result['return'] == {}
+ vm.run_job('job0')
+
+
+# Successful image creation (defaults)
+def implicit_defaults(vm, file_path):
+ iotests.log("=== Successful image creation (defaults) ===")
+ iotests.log("")
+
+ # 8 heads, 964 cyls/head, 17 secs/cyl
+ # (Close to 64 MB)
+ size = 8 * 964 * 17 * 512
+
+ blockdev_create(vm, { 'driver': imgfmt,
+ 'file': 'protocol-node',
+ 'size': size })
+
+
+# Successful image creation (explicit defaults)
+def explicit_defaults(vm, file_path):
+ iotests.log("=== Successful image creation (explicit defaults) ===")
+ iotests.log("")
+
+ # 16 heads, 964 cyls/head, 17 secs/cyl
+ # (Close to 128 MB)
+ size = 16 * 964 * 17 * 512
+
+ blockdev_create(vm, { 'driver': imgfmt,
+ 'file': 'protocol-node',
+ 'size': size,
+ 'subformat': 'dynamic',
+ 'force-size': False })
+
+
+# Successful image creation (non-default options)
+def non_defaults(vm, file_path):
+ iotests.log("=== Successful image creation (non-default options) ===")
+ iotests.log("")
+
+ # Not representable in CHS (fine with force-size=True)
+ size = 1048576
+
+ blockdev_create(vm, { 'driver': imgfmt,
+ 'file': 'protocol-node',
+ 'size': size,
+ 'subformat': 'fixed',
+ 'force-size': True })
+
+
+# Size not representable in CHS with force-size=False
+def non_chs_size_without_force(vm, file_path):
+ iotests.log("=== Size not representable in CHS ===")
+ iotests.log("")
+
+ # Not representable in CHS (will not work with force-size=False)
+ size = 1048576
+
+ blockdev_create(vm, { 'driver': imgfmt,
+ 'file': 'protocol-node',
+ 'size': size,
+ 'force-size': False })
+
+
+# Zero size
+def zero_size(vm, file_path):
+ iotests.log("=== Zero size===")
+ iotests.log("")
+
+ blockdev_create(vm, { 'driver': imgfmt,
+ 'file': 'protocol-node',
+ 'size': 0 })
+
+
+# Maximum CHS size
+def maximum_chs_size(vm, file_path):
+ iotests.log("=== Maximum CHS size===")
+ iotests.log("")
+
+ blockdev_create(vm, { 'driver': imgfmt,
+ 'file': 'protocol-node',
+ 'size': 16 * 65535 * 255 * 512 })
+
+
+# Actual maximum size
+def maximum_size(vm, file_path):
+ iotests.log("=== Actual maximum size===")
+ iotests.log("")
+
+ blockdev_create(vm, { 'driver': imgfmt,
+ 'file': 'protocol-node',
+ 'size': 0xff000000 * 512,
+ 'force-size': True })
+
+
+def main():
+ for test_func in [implicit_defaults, explicit_defaults, non_defaults,
+ non_chs_size_without_force, zero_size, maximum_chs_size,
+ maximum_size]:
+
+ with iotests.FilePath('t.vpc') as file_path, \
+ iotests.VM() as vm:
+
+ vm.launch()
+
+ iotests.log('--- Creating empty file ---')
+ blockdev_create(vm, { 'driver': 'file',
+ 'filename': file_path,
+ 'size': 0 })
+
+ vm.qmp_log('blockdev-add', driver='file', filename=file_path,
+ node_name='protocol-node',
+ filters=[iotests.filter_qmp_testfiles])
+ iotests.log('')
+
+ print_info = test_func(vm, file_path)
+ iotests.log('')
+
+ vm.shutdown()
+ iotests.img_info_log(file_path)
+
+
+iotests.script_main(main,
+ supported_fmts=['vpc'],
+ supported_protocols=['file'])
diff --git a/tests/qemu-iotests/266.out b/tests/qemu-iotests/266.out
new file mode 100644
index 0000000000..b11953e81f
--- /dev/null
+++ b/tests/qemu-iotests/266.out
@@ -0,0 +1,137 @@
+--- Creating empty file ---
+{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "file", "filename": "TEST_DIR/PID-t.vpc", "size": 0}}}
+{"return": {}}
+{"execute": "job-dismiss", "arguments": {"id": "job0"}}
+{"return": {}}
+{"execute": "blockdev-add", "arguments": {"driver": "file", "filename": "TEST_DIR/PID-t.vpc", "node-name": "protocol-node"}}
+{"return": {}}
+
+=== Successful image creation (defaults) ===
+
+{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "vpc", "file": "protocol-node", "size": 67125248}}}
+{"return": {}}
+{"execute": "job-dismiss", "arguments": {"id": "job0"}}
+{"return": {}}
+
+image: TEST_IMG
+file format: IMGFMT
+virtual size: 64 MiB (67125248 bytes)
+cluster_size: 2097152
+
+--- Creating empty file ---
+{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "file", "filename": "TEST_DIR/PID-t.vpc", "size": 0}}}
+{"return": {}}
+{"execute": "job-dismiss", "arguments": {"id": "job0"}}
+{"return": {}}
+{"execute": "blockdev-add", "arguments": {"driver": "file", "filename": "TEST_DIR/PID-t.vpc", "node-name": "protocol-node"}}
+{"return": {}}
+
+=== Successful image creation (explicit defaults) ===
+
+{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "vpc", "file": "protocol-node", "force-size": false, "size": 134250496, "subformat": "dynamic"}}}
+{"return": {}}
+{"execute": "job-dismiss", "arguments": {"id": "job0"}}
+{"return": {}}
+
+image: TEST_IMG
+file format: IMGFMT
+virtual size: 128 MiB (134250496 bytes)
+cluster_size: 2097152
+
+--- Creating empty file ---
+{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "file", "filename": "TEST_DIR/PID-t.vpc", "size": 0}}}
+{"return": {}}
+{"execute": "job-dismiss", "arguments": {"id": "job0"}}
+{"return": {}}
+{"execute": "blockdev-add", "arguments": {"driver": "file", "filename": "TEST_DIR/PID-t.vpc", "node-name": "protocol-node"}}
+{"return": {}}
+
+=== Successful image creation (non-default options) ===
+
+{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "vpc", "file": "protocol-node", "force-size": true, "size": 1048576, "subformat": "fixed"}}}
+{"return": {}}
+{"execute": "job-dismiss", "arguments": {"id": "job0"}}
+{"return": {}}
+
+image: TEST_IMG
+file format: IMGFMT
+virtual size: 1 MiB (1048576 bytes)
+
+--- Creating empty file ---
+{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "file", "filename": "TEST_DIR/PID-t.vpc", "size": 0}}}
+{"return": {}}
+{"execute": "job-dismiss", "arguments": {"id": "job0"}}
+{"return": {}}
+{"execute": "blockdev-add", "arguments": {"driver": "file", "filename": "TEST_DIR/PID-t.vpc", "node-name": "protocol-node"}}
+{"return": {}}
+
+=== Size not representable in CHS ===
+
+{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "vpc", "file": "protocol-node", "force-size": false, "size": 1048576}}}
+{"return": {}}
+Job failed: The requested image size cannot be represented in CHS geometry
+{"execute": "job-dismiss", "arguments": {"id": "job0"}}
+{"return": {}}
+
+qemu-img: Could not open 'TEST_IMG': File too small for a VHD header
+
+--- Creating empty file ---
+{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "file", "filename": "TEST_DIR/PID-t.vpc", "size": 0}}}
+{"return": {}}
+{"execute": "job-dismiss", "arguments": {"id": "job0"}}
+{"return": {}}
+{"execute": "blockdev-add", "arguments": {"driver": "file", "filename": "TEST_DIR/PID-t.vpc", "node-name": "protocol-node"}}
+{"return": {}}
+
+=== Zero size===
+
+{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "vpc", "file": "protocol-node", "size": 0}}}
+{"return": {}}
+{"execute": "job-dismiss", "arguments": {"id": "job0"}}
+{"return": {}}
+
+image: TEST_IMG
+file format: IMGFMT
+virtual size: 0 B (0 bytes)
+cluster_size: 2097152
+
+--- Creating empty file ---
+{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "file", "filename": "TEST_DIR/PID-t.vpc", "size": 0}}}
+{"return": {}}
+{"execute": "job-dismiss", "arguments": {"id": "job0"}}
+{"return": {}}
+{"execute": "blockdev-add", "arguments": {"driver": "file", "filename": "TEST_DIR/PID-t.vpc", "node-name": "protocol-node"}}
+{"return": {}}
+
+=== Maximum CHS size===
+
+{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "vpc", "file": "protocol-node", "size": 136899993600}}}
+{"return": {}}
+{"execute": "job-dismiss", "arguments": {"id": "job0"}}
+{"return": {}}
+
+image: TEST_IMG
+file format: IMGFMT
+virtual size: 127 GiB (136899993600 bytes)
+cluster_size: 2097152
+
+--- Creating empty file ---
+{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "file", "filename": "TEST_DIR/PID-t.vpc", "size": 0}}}
+{"return": {}}
+{"execute": "job-dismiss", "arguments": {"id": "job0"}}
+{"return": {}}
+{"execute": "blockdev-add", "arguments": {"driver": "file", "filename": "TEST_DIR/PID-t.vpc", "node-name": "protocol-node"}}
+{"return": {}}
+
+=== Actual maximum size===
+
+{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "vpc", "file": "protocol-node", "force-size": true, "size": 2190433320960}}}
+{"return": {}}
+{"execute": "job-dismiss", "arguments": {"id": "job0"}}
+{"return": {}}
+
+image: TEST_IMG
+file format: IMGFMT
+virtual size: 1.99 TiB (2190433320960 bytes)
+cluster_size: 2097152
+
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index ee20be8920..e45cdfa66b 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -60,19 +60,68 @@ if ! . ./common.config
exit 1
fi
+# Set the variables to the empty string to turn Valgrind off
+# for specific processes, e.g.
+# $ VALGRIND_QEMU_IO= ./check -qcow2 -valgrind 015
+
+: ${VALGRIND_QEMU_VM=$VALGRIND_QEMU}
+: ${VALGRIND_QEMU_IMG=$VALGRIND_QEMU}
+: ${VALGRIND_QEMU_IO=$VALGRIND_QEMU}
+: ${VALGRIND_QEMU_NBD=$VALGRIND_QEMU}
+: ${VALGRIND_QEMU_VXHS=$VALGRIND_QEMU}
+
+# The Valgrind own parameters may be set with
+# its environment variable VALGRIND_OPTS, e.g.
+# $ VALGRIND_OPTS="--leak-check=yes" ./check -qcow2 -valgrind 015
+
+_qemu_proc_exec()
+{
+ local VALGRIND_LOGFILE="$1"
+ shift
+ if [[ "${VALGRIND_QEMU}" == "y" && "${NO_VALGRIND}" != "y" ]]; then
+ exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$@"
+ else
+ exec "$@"
+ fi
+}
+
+_qemu_proc_valgrind_log()
+{
+ local VALGRIND_LOGFILE="$1"
+ local RETVAL="$2"
+ if [[ "${VALGRIND_QEMU}" == "y" && "${NO_VALGRIND}" != "y" ]]; then
+ if [ $RETVAL == 99 ]; then
+ cat "${VALGRIND_LOGFILE}"
+ fi
+ rm -f "${VALGRIND_LOGFILE}"
+ fi
+}
+
_qemu_wrapper()
{
+ local VALGRIND_LOGFILE="${TEST_DIR}"/$$.valgrind
(
if [ -n "${QEMU_NEED_PID}" ]; then
echo $BASHPID > "${QEMU_TEST_DIR}/qemu-${_QEMU_HANDLE}.pid"
fi
- exec "$QEMU_PROG" $QEMU_OPTIONS "$@"
+ VALGRIND_QEMU="${VALGRIND_QEMU_VM}" _qemu_proc_exec "${VALGRIND_LOGFILE}" \
+ "$QEMU_PROG" $QEMU_OPTIONS "$@"
)
+ RETVAL=$?
+ _qemu_proc_valgrind_log "${VALGRIND_LOGFILE}" $RETVAL
+ return $RETVAL
}
_qemu_img_wrapper()
{
- (exec "$QEMU_IMG_PROG" $QEMU_IMG_OPTIONS "$@")
+ local VALGRIND_LOGFILE="${TEST_DIR}"/$$.valgrind
+ (
+ VALGRIND_QEMU="${VALGRIND_QEMU_IMG}" _qemu_proc_exec "${VALGRIND_LOGFILE}" \
+ "$QEMU_IMG_PROG" $QEMU_IMG_OPTIONS "$@"
+ )
+ RETVAL=$?
+ _qemu_proc_valgrind_log "${VALGRIND_LOGFILE}" $RETVAL
+ return $RETVAL
}
_qemu_io_wrapper()
@@ -85,36 +134,47 @@ _qemu_io_wrapper()
QEMU_IO_ARGS="--object secret,id=keysec0,data=$IMGKEYSECRET $QEMU_IO_ARGS"
fi
fi
- local RETVAL
(
- if [ "${VALGRIND_QEMU}" == "y" ]; then
- exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"
- else
- exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"
- fi
+ VALGRIND_QEMU="${VALGRIND_QEMU_IO}" _qemu_proc_exec "${VALGRIND_LOGFILE}" \
+ "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"
)
RETVAL=$?
- if [ "${VALGRIND_QEMU}" == "y" ]; then
- if [ $RETVAL == 99 ]; then
- cat "${VALGRIND_LOGFILE}"
- fi
- rm -f "${VALGRIND_LOGFILE}"
- fi
- (exit $RETVAL)
+ _qemu_proc_valgrind_log "${VALGRIND_LOGFILE}" $RETVAL
+ return $RETVAL
}
_qemu_nbd_wrapper()
{
- "$QEMU_NBD_PROG" --pid-file="${QEMU_TEST_DIR}/qemu-nbd.pid" \
- $QEMU_NBD_OPTIONS "$@"
+ local VALGRIND_LOGFILE="${TEST_DIR}"/$$.valgrind
+ (
+ VALGRIND_QEMU="${VALGRIND_QEMU_NBD}" _qemu_proc_exec "${VALGRIND_LOGFILE}" \
+ "$QEMU_NBD_PROG" --pid-file="${QEMU_TEST_DIR}/qemu-nbd.pid" \
+ $QEMU_NBD_OPTIONS "$@"
+ )
+ RETVAL=$?
+ _qemu_proc_valgrind_log "${VALGRIND_LOGFILE}" $RETVAL
+ return $RETVAL
}
_qemu_vxhs_wrapper()
{
+ local VALGRIND_LOGFILE="${TEST_DIR}"/$$.valgrind
(
echo $BASHPID > "${TEST_DIR}/qemu-vxhs.pid"
- exec "$QEMU_VXHS_PROG" $QEMU_VXHS_OPTIONS "$@"
+ VALGRIND_QEMU="${VALGRIND_QEMU_VXHS}" _qemu_proc_exec "${VALGRIND_LOGFILE}" \
+ "$QEMU_VXHS_PROG" $QEMU_VXHS_OPTIONS "$@"
)
+ RETVAL=$?
+ _qemu_proc_valgrind_log "${VALGRIND_LOGFILE}" $RETVAL
+ return $RETVAL
+}
+
+# Valgrind bug #409141 https://bugs.kde.org/show_bug.cgi?id=409141
+# Until valgrind 3.16+ is ubiquitous, we must work around a hang in
+# valgrind when issuing sigkill. Disable valgrind for this invocation.
+_NO_VALGRIND()
+{
+ NO_VALGRIND="y" "$@"
}
export QEMU=_qemu_wrapper
@@ -395,6 +455,15 @@ _notrun()
exit
}
+# bail out, setting up .casenotrun file
+# The function _casenotrun() is used as a notifier. It is the
+# caller's responsibility to make skipped a particular test.
+#
+_casenotrun()
+{
+ echo " [case not run] $*" >>"$OUTPUT_DIR/$seq.casenotrun"
+}
+
# just plain bail out
#
_fail()
diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
index d95d556414..6082c74806 100644
--- a/tests/qemu-iotests/group
+++ b/tests/qemu-iotests/group
@@ -274,3 +274,5 @@
257 rw
258 rw quick
262 rw quick migration
+265 rw auto quick
+266 rw quick
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 84438e837c..b26271187c 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -909,7 +909,8 @@ def execute_unittest(output, verbosity, debug):
def execute_test(test_function=None,
supported_fmts=[], supported_oses=['linux'],
- supported_cache_modes=[], unsupported_fmts=[]):
+ supported_cache_modes=[], unsupported_fmts=[],
+ supported_protocols=[], unsupported_protocols=[]):
"""Run either unittest or script-style tests."""
# We are using TEST_DIR and QEMU_DEFAULT_MACHINE as proxies to
@@ -923,6 +924,7 @@ def execute_test(test_function=None,
debug = '-d' in sys.argv
verbosity = 1
verify_image_format(supported_fmts, unsupported_fmts)
+ verify_protocol(supported_protocols, unsupported_protocols)
verify_platform(supported_oses)
verify_cache_mode(supported_cache_modes)
diff --git a/tests/tcg/.gitignore b/tests/tcg/.gitignore
new file mode 100644
index 0000000000..84d7541b28
--- /dev/null
+++ b/tests/tcg/.gitignore
@@ -0,0 +1,5 @@
+# These are build artefacts which only appear when you are doing
+# builds directly in the source tree.
+config-*.mak
+*-softmmu/
+*-linux-user/
diff --git a/tests/tcg/Makefile.include b/tests/tcg/Makefile.include
deleted file mode 100644
index 73b5626fc5..0000000000
--- a/tests/tcg/Makefile.include
+++ /dev/null
@@ -1,88 +0,0 @@
-# -*- Mode: makefile -*-
-#
-# TCG tests (per-target rules)
-#
-# This Makefile fragment is included from the per-target
-# Makefile.target so will be invoked for each linux-user program we
-# build. We have two options for compiling, either using a configured
-# guest compiler or calling one of our docker images to do it for us.
-#
-
-# The per ARCH makefile, if it exists, holds extra information about
-# useful docker images or alternative compiler flags.
-
--include $(SRC_PATH)/tests/tcg/$(TARGET_BASE_ARCH)/Makefile.include
--include $(SRC_PATH)/tests/tcg/$(TARGET_NAME)/Makefile.include
-
-GUEST_BUILD=
-TCG_MAKE=$(SRC_PATH)/tests/tcg/Makefile
-# Support installed Cross Compilers
-
-ifdef CROSS_CC_GUEST
-
-.PHONY: cross-build-guest-tests
-cross-build-guest-tests:
- $(call quiet-command, \
- (mkdir -p tests && cd tests && \
- $(MAKE) -f $(TCG_MAKE) CC=$(CROSS_CC_GUEST) \
- BUILD_STATIC=$(CROSS_CC_GUEST_STATIC) \
- EXTRA_CFLAGS=$(CROSS_CC_GUEST_CFLAGS)), \
- "BUILD","$(TARGET_NAME) guest-tests with $(CROSS_CC_GUEST)")
-
-GUEST_BUILD=cross-build-guest-tests
-
-endif
-
-# Support building with Docker
-
-ifeq ($(HAVE_USER_DOCKER)$(GUEST_BUILD),y)
-ifneq ($(DOCKER_IMAGE),)
-
-# We also need the Docker make rules to depend on
-include $(SRC_PATH)/tests/docker/Makefile.include
-
-DOCKER_COMPILE_CMD="$(DOCKER_SCRIPT) cc --user $(shell id -u) \
- --cc $(DOCKER_CROSS_COMPILER) \
- -i qemu:$(DOCKER_IMAGE) \
- -s $(SRC_PATH) -- "
-DOCKER_PREREQ=docker-image-$(DOCKER_IMAGE)
-
-.PHONY: docker-build-guest-tests
-docker-build-guest-tests: $(DOCKER_PREREQ)
- $(call quiet-command, \
- (mkdir -p tests && cd tests && \
- $(MAKE) -f $(TCG_MAKE) CC=$(DOCKER_COMPILE_CMD) \
- BUILD_STATIC=y \
- EXTRA_CFLAGS=$(DOCKER_CROSS_COMPILER_CFLAGS)), \
- "BUILD","$(TARGET_NAME) guest-tests with docker qemu:$(DOCKER_IMAGE)")
-
-GUEST_BUILD=docker-build-guest-tests
-
-endif
-endif
-
-# Final targets
-.PHONY: guest-tests
-
-ifneq ($(GUEST_BUILD),)
-guest-tests: $(GUEST_BUILD)
-
-run-guest-tests: guest-tests qemu-$(subst y,system-,$(CONFIG_SOFTMMU))$(TARGET_NAME)
- $(call quiet-command, \
- (cd tests && $(MAKE) -f $(TCG_MAKE) SPEED=$(SPEED) run), \
- "RUN", "tests for $(TARGET_NAME)")
-
-else
-guest-tests:
- $(call quiet-command, /bin/true, "BUILD", \
- "$(TARGET_NAME) guest-tests SKIPPED")
-
-run-guest-tests:
- $(call quiet-command, /bin/true, "RUN", \
- "tests for $(TARGET_NAME) SKIPPED")
-endif
-
-# It doesn't matter if these don't exits
-.PHONY: clean-guest-tests
-clean-guest-tests:
- rm -rf tests || echo "no $(TARGET_NAME) tests to remove"
diff --git a/tests/tcg/Makefile.prereqs b/tests/tcg/Makefile.prereqs
new file mode 100644
index 0000000000..7494b31b95
--- /dev/null
+++ b/tests/tcg/Makefile.prereqs
@@ -0,0 +1,18 @@
+# -*- Mode: makefile -*-
+#
+# TCG Compiler Probe
+#
+# This Makefile fragment is included multiple times in the main make
+# script to probe for available compilers. This is used to build up a
+# selection of required docker targets before we invoke a sub-make for
+# each target.
+
+DOCKER_IMAGE:=
+
+-include $(BUILD_DIR)/tests/tcg/config-$(PROBE_TARGET).mak
+
+ifneq ($(DOCKER_IMAGE),)
+build-tcg-tests-$(PROBE_TARGET): docker-image-$(DOCKER_IMAGE)
+$(BUILD_DIR)/tests/tcg/config_$(PROBE_TARGET).mak: config-host.mak
+config-host.mak: $(SRC_PATH)/tests/tcg/configure.sh
+endif
diff --git a/tests/tcg/Makefile.probe b/tests/tcg/Makefile.probe
deleted file mode 100644
index 9dc654663d..0000000000
--- a/tests/tcg/Makefile.probe
+++ /dev/null
@@ -1,31 +0,0 @@
-# -*- Mode: makefile -*-
-#
-# TCG Compiler Probe
-#
-# This Makefile fragment is included multiple times in the main make
-# script to probe for available compilers. This is used to build up a
-# selection of required docker targets before we invoke a sub-make for
-# each target.
-
-# First we need the target makefile which tells us the target architecture
--include $(BUILD_DIR)/$(PROBE_TARGET)/config-target.mak
-
-# Then we load up the target architecture makefiles which tell us
-# about the compilers
-CROSS_CC_GUEST:=
-DOCKER_IMAGE:=
-DOCKER_PREREQ:=
-
--include $(SRC_PATH)/tests/tcg/$(TARGET_BASE_ARCH)/Makefile.include
--include $(SRC_PATH)/tests/tcg/$(TARGET_NAME)/Makefile.include
-
-ifndef CROSS_CC_GUEST
-ifneq ($(DOCKER_IMAGE),)
-DOCKER_PREREQ:=docker-image-$(DOCKER_IMAGE)
-endif
-endif
-
-# Clean-up
-# undefine TARGET_NAME
-# undefine TARGET_BASE_ARCH
-# undefine TARGET_ABI_DIR
diff --git a/tests/tcg/Makefile.qemu b/tests/tcg/Makefile.qemu
new file mode 100644
index 0000000000..9c23aeaa2a
--- /dev/null
+++ b/tests/tcg/Makefile.qemu
@@ -0,0 +1,95 @@
+# -*- Mode: makefile -*-
+#
+# TCG tests (per-target rules)
+#
+# This Makefile fragment is included from the build-tcg target, once
+# for each target we build. We have two options for compiling, either
+# using a configured guest compiler or calling one of our docker images
+# to do it for us.
+#
+
+include $(SRC_PATH)/rules.mak
+
+# The configure script fills in extra information about
+# useful docker images or alternative compiler flags.
+
+CROSS_CC_GUEST:=
+DOCKER_IMAGE:=
+-include $(BUILD_DIR)/tests/tcg/config-$(TARGET).mak
+
+GUEST_BUILD=
+TCG_MAKE=../Makefile.target
+
+# We also need the Docker make rules to depend on
+SKIP_DOCKER_BUILD=1
+include $(SRC_PATH)/tests/docker/Makefile.include
+
+# Support installed Cross Compilers
+
+ifdef CROSS_CC_GUEST
+
+.PHONY: cross-build-guest-tests
+cross-build-guest-tests:
+ $(call quiet-command, \
+ (mkdir -p tests/tcg/$(TARGET) && cd tests/tcg/$(TARGET) && \
+ $(MAKE) -f $(TCG_MAKE) TARGET="$(TARGET)" CC="$(CROSS_CC_GUEST)" \
+ SRC_PATH="$(SRC_PATH)" BUILD_STATIC=$(CROSS_CC_GUEST_STATIC) \
+ EXTRA_CFLAGS="$(CROSS_CC_GUEST_CFLAGS)"), \
+ "BUILD","$(TARGET) guest-tests with $(CROSS_CC_GUEST)")
+
+GUEST_BUILD=cross-build-guest-tests
+
+endif
+
+# Support building with Docker
+
+ifneq ($(DOCKER_IMAGE),)
+
+DOCKER_COMPILE_CMD="$(DOCKER_SCRIPT) cc \
+ --cc $(DOCKER_CROSS_CC_GUEST) \
+ -i qemu:$(DOCKER_IMAGE) \
+ -s $(SRC_PATH) -- "
+
+.PHONY: docker-build-guest-tests
+docker-build-guest-tests: docker-image-$(DOCKER_IMAGE)
+ $(call quiet-command, \
+ (mkdir -p tests/tcg/$(TARGET) && cd tests/tcg/$(TARGET) && \
+ $(MAKE) -f $(TCG_MAKE) TARGET="$(TARGET)" CC=$(DOCKER_COMPILE_CMD) \
+ SRC_PATH="$(SRC_PATH)" BUILD_STATIC=y \
+ EXTRA_CFLAGS="$(CROSS_CC_GUEST_CFLAGS)"), \
+ "BUILD","$(TARGET) guest-tests with docker qemu:$(DOCKER_IMAGE)")
+
+GUEST_BUILD=docker-build-guest-tests
+
+endif
+
+# Final targets
+all:
+ @echo "Do not invoke this Makefile directly"; exit 1
+
+.PHONY: guest-tests
+
+ifneq ($(GUEST_BUILD),)
+guest-tests: $(GUEST_BUILD)
+
+run-guest-tests: guest-tests
+ $(call quiet-command, \
+ (cd tests/tcg/$(TARGET) && \
+ $(MAKE) -f $(TCG_MAKE) TARGET="$(TARGET)" \
+ SRC_PATH="$(SRC_PATH)" SPEED=$(SPEED) run), \
+ "RUN", "tests for $(TARGET_NAME)")
+
+else
+guest-tests:
+ $(call quiet-command, /bin/true, "BUILD", \
+ "$(TARGET) guest-tests SKIPPED")
+
+run-guest-tests:
+ $(call quiet-command, /bin/true, "RUN", \
+ "tests for $(TARGET) SKIPPED")
+endif
+
+# It doesn't matter if these don't exits
+.PHONY: clean-guest-tests
+clean-guest-tests:
+ rm -rf tests/tcg/$(TARGET)
diff --git a/tests/tcg/Makefile b/tests/tcg/Makefile.target
index 9f56768624..8808beaf74 100644
--- a/tests/tcg/Makefile
+++ b/tests/tcg/Makefile.target
@@ -29,8 +29,9 @@
# We also expect to be in the tests build dir for the FOO-(linux-user|softmmu).
#
+all:
-include ../../config-host.mak
--include ../config-target.mak
+-include ../config-$(TARGET).mak
# for including , in command strings
COMMA := ,
@@ -62,12 +63,6 @@ CFLAGS=
QEMU_CFLAGS=
LDFLAGS=
-# The QEMU for this TARGET
-ifdef CONFIG_USER_ONLY
-QEMU=../qemu-$(TARGET_NAME)
-else
-QEMU=../qemu-system-$(TARGET_NAME)
-endif
QEMU_OPTS=
@@ -82,10 +77,7 @@ ifdef CONFIG_USER_ONLY
# The order we include is important. We include multiarch, base arch
# and finally arch if it's not the same as base arch.
-include $(SRC_PATH)/tests/tcg/multiarch/Makefile.target
--include $(SRC_PATH)/tests/tcg/$(TARGET_BASE_ARCH)/Makefile.target
-ifneq ($(TARGET_BASE_ARCH),$(TARGET_NAME))
-include $(SRC_PATH)/tests/tcg/$(TARGET_NAME)/Makefile.target
-endif
# Add the common build options
CFLAGS+=-Wall -O0 -g -fno-strict-aliasing
@@ -101,10 +93,7 @@ else
# are expected to provide their own build recipes.
-include $(SRC_PATH)/tests/tcg/minilib/Makefile.target
-include $(SRC_PATH)/tests/tcg/multiarch/system/Makefile.softmmu-target
--include $(SRC_PATH)/tests/tcg/$(TARGET_BASE_ARCH)/Makefile.softmmu-target
-ifneq ($(TARGET_BASE_ARCH),$(TARGET_NAME))
-include $(SRC_PATH)/tests/tcg/$(TARGET_NAME)/Makefile.softmmu-target
-endif
endif
diff --git a/tests/tcg/aarch64/Makefile.include b/tests/tcg/aarch64/Makefile.include
deleted file mode 100644
index 5d4e4c6f99..0000000000
--- a/tests/tcg/aarch64/Makefile.include
+++ /dev/null
@@ -1,8 +0,0 @@
-# Makefile.include for AArch64 targets
-#
-# We don't have any bigendian build tools so we only use this for AArch64
-
-ifeq ($(TARGET_NAME),aarch64)
-DOCKER_IMAGE=debian-buster-arm64-cross
-DOCKER_CROSS_COMPILER=aarch64-linux-gnu-gcc
-endif
diff --git a/tests/tcg/aarch64/Makefile.softmmu-target b/tests/tcg/aarch64/Makefile.softmmu-target
index 2e560e4d08..4c4aaf61dd 100644
--- a/tests/tcg/aarch64/Makefile.softmmu-target
+++ b/tests/tcg/aarch64/Makefile.softmmu-target
@@ -22,11 +22,11 @@ LDFLAGS+=-static -nostdlib $(CRT_OBJS) $(MINILIB_OBJS) -lgcc
.PRECIOUS: $(CRT_OBJS)
%.o: $(CRT_PATH)/%.S
- $(CC) $(CFLAGS) -x assembler-with-cpp -c $< -o $@
+ $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -x assembler-with-cpp -c $< -o $@
# Build and link the tests
%: %.c $(LINK_SCRIPT) $(CRT_OBJS) $(MINILIB_OBJS)
- $(CC) $(CFLAGS) $< -o $@ $(LDFLAGS)
+ $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
memory: CFLAGS+=-DCHECK_UNALIGNED=1
diff --git a/tests/tcg/aarch64/Makefile.target b/tests/tcg/aarch64/Makefile.target
index 31ba9cfcaa..e763dd9da3 100644
--- a/tests/tcg/aarch64/Makefile.target
+++ b/tests/tcg/aarch64/Makefile.target
@@ -2,12 +2,14 @@
#
# AArch64 specific tweaks
+ARM_SRC=$(SRC_PATH)/tests/tcg/arm
+VPATH += $(ARM_SRC)
+
AARCH64_SRC=$(SRC_PATH)/tests/tcg/aarch64
VPATH += $(AARCH64_SRC)
-# we don't build any of the ARM tests
-AARCH64_TESTS=$(filter-out $(ARM_TESTS), $(TESTS))
-AARCH64_TESTS+=fcvt
+# we don't build any other ARM test
+AARCH64_TESTS=fcvt
fcvt: LDFLAGS+=-lm
@@ -16,6 +18,6 @@ run-fcvt: fcvt
$(call diff-out,$<,$(AARCH64_SRC)/fcvt.ref)
AARCH64_TESTS += pauth-1 pauth-2
-run-pauth-%: QEMU += -cpu max
+run-pauth-%: QEMU_OPTS += -cpu max
-TESTS:=$(AARCH64_TESTS)
+TESTS += $(AARCH64_TESTS)
diff --git a/tests/tcg/alpha/Makefile.include b/tests/tcg/alpha/Makefile.include
deleted file mode 100644
index c7dc48eadb..0000000000
--- a/tests/tcg/alpha/Makefile.include
+++ /dev/null
@@ -1,2 +0,0 @@
-DOCKER_IMAGE=debian-alpha-cross
-DOCKER_CROSS_COMPILER=alpha-linux-gnu-gcc
diff --git a/tests/tcg/alpha/Makefile.softmmu-target b/tests/tcg/alpha/Makefile.softmmu-target
index 3c0f34cc69..09193a62d6 100644
--- a/tests/tcg/alpha/Makefile.softmmu-target
+++ b/tests/tcg/alpha/Makefile.softmmu-target
@@ -22,11 +22,11 @@ LDFLAGS+=-static -nostdlib $(CRT_OBJS) $(MINILIB_OBJS) -lgcc
.PRECIOUS: $(CRT_OBJS)
%.o: $(CRT_PATH)/%.S
- $(CC) $(CFLAGS) -x assembler-with-cpp -c $< -o $@
+ $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -x assembler-with-cpp -c $< -o $@
# Build and link the tests
%: %.c $(LINK_SCRIPT) $(CRT_OBJS) $(MINILIB_OBJS)
- $(CC) $(CFLAGS) $< -o $@ $(LDFLAGS)
+ $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
memory: CFLAGS+=-DCHECK_UNALIGNED=0
diff --git a/tests/tcg/arm/Makefile.include b/tests/tcg/arm/Makefile.include
deleted file mode 100644
index 8e7eac008f..0000000000
--- a/tests/tcg/arm/Makefile.include
+++ /dev/null
@@ -1,8 +0,0 @@
-# Makefile.include for all ARM targets
-#
-# We don't have any bigendian build tools so we only use this for armhf
-
-ifeq ($(TARGET_NAME),arm)
-DOCKER_IMAGE=debian-armhf-cross
-DOCKER_CROSS_COMPILER=arm-linux-gnueabihf-gcc
-endif
diff --git a/tests/tcg/arm/Makefile.softmmu-target b/tests/tcg/arm/Makefile.softmmu-target
index 49d48d8a1c..231e9a57b4 100644
--- a/tests/tcg/arm/Makefile.softmmu-target
+++ b/tests/tcg/arm/Makefile.softmmu-target
@@ -3,8 +3,6 @@
# ARM SoftMMU tests - included from tests/tcg/Makefile
#
-ifeq ($(TARGET_ABI_DIR),arm)
-
ARM_SRC=$(SRC_PATH)/tests/tcg/arm
# Set search path for all sources
@@ -18,12 +16,10 @@ CFLAGS+=-Wl,--build-id=none -x assembler-with-cpp
LDFLAGS+=-nostdlib -N -static
%: %.S %.ld
- $(CC) $(CFLAGS) $(ASFLAGS) $< -o $@ $(LDFLAGS) -T $(ARM_SRC)/$@.ld
+ $(CC) $(CFLAGS) $(ASFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS) -T $(ARM_SRC)/$@.ld
# Specific Test Rules
test-armv6m-undef: EXTRA_CFLAGS+=-mcpu=cortex-m0
run-test-armv6m-undef: QEMU_OPTS+=-semihosting -M microbit -kernel
-
-endif
diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh
new file mode 100755
index 0000000000..6c4a471aea
--- /dev/null
+++ b/tests/tcg/configure.sh
@@ -0,0 +1,234 @@
+#! /bin/sh
+
+if test -z "$source_path"; then
+ echo Do not invoke this script directly. It is called
+ echo automatically by configure.
+ exit 1
+fi
+
+write_c_skeleton() {
+ cat > $TMPC <<EOF
+int main(void) { return 0; }
+EOF
+}
+
+has() {
+ command -v "$1" >/dev/null 2>&1
+}
+
+do_compiler() {
+ # Run the compiler, capturing its output to the log. First argument
+ # is compiler binary to execute.
+ local compiler="$1"
+ shift
+ if test -n "$BASH_VERSION"; then eval '
+ echo >>config.log "
+funcs: ${FUNCNAME[*]}
+lines: ${BASH_LINENO[*]}"
+ '; fi
+ echo $compiler "$@" >> config.log
+ $compiler "$@" >> config.log 2>&1 || return $?
+}
+
+
+TMPDIR1="config-temp"
+TMPC="${TMPDIR1}/qemu-conf.c"
+TMPE="${TMPDIR1}/qemu-conf.exe"
+
+container="no"
+if has "docker" || has "podman"; then
+ container=$($python $source_path/tests/docker/docker.py probe)
+fi
+
+# cross compilers defaults, can be overridden with --cross-cc-ARCH
+: ${cross_cc_aarch64="aarch64-linux-gnu-gcc"}
+: ${cross_cc_aarch64_be="$cross_cc_aarch64"}
+: ${cross_cc_cflags_aarch64_be="-mbig-endian"}
+: ${cross_cc_arm="arm-linux-gnueabihf-gcc"}
+: ${cross_cc_cflags_armeb="-mbig-endian"}
+: ${cross_cc_i386="i386-pc-linux-gnu-gcc"}
+: ${cross_cc_cflags_i386="-m32"}
+: ${cross_cc_x86_64="x86_64-pc-linux-gnu-gcc"}
+: ${cross_cc_cflags_x86_64="-m64"}
+: ${cross_cc_ppc="powerpc-linux-gnu-gcc"}
+: ${cross_cc_cflags_ppc="-m32"}
+: ${cross_cc_ppc64="powerpc-linux-gnu-gcc"}
+: ${cross_cc_cflags_ppc64="-m64"}
+: ${cross_cc_ppc64le="powerpc64le-linux-gnu-gcc"}
+: ${cross_cc_cflags_s390x="-m64"}
+: ${cross_cc_cflags_sparc="-m32 -mv8plus -mcpu=ultrasparc"}
+: ${cross_cc_cflags_sparc64="-m64 -mcpu=ultrasparc"}
+
+for target in $target_list; do
+ arch=${target%%-*}
+ case $arch in
+ arm|armeb)
+ arches=arm
+ ;;
+ aarch64|aarch64_be)
+ arches="aarch64 arm"
+ ;;
+ mips*)
+ arches=mips
+ ;;
+ ppc*)
+ arches=ppc
+ ;;
+ sh4|sh4eb)
+ arches=sh4
+ ;;
+ x86_64)
+ arches="x86_64 i386"
+ ;;
+ xtensa|xtensaeb)
+ arches=xtensa
+ ;;
+ alpha|cris|hppa|i386|lm32|m68k|openrisc|riscv64|s390x|sh4|sparc64)
+ arches=$target
+ ;;
+ *)
+ continue
+ ;;
+ esac
+
+ container_image=
+ case $target in
+ aarch64-*)
+ # We don't have any bigendian build tools so we only use this for AArch64
+ container_image=debian-arm64-cross
+ container_cross_cc=aarch64-linux-gnu-gcc
+ ;;
+ alpha-*)
+ container_image=debian-alpha-cross
+ container_cross_cc=alpha-linux-gnu-gcc
+ ;;
+ arm-*)
+ # We don't have any bigendian build tools so we only use this for ARM
+ container_image=debian-armhf-cross
+ container_cross_cc=arm-linux-gnueabihf-gcc
+ ;;
+ cris-*)
+ container_image=fedora-cris-cross
+ container_cross_cc=cris-linux-gnu-gcc
+ ;;
+ hppa-*)
+ container_image=debian-hppa-cross
+ container_cross_cc=hppa-linux-gnu-gcc
+ ;;
+ i386-*)
+ container_image=fedora-i386-cross
+ container_cross_cc=gcc
+ ;;
+ m68k-*)
+ container_image=debian-m68k-cross
+ container_cross_cc=m68k-linux-gnu-gcc
+ ;;
+ mips64el-*)
+ container_image=debian-mips64el-cross
+ container_cross_cc=mips64el-linux-gnuabi64-gcc
+ ;;
+ mips64-*)
+ container_image=debian-mips64-cross
+ container_cross_cc=mips64-linux-gnuabi64-gcc
+ ;;
+ mipsel-*)
+ container_image=debian-mipsel-cross
+ container_cross_cc=mipsel-linux-gnu-gcc
+ ;;
+ mips-*)
+ container_image=debian-mips-cross
+ container_cross_cc=mips-linux-gnu-gcc
+ ;;
+ ppc-*|ppc64abi32-*)
+ container_image=debian-powerpc-cross
+ container_cross_cc=powerpc-linux-gnu-gcc
+ ;;
+ ppc64-*)
+ container_image=debian-ppc64-cross
+ container_cross_cc=powerpc64-linux-gnu-gcc
+ ;;
+ ppc64le-*)
+ container_image=debian-ppc64el-cross
+ container_cross_cc=powerpc64le-linux-gnu-gcc
+ ;;
+ riscv64-*)
+ container_image=debian-riscv64-cross
+ container_cross_cc=riscv64-linux-gnu-gcc
+ ;;
+ s390x-*)
+ container_image=debian-s390x-cross
+ container_cross_cc=s390x-linux-gnu-gcc
+ ;;
+ sh4-*)
+ container_image=debian-sh4-cross
+ container_cross_cc=sh4-linux-gnu-gcc
+ ;;
+ sparc64-*)
+ container_image=debian-sparc64-cross
+ container_cross_cc=sparc64-linux-gnu-gcc
+ ;;
+ xtensa*-softmmu)
+ container_image=debian-xtensa-cross
+
+ # default to the dc232b cpu
+ container_cross_cc=/opt/2018.02/xtensa-dc232b-elf/bin/xtensa-dc232b-elf-gcc
+ ;;
+ esac
+
+ config_target_mak=tests/tcg/config-$target.mak
+
+ echo "# Automatically generated by configure - do not modify" > $config_target_mak
+ echo "TARGET_NAME=$arch" >> $config_target_mak
+ case $target in
+ *-linux-user | *-bsd-user)
+ echo "CONFIG_USER_ONLY=y" >> $config_target_mak
+ echo "QEMU=\$(BUILD_DIR)/$target/qemu-$arch" >> $config_target_mak
+ ;;
+ *-softmmu)
+ echo "CONFIG_SOFTMMU=y" >> $config_target_mak
+ echo "QEMU=\$(BUILD_DIR)/$target/qemu-system-$arch" >> $config_target_mak
+ ;;
+ esac
+
+ eval "target_compiler_cflags=\${cross_cc_cflags_$arch}"
+ echo "CROSS_CC_GUEST_CFLAGS=$target_compiler_cflags" >> $config_target_mak
+
+ got_cross_cc=no
+ for i in $arch $arches; do
+ if eval test "x\${cross_cc_$i+yes}" != xyes; then
+ continue
+ fi
+
+ eval "target_compiler=\${cross_cc_$i}"
+ if ! has $target_compiler; then
+ continue
+ fi
+ write_c_skeleton
+ if ! do_compiler "$target_compiler" $target_compiler_cflags -o $TMPE $TMPC -static ; then
+ # For host systems we might get away with building without -static
+ if ! do_compiler "$target_compiler" $target_compiler_cflags -o $TMPE $TMPC ; then
+ continue
+ fi
+ echo "CROSS_CC_GUEST_STATIC=y" >> $config_target_mak
+ else
+ echo "CROSS_CC_GUEST_STATIC=y" >> $config_target_mak
+ fi
+ echo "CROSS_CC_GUEST=$target_compiler" >> $config_target_mak
+ enabled_cross_compilers="$enabled_cross_compilers $target_compiler"
+ got_cross_cc=yes
+ break
+ done
+
+ if test $got_cross_cc = no && test "$container" != no && test -n "$container_image"; then
+ echo "DOCKER_IMAGE=$container_image" >> $config_target_mak
+ echo "DOCKER_CROSS_CC_GUEST=$container_cross_cc" >> $config_target_mak
+ fi
+done
+
+# report container support state
+echo "cross containers $container"
+
+if test -n "$enabled_cross_compilers"; then
+ echo
+ echo "NOTE: guest cross-compilers enabled:$enabled_cross_compilers"
+fi
diff --git a/tests/tcg/cris/Makefile.include b/tests/tcg/cris/Makefile.include
deleted file mode 100644
index 1c037824bf..0000000000
--- a/tests/tcg/cris/Makefile.include
+++ /dev/null
@@ -1,6 +0,0 @@
-#
-# Makefile.include for all CRIS targets
-#
-
-DOCKER_IMAGE=fedora-cris-cross
-DOCKER_CROSS_COMPILER=cris-linux-gnu-gcc
diff --git a/tests/tcg/hppa/Makefile.include b/tests/tcg/hppa/Makefile.include
deleted file mode 100644
index da2353430e..0000000000
--- a/tests/tcg/hppa/Makefile.include
+++ /dev/null
@@ -1,2 +0,0 @@
-DOCKER_IMAGE=debian-hppa-cross
-DOCKER_CROSS_COMPILER=hppa-linux-gnu-gcc
diff --git a/tests/tcg/i386/Makefile.include b/tests/tcg/i386/Makefile.include
deleted file mode 100644
index be1c3008dd..0000000000
--- a/tests/tcg/i386/Makefile.include
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# Makefile.include for all i386
-#
-# There is enough brokeness in x86_64 compilers that we don't default
-# to using the x86_64 system compiler for i386 binaries.
-#
-
-DOCKER_IMAGE=fedora-i386-cross
-DOCKER_CROSS_COMPILER=gcc
diff --git a/tests/tcg/i386/Makefile.softmmu-target b/tests/tcg/i386/Makefile.softmmu-target
index 0a4364868c..1c8790eecd 100644
--- a/tests/tcg/i386/Makefile.softmmu-target
+++ b/tests/tcg/i386/Makefile.softmmu-target
@@ -12,17 +12,9 @@ X64_SYSTEM_SRC=$(SRC_PATH)/tests/tcg/x86_64/system
# These objects provide the basic boot code and helper functions for all tests
CRT_OBJS=boot.o
-ifeq ($(TARGET_X86_64), y)
-CRT_PATH=$(X64_SYSTEM_SRC)
-CFLAGS=-march=x86-64
-LINK_SCRIPT=$(X64_SYSTEM_SRC)/kernel.ld
-LDFLAGS=-Wl,-T$(LINK_SCRIPT) -Wl,-melf_x86_64
-else
CRT_PATH=$(I386_SYSTEM_SRC)
-CFLAGS+=-m32
LINK_SCRIPT=$(I386_SYSTEM_SRC)/kernel.ld
LDFLAGS=-Wl,-T$(LINK_SCRIPT) -Wl,-melf_i386
-endif
CFLAGS+=-nostdlib -ggdb -O0 $(MINILIB_INC)
LDFLAGS+=-static -nostdlib $(CRT_OBJS) $(MINILIB_OBJS) -lgcc
@@ -32,11 +24,11 @@ TESTS+=$(MULTIARCH_TESTS)
.PRECIOUS: $(CRT_OBJS)
%.o: $(CRT_PATH)/%.S
- $(CC) $(CFLAGS) -c $< -o $@
+ $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c $< -o $@
# Build and link the tests
%: %.c $(LINK_SCRIPT) $(CRT_OBJS) $(MINILIB_OBJS)
- $(CC) $(CFLAGS) $< -o $@ $(LDFLAGS)
+ $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
memory: CFLAGS+=-DCHECK_UNALIGNED=1
diff --git a/tests/tcg/i386/Makefile.target b/tests/tcg/i386/Makefile.target
index d0eb7023e5..08c5736a4d 100644
--- a/tests/tcg/i386/Makefile.target
+++ b/tests/tcg/i386/Makefile.target
@@ -6,14 +6,11 @@ I386_SRC=$(SRC_PATH)/tests/tcg/i386
VPATH += $(I386_SRC)
I386_SRCS=$(notdir $(wildcard $(I386_SRC)/*.c))
-I386_TESTS=$(I386_SRCS:.c=)
-I386_ONLY_TESTS=$(filter-out test-i386-ssse3, $(I386_TESTS))
+ALL_X86_TESTS=$(I386_SRCS:.c=)
+I386_TESTS:=$(filter-out test-i386-ssse3, $(ALL_X86_TESTS))
+X86_64_TESTS:=$(filter test-i386-ssse3, $(ALL_X86_TESTS))
# Update TESTS
-TESTS+=$(I386_ONLY_TESTS)
-
-ifneq ($(TARGET_NAME),x86_64)
-CFLAGS+=-m32
-endif
+TESTS=$(MULTIARCH_TESTS) $(I386_TESTS)
#
# hello-i386 is a barebones app
@@ -26,7 +23,7 @@ hello-i386: LDFLAGS+=-nostdlib
#
test-i386: test-i386.c test-i386-code16.S test-i386-vm86.S test-i386.h test-i386-shift.h test-i386-muldiv.h
- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ \
+ $(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_CFLAGS) -o $@ \
$(<D)/test-i386.c $(<D)/test-i386-code16.S $(<D)/test-i386-vm86.S -lm
ifeq ($(SPEED), slow)
diff --git a/tests/tcg/m68k/Makefile.include b/tests/tcg/m68k/Makefile.include
deleted file mode 100644
index cd7c6bf50d..0000000000
--- a/tests/tcg/m68k/Makefile.include
+++ /dev/null
@@ -1,2 +0,0 @@
-DOCKER_IMAGE=debian-m68k-cross
-DOCKER_CROSS_COMPILER=m68k-linux-gnu-gcc
diff --git a/tests/tcg/minilib/Makefile.target b/tests/tcg/minilib/Makefile.target
index 3ed8077d0f..c821d2806a 100644
--- a/tests/tcg/minilib/Makefile.target
+++ b/tests/tcg/minilib/Makefile.target
@@ -18,4 +18,4 @@ MINILIB_INC=-isystem $(SYSTEM_MINILIB_SRC)
.PRECIOUS: $(MINILIB_OBJS)
%.o: $(SYSTEM_MINILIB_SRC)/%.c
- $(CC) $(CFLAGS) -c $< -o $@
+ $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c $< -o $@
diff --git a/tests/tcg/mips/Makefile.include b/tests/tcg/mips/Makefile.include
deleted file mode 100644
index 4a14fc078d..0000000000
--- a/tests/tcg/mips/Makefile.include
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# Makefile.include for all MIPs targets
-#
-# As Debian doesn't support mip64 in big endian mode the only way to
-# build BE is to pass a working cross compiler to ./configure
-#
-
-ifeq ($(TARGET_NAME),mips64el)
-DOCKER_IMAGE=debian-mips64el-cross
-DOCKER_CROSS_COMPILER=mips64el-linux-gnuabi64-gcc
-else ifeq ($(TARGET_NAME),mips64)
-DOCKER_IMAGE=debian-mips64-cross
-DOCKER_CROSS_COMPILER=mips64-linux-gnuabi64-gcc
-else ifeq ($(TARGET_NAME),mipsel)
-DOCKER_IMAGE=debian-mipsel-cross
-DOCKER_CROSS_COMPILER=mipsel-linux-gnu-gcc
-else ifeq ($(TARGET_NAME),mips)
-DOCKER_IMAGE=debian-mips-cross
-DOCKER_CROSS_COMPILER=mips-linux-gnu-gcc
-endif
diff --git a/tests/tcg/multiarch/Makefile.target b/tests/tcg/multiarch/Makefile.target
index b77084c146..6b1e30e2fe 100644
--- a/tests/tcg/multiarch/Makefile.target
+++ b/tests/tcg/multiarch/Makefile.target
@@ -12,8 +12,13 @@ VPATH += $(MULTIARCH_SRC)
MULTIARCH_SRCS =$(notdir $(wildcard $(MULTIARCH_SRC)/*.c))
MULTIARCH_TESTS =$(MULTIARCH_SRCS:.c=)
+# FIXME: ppc64abi32 linux-test seems to have issues but the other basic tests work
+ifeq ($(TARGET_NAME),ppc64abi32)
+BROKEN_TESTS = linux-test
+endif
+
# Update TESTS
-TESTS +=$(MULTIARCH_TESTS)
+TESTS += $(filter-out $(BROKEN_TESTS), $(MULTIARCH_TESTS))
#
# The following are any additional rules needed to build things
diff --git a/tests/tcg/ppc/Makefile.include b/tests/tcg/ppc/Makefile.include
deleted file mode 100644
index ae01fb8fad..0000000000
--- a/tests/tcg/ppc/Makefile.include
+++ /dev/null
@@ -1,10 +0,0 @@
-ifeq ($(TARGET_NAME),ppc)
-DOCKER_IMAGE=debian-powerpc-cross
-DOCKER_CROSS_COMPILER=powerpc-linux-gnu-gcc
-else ifeq ($(TARGET_NAME),ppc64)
-DOCKER_IMAGE=debian-ppc64-cross
-DOCKER_CROSS_COMPILER=powerpc64-linux-gnu-gcc
-else ifeq ($(TARGET_NAME),ppc64le)
-DOCKER_IMAGE=debian-ppc64el-cross
-DOCKER_CROSS_COMPILER=powerpc64le-linux-gnu-gcc
-endif
diff --git a/tests/tcg/riscv/Makefile.include b/tests/tcg/riscv/Makefile.include
deleted file mode 100644
index d92ac6c89f..0000000000
--- a/tests/tcg/riscv/Makefile.include
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# Makefile.include for all RISCV targets
-#
-# Debian only really cares about 64 bit going forward
-#
-
-ifeq ($(TARGET_NAME),riscv64)
-DOCKER_IMAGE=debian-riscv64-cross
-DOCKER_CROSS_COMPILER=riscv64-linux-gnu-gcc
-endif
diff --git a/tests/tcg/s390x/Makefile.include b/tests/tcg/s390x/Makefile.include
deleted file mode 100644
index 1f58115d96..0000000000
--- a/tests/tcg/s390x/Makefile.include
+++ /dev/null
@@ -1,2 +0,0 @@
-DOCKER_IMAGE=debian-s390x-cross
-DOCKER_CROSS_COMPILER=s390x-linux-gnu-gcc
diff --git a/tests/tcg/sh4/Makefile.include b/tests/tcg/sh4/Makefile.include
deleted file mode 100644
index ad21594d9d..0000000000
--- a/tests/tcg/sh4/Makefile.include
+++ /dev/null
@@ -1,4 +0,0 @@
-ifneq ($(TARGET_NAME), sh4eb)
-DOCKER_IMAGE=debian-sh4-cross
-DOCKER_CROSS_COMPILER=sh4-linux-gnu-gcc
-endif
diff --git a/tests/tcg/sparc64/Makefile.include b/tests/tcg/sparc64/Makefile.include
deleted file mode 100644
index 95fc8dee9f..0000000000
--- a/tests/tcg/sparc64/Makefile.include
+++ /dev/null
@@ -1,2 +0,0 @@
-DOCKER_IMAGE=debian-sparc64-cross
-DOCKER_CROSS_COMPILER=sparc64-linux-gnu-gcc
diff --git a/tests/tcg/x86_64/Makefile.softmmu-target b/tests/tcg/x86_64/Makefile.softmmu-target
new file mode 100644
index 0000000000..df252e761c
--- /dev/null
+++ b/tests/tcg/x86_64/Makefile.softmmu-target
@@ -0,0 +1,36 @@
+#
+# x86 system tests
+#
+# This currently builds only for i386. The common C code is built
+# with standard compiler flags however so we can support both by
+# adding additional boot files for x86_64.
+#
+
+I386_SYSTEM_SRC=$(SRC_PATH)/tests/tcg/i386/system
+X64_SYSTEM_SRC=$(SRC_PATH)/tests/tcg/x86_64/system
+
+# These objects provide the basic boot code and helper functions for all tests
+CRT_OBJS=boot.o
+
+CRT_PATH=$(X64_SYSTEM_SRC)
+LINK_SCRIPT=$(X64_SYSTEM_SRC)/kernel.ld
+LDFLAGS=-Wl,-T$(LINK_SCRIPT) -Wl,-melf_x86_64
+CFLAGS+=-nostdlib -ggdb -O0 $(MINILIB_INC)
+LDFLAGS+=-static -nostdlib $(CRT_OBJS) $(MINILIB_OBJS) -lgcc
+
+TESTS+=$(MULTIARCH_TESTS)
+
+# building head blobs
+.PRECIOUS: $(CRT_OBJS)
+
+%.o: $(CRT_PATH)/%.S
+ $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c $< -o $@
+
+# Build and link the tests
+%: %.c $(LINK_SCRIPT) $(CRT_OBJS) $(MINILIB_OBJS)
+ $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
+
+memory: CFLAGS+=-DCHECK_UNALIGNED=1
+
+# Running
+QEMU_OPTS+=-device isa-debugcon,chardev=output -device isa-debug-exit,iobase=0xf4,iosize=0x4 -kernel
diff --git a/tests/tcg/x86_64/Makefile.target b/tests/tcg/x86_64/Makefile.target
index 74f170b9ed..20bf96202a 100644
--- a/tests/tcg/x86_64/Makefile.target
+++ b/tests/tcg/x86_64/Makefile.target
@@ -6,9 +6,10 @@
# $(SRC)/tests/tcg/i386/
#
-X86_64_TESTS=$(filter-out $(I386_ONLY_TESTS), $(TESTS))
-X86_64_TESTS+=test-x86_64
-TESTS:=$(X86_64_TESTS)
+include $(SRC_PATH)/tests/tcg/i386/Makefile.target
+
+TESTS=$(MULTIARCH_TESTS) $(X86_64_TESTS) test-x86_64
+QEMU_OPTS += -cpu max
test-x86_64: LDFLAGS+=-lm -lc
test-x86_64: test-i386.c test-i386.h test-i386-shift.h test-i386-muldiv.h
diff --git a/tests/tcg/xtensa/Makefile.include b/tests/tcg/xtensa/Makefile.include
deleted file mode 100644
index 423c00a5d3..0000000000
--- a/tests/tcg/xtensa/Makefile.include
+++ /dev/null
@@ -1,11 +0,0 @@
-# Makefile.include for xtensa targets
-#
-# The compilers can only be used for building system tests
-
-ifeq ($(CONFIG_SOFTMMU),y)
-DOCKER_IMAGE=debian-xtensa-cross
-
-# default to the dc232b cpu
-DOCKER_CROSS_COMPILER=/opt/2018.02/xtensa-dc232b-elf/bin/xtensa-dc232b-elf-gcc
-DOCKER_CROSS_LINKER=/opt/2018.02/xtensa-dc232b-elf/bin/xtensa-dc232b-elf-ld
-endif
diff --git a/tests/tcg/xtensa/Makefile.softmmu-target b/tests/tcg/xtensa/Makefile.softmmu-target
index 8212d96b81..9530cac2ad 100644
--- a/tests/tcg/xtensa/Makefile.softmmu-target
+++ b/tests/tcg/xtensa/Makefile.softmmu-target
@@ -34,9 +34,9 @@ $(XTENSA_USABLE_TESTS): linker.ld macros.inc $(CRT) Makefile.softmmu-target
# special rule for common blobs
%.o: %.S
- $(CC) $(XTENSA_INC) $($*_ASFLAGS) $(ASFLAGS) -c $< -o $@
+ $(CC) $(XTENSA_INC) $($*_ASFLAGS) $(ASFLAGS) $(EXTRA_CFLAGS) -c $< -o $@
%: %.S
- $(CC) $(XTENSA_INC) $(ASFLAGS) $< -o $@ $(LDFLAGS) $(NOSTDFLAGS) $(CRT)
+ $(CC) $(XTENSA_INC) $(ASFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS) $(NOSTDFLAGS) $(CRT)
endif
diff --git a/tests/test-bdrv-drain.c b/tests/test-bdrv-drain.c
index 374bef6bb2..fa0e6a648b 100644
--- a/tests/test-bdrv-drain.c
+++ b/tests/test-bdrv-drain.c
@@ -848,7 +848,6 @@ BlockJobDriver test_job_driver = {
.instance_size = sizeof(TestBlockJob),
.free = block_job_free,
.user_resume = block_job_user_resume,
- .drain = block_job_drain,
.run = test_job_run,
.complete = test_job_complete,
.prepare = test_job_prepare,
@@ -1574,7 +1573,6 @@ static const BlockJobDriver test_drop_backing_job_driver = {
.instance_size = sizeof(TestDropBackingBlockJob),
.free = block_job_free,
.user_resume = block_job_user_resume,
- .drain = block_job_drain,
.run = test_drop_backing_job_run,
.commit = test_drop_backing_job_commit,
}
@@ -1711,7 +1709,6 @@ static const BlockJobDriver test_simple_job_driver = {
.instance_size = sizeof(TestSimpleBlockJob),
.free = block_job_free,
.user_resume = block_job_user_resume,
- .drain = block_job_drain,
.run = test_simple_job_run,
.clean = test_simple_job_clean,
},
diff --git a/tests/test-block-iothread.c b/tests/test-block-iothread.c
index 926577b1f9..cfe30bab21 100644
--- a/tests/test-block-iothread.c
+++ b/tests/test-block-iothread.c
@@ -401,7 +401,6 @@ BlockJobDriver test_job_driver = {
.instance_size = sizeof(TestBlockJob),
.free = block_job_free,
.user_resume = block_job_user_resume,
- .drain = block_job_drain,
.run = test_job_run,
.complete = test_job_complete,
.prepare = test_job_prepare,
diff --git a/tests/test-blockjob-txn.c b/tests/test-blockjob-txn.c
index 7da9216d5b..8bd13b9949 100644
--- a/tests/test-blockjob-txn.c
+++ b/tests/test-blockjob-txn.c
@@ -72,7 +72,6 @@ static const BlockJobDriver test_block_job_driver = {
.instance_size = sizeof(TestBlockJob),
.free = block_job_free,
.user_resume = block_job_user_resume,
- .drain = block_job_drain,
.run = test_block_job_run,
.clean = test_block_job_clean,
},
diff --git a/tests/test-blockjob.c b/tests/test-blockjob.c
index 68a0819495..7844c9ffcb 100644
--- a/tests/test-blockjob.c
+++ b/tests/test-blockjob.c
@@ -22,7 +22,6 @@ static const BlockJobDriver test_block_job_driver = {
.instance_size = sizeof(BlockJob),
.free = block_job_free,
.user_resume = block_job_user_resume,
- .drain = block_job_drain,
},
};
@@ -196,7 +195,6 @@ static const BlockJobDriver test_cancel_driver = {
.instance_size = sizeof(CancelJob),
.free = block_job_free,
.user_resume = block_job_user_resume,
- .drain = block_job_drain,
.run = cancel_job_run,
.complete = cancel_job_complete,
},
diff --git a/tests/test-util-filemonitor.c b/tests/test-util-filemonitor.c
index 46e781c022..301cd2db61 100644
--- a/tests/test-util-filemonitor.c
+++ b/tests/test-util-filemonitor.c
@@ -45,6 +45,11 @@ typedef struct {
const char *filedst;
int64_t *watchid;
int eventid;
+ /*
+ * Only valid with OP_EVENT - this event might be
+ * swapped with the next OP_EVENT
+ */
+ bool swapnext;
} QFileMonitorTestOp;
typedef struct {
@@ -98,6 +103,10 @@ qemu_file_monitor_test_handler(int64_t id,
QFileMonitorTestData *data = opaque;
QFileMonitorTestRecord *rec = g_new0(QFileMonitorTestRecord, 1);
+ if (debug) {
+ g_printerr("Queue event id %" PRIx64 " event %d file %s\n",
+ id, event, filename);
+ }
rec->id = id;
rec->event = event;
rec->filename = g_strdup(filename);
@@ -125,7 +134,8 @@ qemu_file_monitor_test_record_free(QFileMonitorTestRecord *rec)
* to wait for the event to be queued for us.
*/
static QFileMonitorTestRecord *
-qemu_file_monitor_test_next_record(QFileMonitorTestData *data)
+qemu_file_monitor_test_next_record(QFileMonitorTestData *data,
+ QFileMonitorTestRecord *pushback)
{
GTimer *timer = g_timer_new();
QFileMonitorTestRecord *record = NULL;
@@ -139,9 +149,15 @@ qemu_file_monitor_test_next_record(QFileMonitorTestData *data)
}
if (data->records) {
record = data->records->data;
- tmp = data->records;
- data->records = g_list_remove_link(data->records, tmp);
- g_list_free(tmp);
+ if (pushback) {
+ data->records->data = pushback;
+ } else {
+ tmp = data->records;
+ data->records = g_list_remove_link(data->records, tmp);
+ g_list_free(tmp);
+ }
+ } else if (pushback) {
+ qemu_file_monitor_test_record_free(pushback);
}
qemu_mutex_unlock(&data->lock);
@@ -158,13 +174,15 @@ static bool
qemu_file_monitor_test_expect(QFileMonitorTestData *data,
int64_t id,
QFileMonitorEvent event,
- const char *filename)
+ const char *filename,
+ bool swapnext)
{
QFileMonitorTestRecord *rec;
bool ret = false;
- rec = qemu_file_monitor_test_next_record(data);
+ rec = qemu_file_monitor_test_next_record(data, NULL);
+ retry:
if (!rec) {
g_printerr("Missing event watch id %" PRIx64 " event %d file %s\n",
id, event, filename);
@@ -172,6 +190,11 @@ qemu_file_monitor_test_expect(QFileMonitorTestData *data,
}
if (id != rec->id) {
+ if (swapnext) {
+ rec = qemu_file_monitor_test_next_record(data, rec);
+ swapnext = false;
+ goto retry;
+ }
g_printerr("Expected watch id %" PRIx64 " but got %" PRIx64 "\n",
id, rec->id);
goto cleanup;
@@ -347,7 +370,8 @@ test_file_monitor_events(void)
.filesrc = "fish", },
{ .type = QFILE_MONITOR_TEST_OP_EVENT,
.filesrc = "", .watchid = &watch4,
- .eventid = QFILE_MONITOR_EVENT_IGNORED },
+ .eventid = QFILE_MONITOR_EVENT_IGNORED,
+ .swapnext = true },
{ .type = QFILE_MONITOR_TEST_OP_EVENT,
.filesrc = "fish", .watchid = &watch0,
.eventid = QFILE_MONITOR_EVENT_DELETED },
@@ -493,8 +517,9 @@ test_file_monitor_events(void)
g_printerr("Event id=%" PRIx64 " event=%d file=%s\n",
*op->watchid, op->eventid, op->filesrc);
}
- if (!qemu_file_monitor_test_expect(
- &data, *op->watchid, op->eventid, op->filesrc))
+ if (!qemu_file_monitor_test_expect(&data, *op->watchid,
+ op->eventid, op->filesrc,
+ op->swapnext))
goto cleanup;
break;
case QFILE_MONITOR_TEST_OP_CREATE:
diff --git a/tests/vm/fedora b/tests/vm/fedora
index e8fa5bf0d2..7fec1479fb 100755
--- a/tests/vm/fedora
+++ b/tests/vm/fedora
@@ -23,7 +23,7 @@ class FedoraVM(basevm.BaseVM):
name = "fedora"
arch = "x86_64"
- base = "http://dl.fedoraproject.org/pub/fedora/linux/releases/30/"
+ base = "https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/30/"
link = base + "Server/x86_64/iso/Fedora-Server-netinst-x86_64-30-1.2.iso"
repo = base + "Server/x86_64/os/"
full = base + "Everything/x86_64/os/"