summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.include8
-rw-r--r--tests/acceptance/boot_linux_console.py120
-rw-r--r--tests/acceptance/replay_kernel.py10
-rw-r--r--tests/bench/atomic64-bench.c (renamed from tests/atomic64-bench.c)0
-rw-r--r--tests/bench/atomic_add-bench.c (renamed from tests/atomic_add-bench.c)0
-rw-r--r--tests/bench/benchmark-crypto-cipher.c (renamed from tests/benchmark-crypto-cipher.c)0
-rw-r--r--tests/bench/benchmark-crypto-hash.c (renamed from tests/benchmark-crypto-hash.c)0
-rw-r--r--tests/bench/benchmark-crypto-hmac.c (renamed from tests/benchmark-crypto-hmac.c)0
-rw-r--r--tests/bench/meson.build34
-rw-r--r--tests/bench/qht-bench.c (renamed from tests/qht-bench.c)0
-rw-r--r--tests/meson.build216
-rw-r--r--tests/qtest/npcm7xx_pwm-test.c205
-rw-r--r--tests/unit/check-block-qdict.c (renamed from tests/check-block-qdict.c)0
-rw-r--r--tests/unit/check-qdict.c (renamed from tests/check-qdict.c)0
-rw-r--r--tests/unit/check-qjson.c (renamed from tests/check-qjson.c)0
-rw-r--r--tests/unit/check-qlist.c (renamed from tests/check-qlist.c)0
-rw-r--r--tests/unit/check-qlit.c (renamed from tests/check-qlit.c)0
-rw-r--r--tests/unit/check-qnull.c (renamed from tests/check-qnull.c)0
-rw-r--r--tests/unit/check-qnum.c (renamed from tests/check-qnum.c)0
-rw-r--r--tests/unit/check-qobject.c (renamed from tests/check-qobject.c)0
-rw-r--r--tests/unit/check-qom-interface.c (renamed from tests/check-qom-interface.c)0
-rw-r--r--tests/unit/check-qom-proplist.c (renamed from tests/check-qom-proplist.c)0
-rw-r--r--tests/unit/check-qstring.c (renamed from tests/check-qstring.c)0
-rw-r--r--tests/unit/crypto-tls-psk-helpers.c (renamed from tests/crypto-tls-psk-helpers.c)0
-rw-r--r--tests/unit/crypto-tls-psk-helpers.h (renamed from tests/crypto-tls-psk-helpers.h)0
-rw-r--r--tests/unit/crypto-tls-x509-helpers.c (renamed from tests/crypto-tls-x509-helpers.c)0
-rw-r--r--tests/unit/crypto-tls-x509-helpers.h (renamed from tests/crypto-tls-x509-helpers.h)0
-rw-r--r--tests/unit/io-channel-helpers.c (renamed from tests/io-channel-helpers.c)0
-rw-r--r--tests/unit/io-channel-helpers.h (renamed from tests/io-channel-helpers.h)0
-rw-r--r--tests/unit/iothread.c (renamed from tests/iothread.c)0
-rw-r--r--tests/unit/iothread.h (renamed from tests/iothread.h)0
-rw-r--r--tests/unit/meson.build184
-rw-r--r--tests/unit/pkix_asn1_tab.c (renamed from tests/pkix_asn1_tab.c)2
-rw-r--r--tests/unit/ptimer-test-stubs.c (renamed from tests/ptimer-test-stubs.c)0
-rw-r--r--tests/unit/ptimer-test.c (renamed from tests/ptimer-test.c)0
-rw-r--r--tests/unit/ptimer-test.h (renamed from tests/ptimer-test.h)0
-rw-r--r--tests/unit/rcutorture.c (renamed from tests/rcutorture.c)0
-rw-r--r--tests/unit/socket-helpers.c (renamed from tests/socket-helpers.c)0
-rw-r--r--tests/unit/socket-helpers.h (renamed from tests/socket-helpers.h)0
-rw-r--r--tests/unit/test-aio-multithread.c (renamed from tests/test-aio-multithread.c)0
-rw-r--r--tests/unit/test-aio.c (renamed from tests/test-aio.c)0
-rw-r--r--tests/unit/test-authz-list.c (renamed from tests/test-authz-list.c)0
-rw-r--r--tests/unit/test-authz-listfile.c (renamed from tests/test-authz-listfile.c)0
-rw-r--r--tests/unit/test-authz-pam.c (renamed from tests/test-authz-pam.c)0
-rw-r--r--tests/unit/test-authz-simple.c (renamed from tests/test-authz-simple.c)0
-rw-r--r--tests/unit/test-base64.c (renamed from tests/test-base64.c)0
-rw-r--r--tests/unit/test-bdrv-drain.c (renamed from tests/test-bdrv-drain.c)0
-rw-r--r--tests/unit/test-bdrv-graph-mod.c (renamed from tests/test-bdrv-graph-mod.c)0
-rw-r--r--tests/unit/test-bitcnt.c (renamed from tests/test-bitcnt.c)0
-rw-r--r--tests/unit/test-bitmap.c (renamed from tests/test-bitmap.c)0
-rw-r--r--tests/unit/test-bitops.c (renamed from tests/test-bitops.c)0
-rw-r--r--tests/unit/test-block-backend.c (renamed from tests/test-block-backend.c)0
-rw-r--r--tests/unit/test-block-iothread.c (renamed from tests/test-block-iothread.c)0
-rw-r--r--tests/unit/test-blockjob-txn.c (renamed from tests/test-blockjob-txn.c)0
-rw-r--r--tests/unit/test-blockjob.c (renamed from tests/test-blockjob.c)0
-rw-r--r--tests/unit/test-bufferiszero.c (renamed from tests/test-bufferiszero.c)0
-rw-r--r--tests/unit/test-char.c (renamed from tests/test-char.c)0
-rw-r--r--tests/unit/test-clone-visitor.c (renamed from tests/test-clone-visitor.c)0
-rw-r--r--tests/unit/test-coroutine.c (renamed from tests/test-coroutine.c)0
-rw-r--r--tests/unit/test-crypto-afsplit.c (renamed from tests/test-crypto-afsplit.c)0
-rw-r--r--tests/unit/test-crypto-block.c (renamed from tests/test-crypto-block.c)0
-rw-r--r--tests/unit/test-crypto-cipher.c (renamed from tests/test-crypto-cipher.c)0
-rw-r--r--tests/unit/test-crypto-hash.c (renamed from tests/test-crypto-hash.c)0
-rw-r--r--tests/unit/test-crypto-hmac.c (renamed from tests/test-crypto-hmac.c)0
-rw-r--r--tests/unit/test-crypto-ivgen.c (renamed from tests/test-crypto-ivgen.c)0
-rw-r--r--tests/unit/test-crypto-pbkdf.c (renamed from tests/test-crypto-pbkdf.c)0
-rw-r--r--tests/unit/test-crypto-secret.c (renamed from tests/test-crypto-secret.c)0
-rw-r--r--tests/unit/test-crypto-tlscredsx509.c (renamed from tests/test-crypto-tlscredsx509.c)0
-rw-r--r--tests/unit/test-crypto-tlssession.c (renamed from tests/test-crypto-tlssession.c)0
-rw-r--r--tests/unit/test-crypto-xts.c (renamed from tests/test-crypto-xts.c)0
-rw-r--r--tests/unit/test-cutils.c (renamed from tests/test-cutils.c)0
-rw-r--r--tests/unit/test-fdmon-epoll.c (renamed from tests/test-fdmon-epoll.c)0
-rw-r--r--tests/unit/test-hbitmap.c (renamed from tests/test-hbitmap.c)0
-rw-r--r--tests/unit/test-image-locking.c (renamed from tests/test-image-locking.c)0
-rw-r--r--tests/unit/test-int128.c (renamed from tests/test-int128.c)0
-rw-r--r--tests/unit/test-io-channel-buffer.c (renamed from tests/test-io-channel-buffer.c)0
-rw-r--r--tests/unit/test-io-channel-command.c (renamed from tests/test-io-channel-command.c)0
-rw-r--r--tests/unit/test-io-channel-file.c (renamed from tests/test-io-channel-file.c)0
-rw-r--r--tests/unit/test-io-channel-socket.c (renamed from tests/test-io-channel-socket.c)0
-rw-r--r--tests/unit/test-io-channel-tls.c (renamed from tests/test-io-channel-tls.c)0
-rw-r--r--tests/unit/test-io-task.c (renamed from tests/test-io-task.c)0
-rw-r--r--tests/unit/test-iov.c (renamed from tests/test-iov.c)0
-rw-r--r--tests/unit/test-keyval.c (renamed from tests/test-keyval.c)0
-rw-r--r--tests/unit/test-logging.c (renamed from tests/test-logging.c)0
-rw-r--r--tests/unit/test-mul64.c (renamed from tests/test-mul64.c)0
-rw-r--r--tests/unit/test-opts-visitor.c (renamed from tests/test-opts-visitor.c)0
-rw-r--r--tests/unit/test-qapi-util.c (renamed from tests/test-qapi-util.c)0
-rw-r--r--tests/unit/test-qdev-global-props.c (renamed from tests/test-qdev-global-props.c)0
-rw-r--r--tests/unit/test-qdist.c (renamed from tests/test-qdist.c)0
-rw-r--r--tests/unit/test-qemu-opts.c (renamed from tests/test-qemu-opts.c)0
-rw-r--r--tests/unit/test-qga.c (renamed from tests/test-qga.c)2
-rw-r--r--tests/unit/test-qgraph.c (renamed from tests/test-qgraph.c)4
-rw-r--r--tests/unit/test-qht.c (renamed from tests/test-qht.c)0
-rw-r--r--tests/unit/test-qmp-cmds.c (renamed from tests/test-qmp-cmds.c)0
-rw-r--r--tests/unit/test-qmp-event.c (renamed from tests/test-qmp-event.c)0
-rw-r--r--tests/unit/test-qobject-input-visitor.c (renamed from tests/test-qobject-input-visitor.c)0
-rw-r--r--tests/unit/test-qobject-output-visitor.c (renamed from tests/test-qobject-output-visitor.c)0
-rw-r--r--tests/unit/test-rcu-list.c (renamed from tests/test-rcu-list.c)0
-rw-r--r--tests/unit/test-rcu-simpleq.c (renamed from tests/test-rcu-simpleq.c)0
-rw-r--r--tests/unit/test-rcu-slist.c (renamed from tests/test-rcu-slist.c)0
-rw-r--r--tests/unit/test-rcu-tailq.c (renamed from tests/test-rcu-tailq.c)0
-rw-r--r--tests/unit/test-replication.c (renamed from tests/test-replication.c)0
-rw-r--r--tests/unit/test-shift128.c (renamed from tests/test-shift128.c)0
-rw-r--r--tests/unit/test-string-input-visitor.c (renamed from tests/test-string-input-visitor.c)0
-rw-r--r--tests/unit/test-string-output-visitor.c (renamed from tests/test-string-output-visitor.c)0
-rw-r--r--tests/unit/test-thread-pool.c (renamed from tests/test-thread-pool.c)0
-rw-r--r--tests/unit/test-throttle.c (renamed from tests/test-throttle.c)0
-rw-r--r--tests/unit/test-timed-average.c (renamed from tests/test-timed-average.c)0
-rw-r--r--tests/unit/test-util-filemonitor.c (renamed from tests/test-util-filemonitor.c)0
-rw-r--r--tests/unit/test-util-sockets.c (renamed from tests/test-util-sockets.c)0
-rw-r--r--tests/unit/test-uuid.c (renamed from tests/test-uuid.c)0
-rw-r--r--tests/unit/test-visitor-serialization.c (renamed from tests/test-visitor-serialization.c)0
-rw-r--r--tests/unit/test-vmstate.c (renamed from tests/test-vmstate.c)0
-rw-r--r--tests/unit/test-write-threshold.c (renamed from tests/test-write-threshold.c)0
-rw-r--r--tests/unit/test-x86-cpuid.c (renamed from tests/test-x86-cpuid.c)0
-rw-r--r--tests/unit/test-xbzrle.c (renamed from tests/test-xbzrle.c)0
116 files changed, 470 insertions, 315 deletions
diff --git a/tests/Makefile.include b/tests/Makefile.include
index 799e47169c..8f220e15d1 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -3,13 +3,13 @@
 .PHONY: check-help
 check-help:
 	@echo "Regression testing targets:"
-	@echo
 	@echo " $(MAKE) check                Run block, qapi-schema, unit, softfloat, qtest and decodetree tests"
+	@echo " $(MAKE) bench                Run speed tests"
 	@echo
+	@echo "Individual test suites:"
 	@echo " $(MAKE) check-qtest-TARGET   Run qtest tests for given target"
 	@echo " $(MAKE) check-qtest          Run qtest tests"
 	@echo " $(MAKE) check-unit           Run qobject tests"
-	@echo " $(MAKE) check-speed          Run qobject speed tests"
 	@echo " $(MAKE) check-qapi-schema    Run QAPI schema tests"
 	@echo " $(MAKE) check-block          Run block tests"
 ifneq ($(filter $(all-check-targets), check-softfloat),)
@@ -155,8 +155,4 @@ check-clean:
 
 clean: check-clean
 
-# For backwards compatibility
-
-check-speed: bench-speed
-
 endif
diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py
index eb01286799..1ca32ecf25 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -507,20 +507,18 @@ class BootLinuxConsole(LinuxKernelTest):
         self.wait_for_console_pattern('Boot successful.')
         # TODO user command, for now the uart is stuck
 
-    @skipUnless(os.getenv('ARMBIAN_ARTIFACTS_CACHED'),
-                'Test artifacts fetched from unreliable apt.armbian.com')
     def test_arm_cubieboard_initrd(self):
         """
         :avocado: tags=arch:arm
         :avocado: tags=machine:cubieboard
         """
         deb_url = ('https://apt.armbian.com/pool/main/l/'
-                   'linux-4.20.7-sunxi/linux-image-dev-sunxi_5.75_armhf.deb')
-        deb_hash = '1334c29c44d984ffa05ed10de8c3361f33d78315'
+                   'linux-5.10.16-sunxi/linux-image-current-sunxi_21.02.2_armhf.deb')
+        deb_hash = '9fa84beda245cabf0b4fa84cf6eaa7738ead1da0'
         deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
         kernel_path = self.extract_from_deb(deb_path,
-                                            '/boot/vmlinuz-4.20.7-sunxi')
-        dtb_path = '/usr/lib/linux-image-dev-sunxi/sun4i-a10-cubieboard.dtb'
+                                            '/boot/vmlinuz-5.10.16-sunxi')
+        dtb_path = '/usr/lib/linux-image-current-sunxi/sun4i-a10-cubieboard.dtb'
         dtb_path = self.extract_from_deb(deb_path, dtb_path)
         initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
                       '2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/'
@@ -549,20 +547,18 @@ class BootLinuxConsole(LinuxKernelTest):
                                                 'system-control@1c00000')
         # cubieboard's reboot is not functioning; omit reboot test.
 
-    @skipUnless(os.getenv('ARMBIAN_ARTIFACTS_CACHED'),
-                'Test artifacts fetched from unreliable apt.armbian.com')
     def test_arm_cubieboard_sata(self):
         """
         :avocado: tags=arch:arm
         :avocado: tags=machine:cubieboard
         """
         deb_url = ('https://apt.armbian.com/pool/main/l/'
-                   'linux-4.20.7-sunxi/linux-image-dev-sunxi_5.75_armhf.deb')
-        deb_hash = '1334c29c44d984ffa05ed10de8c3361f33d78315'
+                   'linux-5.10.16-sunxi/linux-image-current-sunxi_21.02.2_armhf.deb')
+        deb_hash = '9fa84beda245cabf0b4fa84cf6eaa7738ead1da0'
         deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
         kernel_path = self.extract_from_deb(deb_path,
-                                            '/boot/vmlinuz-4.20.7-sunxi')
-        dtb_path = '/usr/lib/linux-image-dev-sunxi/sun4i-a10-cubieboard.dtb'
+                                            '/boot/vmlinuz-5.10.16-sunxi')
+        dtb_path = '/usr/lib/linux-image-current-sunxi/sun4i-a10-cubieboard.dtb'
         dtb_path = self.extract_from_deb(deb_path, dtb_path)
         rootfs_url = ('https://github.com/groeck/linux-build-test/raw/'
                       '2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/'
@@ -678,20 +674,18 @@ class BootLinuxConsole(LinuxKernelTest):
         self.wait_for_console_pattern(
                 'Give root password for system maintenance')
 
-    @skipUnless(os.getenv('ARMBIAN_ARTIFACTS_CACHED'),
-                'Test artifacts fetched from unreliable apt.armbian.com')
     def test_arm_orangepi(self):
         """
         :avocado: tags=arch:arm
         :avocado: tags=machine:orangepi-pc
         """
         deb_url = ('https://apt.armbian.com/pool/main/l/'
-                   'linux-4.20.7-sunxi/linux-image-dev-sunxi_5.75_armhf.deb')
-        deb_hash = '1334c29c44d984ffa05ed10de8c3361f33d78315'
+                   'linux-5.10.16-sunxi/linux-image-current-sunxi_21.02.2_armhf.deb')
+        deb_hash = '9fa84beda245cabf0b4fa84cf6eaa7738ead1da0'
         deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
         kernel_path = self.extract_from_deb(deb_path,
-                                            '/boot/vmlinuz-4.20.7-sunxi')
-        dtb_path = '/usr/lib/linux-image-dev-sunxi/sun8i-h3-orangepi-pc.dtb'
+                                            '/boot/vmlinuz-5.10.16-sunxi')
+        dtb_path = '/usr/lib/linux-image-current-sunxi/sun8i-h3-orangepi-pc.dtb'
         dtb_path = self.extract_from_deb(deb_path, dtb_path)
 
         self.vm.set_console()
@@ -705,20 +699,18 @@ class BootLinuxConsole(LinuxKernelTest):
         console_pattern = 'Kernel command line: %s' % kernel_command_line
         self.wait_for_console_pattern(console_pattern)
 
-    @skipUnless(os.getenv('ARMBIAN_ARTIFACTS_CACHED'),
-                'Test artifacts fetched from unreliable apt.armbian.com')
     def test_arm_orangepi_initrd(self):
         """
         :avocado: tags=arch:arm
         :avocado: tags=machine:orangepi-pc
         """
         deb_url = ('https://apt.armbian.com/pool/main/l/'
-                   'linux-4.20.7-sunxi/linux-image-dev-sunxi_5.75_armhf.deb')
-        deb_hash = '1334c29c44d984ffa05ed10de8c3361f33d78315'
+                   'linux-5.10.16-sunxi/linux-image-current-sunxi_21.02.2_armhf.deb')
+        deb_hash = '9fa84beda245cabf0b4fa84cf6eaa7738ead1da0'
         deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
         kernel_path = self.extract_from_deb(deb_path,
-                                            '/boot/vmlinuz-4.20.7-sunxi')
-        dtb_path = '/usr/lib/linux-image-dev-sunxi/sun8i-h3-orangepi-pc.dtb'
+                                            '/boot/vmlinuz-5.10.16-sunxi')
+        dtb_path = '/usr/lib/linux-image-current-sunxi/sun8i-h3-orangepi-pc.dtb'
         dtb_path = self.extract_from_deb(deb_path, dtb_path)
         initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
                       '2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/'
@@ -749,8 +741,6 @@ class BootLinuxConsole(LinuxKernelTest):
         # Wait for VM to shut down gracefully
         self.vm.wait()
 
-    @skipUnless(os.getenv('ARMBIAN_ARTIFACTS_CACHED'),
-                'Test artifacts fetched from unreliable apt.armbian.com')
     def test_arm_orangepi_sd(self):
         """
         :avocado: tags=arch:arm
@@ -758,12 +748,12 @@ class BootLinuxConsole(LinuxKernelTest):
         :avocado: tags=device:sd
         """
         deb_url = ('https://apt.armbian.com/pool/main/l/'
-                   'linux-4.20.7-sunxi/linux-image-dev-sunxi_5.75_armhf.deb')
-        deb_hash = '1334c29c44d984ffa05ed10de8c3361f33d78315'
+                   'linux-5.10.16-sunxi/linux-image-current-sunxi_21.02.2_armhf.deb')
+        deb_hash = '9fa84beda245cabf0b4fa84cf6eaa7738ead1da0'
         deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
         kernel_path = self.extract_from_deb(deb_path,
-                                            '/boot/vmlinuz-4.20.7-sunxi')
-        dtb_path = '/usr/lib/linux-image-dev-sunxi/sun8i-h3-orangepi-pc.dtb'
+                                            '/boot/vmlinuz-5.10.16-sunxi')
+        dtb_path = '/usr/lib/linux-image-current-sunxi/sun8i-h3-orangepi-pc.dtb'
         dtb_path = self.extract_from_deb(deb_path, dtb_path)
         rootfs_url = ('http://storage.kernelci.org/images/rootfs/buildroot/'
                       'kci-2019.02/armel/base/rootfs.ext2.xz')
@@ -802,7 +792,27 @@ class BootLinuxConsole(LinuxKernelTest):
         # Wait for VM to shut down gracefully
         self.vm.wait()
 
-    def do_test_arm_orangepi_uboot_armbian(self, image_path):
+    @skipUnless(os.getenv('AVOCADO_ALLOW_LARGE_STORAGE'), 'storage limited')
+    def test_arm_orangepi_bionic_20_08(self):
+        """
+        :avocado: tags=arch:arm
+        :avocado: tags=machine:orangepi-pc
+        :avocado: tags=device:sd
+        """
+
+        # This test download a 275 MiB compressed image and expand it
+        # to 1036 MiB, but the underlying filesystem is 1552 MiB...
+        # As we expand it to 2 GiB we are safe.
+
+        image_url = ('https://archive.armbian.com/orangepipc/archive/'
+                     'Armbian_20.08.1_Orangepipc_bionic_current_5.8.5.img.xz')
+        image_hash = ('b4d6775f5673486329e45a0586bf06b6'
+                      'dbe792199fd182ac6b9c7bb6c7d3e6dd')
+        image_path_xz = self.fetch_asset(image_url, asset_hash=image_hash,
+                                         algorithm='sha256')
+        image_path = archive.extract(image_path_xz, self.workdir)
+        image_pow2ceil_expand(image_path)
+
         self.vm.set_console()
         self.vm.add_args('-drive', 'file=' + image_path + ',if=sd,format=raw',
                          '-nic', 'user',
@@ -828,54 +838,6 @@ class BootLinuxConsole(LinuxKernelTest):
                                       'to <orangepipc>')
         self.wait_for_console_pattern('Starting Load Kernel Modules...')
 
-    @skipUnless(os.getenv('ARMBIAN_ARTIFACTS_CACHED'),
-                'Test artifacts fetched from unreliable apt.armbian.com')
-    @skipUnless(os.getenv('AVOCADO_ALLOW_LARGE_STORAGE'), 'storage limited')
-    @skipUnless(P7ZIP_AVAILABLE, '7z not installed')
-    def test_arm_orangepi_bionic_19_11(self):
-        """
-        :avocado: tags=arch:arm
-        :avocado: tags=machine:orangepi-pc
-        :avocado: tags=device:sd
-        """
-
-        # This test download a 196MB compressed image and expand it to 1GB
-        image_url = ('https://dl.armbian.com/orangepipc/archive/'
-                     'Armbian_19.11.3_Orangepipc_bionic_current_5.3.9.7z')
-        image_hash = '196a8ffb72b0123d92cea4a070894813d305c71e'
-        image_path_7z = self.fetch_asset(image_url, asset_hash=image_hash)
-        image_name = 'Armbian_19.11.3_Orangepipc_bionic_current_5.3.9.img'
-        image_path = os.path.join(self.workdir, image_name)
-        process.run("7z e -o%s %s" % (self.workdir, image_path_7z))
-        image_pow2ceil_expand(image_path)
-
-        self.do_test_arm_orangepi_uboot_armbian(image_path)
-
-    @skipUnless(os.getenv('ARMBIAN_ARTIFACTS_CACHED'),
-                'Test artifacts fetched from unreliable apt.armbian.com')
-    @skipUnless(os.getenv('AVOCADO_ALLOW_LARGE_STORAGE'), 'storage limited')
-    def test_arm_orangepi_bionic_20_08(self):
-        """
-        :avocado: tags=arch:arm
-        :avocado: tags=machine:orangepi-pc
-        :avocado: tags=device:sd
-        """
-
-        # This test download a 275 MiB compressed image and expand it
-        # to 1036 MiB, but the underlying filesystem is 1552 MiB...
-        # As we expand it to 2 GiB we are safe.
-
-        image_url = ('https://dl.armbian.com/orangepipc/archive/'
-                     'Armbian_20.08.1_Orangepipc_bionic_current_5.8.5.img.xz')
-        image_hash = ('b4d6775f5673486329e45a0586bf06b6'
-                      'dbe792199fd182ac6b9c7bb6c7d3e6dd')
-        image_path_xz = self.fetch_asset(image_url, asset_hash=image_hash,
-                                         algorithm='sha256')
-        image_path = archive.extract(image_path_xz, self.workdir)
-        image_pow2ceil_expand(image_path)
-
-        self.do_test_arm_orangepi_uboot_armbian(image_path)
-
     @skipUnless(os.getenv('AVOCADO_ALLOW_LARGE_STORAGE'), 'storage limited')
     def test_arm_orangepi_uboot_netbsd9(self):
         """
diff --git a/tests/acceptance/replay_kernel.py b/tests/acceptance/replay_kernel.py
index c1cb862468..71facdaa75 100644
--- a/tests/acceptance/replay_kernel.py
+++ b/tests/acceptance/replay_kernel.py
@@ -177,20 +177,18 @@ class ReplayKernelNormal(ReplayKernelBase):
         self.run_rr(kernel_path, kernel_command_line, console_pattern, shift=1)
 
     @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab')
-    @skipUnless(os.getenv('ARMBIAN_ARTIFACTS_CACHED'),
-                'Test artifacts fetched from unreliable apt.armbian.com')
     def test_arm_cubieboard_initrd(self):
         """
         :avocado: tags=arch:arm
         :avocado: tags=machine:cubieboard
         """
         deb_url = ('https://apt.armbian.com/pool/main/l/'
-                   'linux-4.20.7-sunxi/linux-image-dev-sunxi_5.75_armhf.deb')
-        deb_hash = '1334c29c44d984ffa05ed10de8c3361f33d78315'
+                   'linux-5.10.16-sunxi/linux-image-current-sunxi_21.02.2_armhf.deb')
+        deb_hash = '9fa84beda245cabf0b4fa84cf6eaa7738ead1da0'
         deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
         kernel_path = self.extract_from_deb(deb_path,
-                                            '/boot/vmlinuz-4.20.7-sunxi')
-        dtb_path = '/usr/lib/linux-image-dev-sunxi/sun4i-a10-cubieboard.dtb'
+                                            '/boot/vmlinuz-5.10.16-sunxi')
+        dtb_path = '/usr/lib/linux-image-current-sunxi/sun4i-a10-cubieboard.dtb'
         dtb_path = self.extract_from_deb(deb_path, dtb_path)
         initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
                       '2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/'
diff --git a/tests/atomic64-bench.c b/tests/bench/atomic64-bench.c
index e474753d34..e474753d34 100644
--- a/tests/atomic64-bench.c
+++ b/tests/bench/atomic64-bench.c
diff --git a/tests/atomic_add-bench.c b/tests/bench/atomic_add-bench.c
index f05471ab45..f05471ab45 100644
--- a/tests/atomic_add-bench.c
+++ b/tests/bench/atomic_add-bench.c
diff --git a/tests/benchmark-crypto-cipher.c b/tests/bench/benchmark-crypto-cipher.c
index c04f0a0fba..c04f0a0fba 100644
--- a/tests/benchmark-crypto-cipher.c
+++ b/tests/bench/benchmark-crypto-cipher.c
diff --git a/tests/benchmark-crypto-hash.c b/tests/bench/benchmark-crypto-hash.c
index 927b00bb4d..927b00bb4d 100644
--- a/tests/benchmark-crypto-hash.c
+++ b/tests/bench/benchmark-crypto-hash.c
diff --git a/tests/benchmark-crypto-hmac.c b/tests/bench/benchmark-crypto-hmac.c
index 5cca636789..5cca636789 100644
--- a/tests/benchmark-crypto-hmac.c
+++ b/tests/bench/benchmark-crypto-hmac.c
diff --git a/tests/bench/meson.build b/tests/bench/meson.build
new file mode 100644
index 0000000000..00b3c209dc
--- /dev/null
+++ b/tests/bench/meson.build
@@ -0,0 +1,34 @@
+
+qht_bench = executable('qht-bench',
+                       sources: 'qht-bench.c',
+                       dependencies: [qemuutil])
+
+executable('atomic_add-bench',
+           sources: files('atomic_add-bench.c'),
+           dependencies: [qemuutil],
+           build_by_default: false)
+
+executable('atomic64-bench',
+           sources: files('atomic64-bench.c'),
+           dependencies: [qemuutil],
+           build_by_default: false)
+
+benchs = {}
+
+if have_block
+  benchs += {
+     'benchmark-crypto-hash': [crypto],
+     'benchmark-crypto-hmac': [crypto],
+     'benchmark-crypto-cipher': [crypto],
+  }
+endif
+
+foreach bench_name, deps: benchs
+  exe = executable(bench_name, bench_name + '.c',
+                   dependencies: [qemuutil] + deps)
+  benchmark(bench_name, exe,
+            args: ['--tap', '-k'],
+            protocol: 'tap',
+            timeout: 0,
+            suite: ['speed'])
+endforeach
diff --git a/tests/qht-bench.c b/tests/bench/qht-bench.c
index 2e5b70ccd0..2e5b70ccd0 100644
--- a/tests/qht-bench.c
+++ b/tests/bench/qht-bench.c
diff --git a/tests/meson.build b/tests/meson.build
index 656d211e25..55a7b08275 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -1,18 +1,6 @@
 py3 = import('python').find_installation()
 
-qht_bench = executable('qht-bench',
-                       sources: 'qht-bench.c',
-                       dependencies: [qemuutil])
-
-executable('atomic_add-bench',
-           sources: files('atomic_add-bench.c'),
-           dependencies: [qemuutil],
-           build_by_default: false)
-
-executable('atomic64-bench',
-           sources: files('atomic64-bench.c'),
-           dependencies: [qemuutil],
-           build_by_default: false)
+subdir('bench')
 
 test_qapi_outputs = [
   'qapi-builtin-types.c',
@@ -69,211 +57,10 @@ endforeach
 libtestqapi = static_library('testqapi', sources: [genh, test_qapi_sources])
 testqapi = declare_dependency(link_with: libtestqapi, sources: [genh, test_qapi_headers])
 
-testblock = declare_dependency(dependencies: [block], sources: 'iothread.c')
-
-tests = {
-  'check-block-qdict': [],
-  'check-qdict': [],
-  'check-qnum': [],
-  'check-qstring': [],
-  'check-qlist': [],
-  'check-qnull': [],
-  'check-qobject': [],
-  'check-qjson': [],
-  'check-qlit': [],
-  'test-qobject-output-visitor': [testqapi],
-  'test-clone-visitor': [testqapi],
-  'test-qobject-input-visitor': [testqapi],
-  'test-string-input-visitor': [testqapi],
-  'test-string-output-visitor': [testqapi],
-  'test-opts-visitor': [testqapi],
-  'test-visitor-serialization': [testqapi],
-  'test-bitmap': [],
-  # all code tested by test-x86-cpuid is inside topology.h
-  'test-x86-cpuid': [],
-  'test-cutils': [],
-  'test-shift128': [],
-  'test-mul64': [],
-  # all code tested by test-int128 is inside int128.h
-  'test-int128': [],
-  'rcutorture': [],
-  'test-rcu-list': [],
-  'test-rcu-simpleq': [],
-  'test-rcu-tailq': [],
-  'test-rcu-slist': [],
-  'test-qdist': [],
-  'test-qht': [],
-  'test-bitops': [],
-  'test-bitcnt': [],
-  'test-qgraph': ['qtest/libqos/qgraph.c'],
-  'check-qom-interface': [qom],
-  'check-qom-proplist': [qom],
-  'test-qemu-opts': [],
-  'test-keyval': [testqapi],
-  'test-logging': [],
-  'test-uuid': [],
-  'ptimer-test': ['ptimer-test-stubs.c', meson.source_root() / 'hw/core/ptimer.c'],
-  'test-qapi-util': [],
-}
-
-if have_system or have_tools
-  tests += {
-    'test-qmp-event': [testqapi],
-  }
-endif
-
 test_deps = {
   'test-qht-par': qht_bench,
 }
 
-benchs = {}
-
-if have_block
-  tests += {
-    'test-coroutine': [testblock],
-    'test-aio': [testblock],
-    'test-aio-multithread': [testblock],
-    'test-throttle': [testblock],
-    'test-thread-pool': [testblock],
-    'test-hbitmap': [testblock],
-    'test-bdrv-drain': [testblock],
-    'test-bdrv-graph-mod': [testblock],
-    'test-blockjob': [testblock],
-    'test-blockjob-txn': [testblock],
-    'test-block-backend': [testblock],
-    'test-block-iothread': [testblock],
-    'test-write-threshold': [testblock],
-    'test-crypto-hash': [crypto],
-    'test-crypto-hmac': [crypto],
-    'test-crypto-cipher': [crypto],
-    'test-crypto-secret': [crypto, keyutils],
-    'test-authz-simple': [authz],
-    'test-authz-list': [authz],
-    'test-authz-listfile': [authz],
-    'test-io-task': [testblock],
-    'test-io-channel-socket': ['socket-helpers.c', 'io-channel-helpers.c', io],
-    'test-io-channel-file': ['io-channel-helpers.c', io],
-    'test-io-channel-command': ['io-channel-helpers.c', io],
-    'test-io-channel-buffer': ['io-channel-helpers.c', io],
-    'test-crypto-ivgen': [io],
-    'test-crypto-afsplit': [io],
-    'test-crypto-block': [io],
-  }
-  if 'CONFIG_GNUTLS' in config_host and \
-     'CONFIG_TASN1' in config_host and \
-     'CONFIG_POSIX' in config_host
-    tests += {
-      'test-crypto-tlscredsx509': ['crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c',
-                                   tasn1, crypto, gnutls],
-      'test-crypto-tlssession': ['crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c', 'crypto-tls-psk-helpers.c',
-                                 tasn1, crypto, gnutls],
-      'test-io-channel-tls': ['io-channel-helpers.c', 'crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c',
-                              tasn1, io, crypto, gnutls]}
-  endif
-  if 'CONFIG_AUTH_PAM' in config_host
-    tests += {'test-authz-pam': [authz]}
-  endif
-  if 'CONFIG_QEMU_PRIVATE_XTS' in config_host
-    tests += {'test-crypto-xts': [crypto, io]}
-  endif
-  if 'CONFIG_POSIX' in config_host
-    tests += {'test-image-locking': [testblock]}
-  endif
-  if 'CONFIG_REPLICATION' in config_host
-    tests += {'test-replication': [testblock]}
-  endif
-  if 'CONFIG_NETTLE' in config_host or 'CONFIG_GCRYPT' in config_host
-    tests += {'test-crypto-pbkdf': [io]}
-  endif
-  if 'CONFIG_EPOLL_CREATE1' in config_host
-    tests += {'test-fdmon-epoll': [testblock]}
-  endif
-  benchs += {
-     'benchmark-crypto-hash': [crypto],
-     'benchmark-crypto-hmac': [crypto],
-     'benchmark-crypto-cipher': [crypto],
-  }
-endif
-
-if have_system
-  tests += {
-    'test-iov': [],
-    'test-qmp-cmds': [testqapi],
-    'test-xbzrle': [migration],
-    'test-timed-average': [],
-    'test-util-sockets': ['socket-helpers.c'],
-    'test-base64': [],
-    'test-bufferiszero': [],
-    'test-vmstate': [migration, io]
-  }
-  if 'CONFIG_INOTIFY1' in config_host
-    tests += {'test-util-filemonitor': []}
-  endif
-
-  # Some tests: test-char, test-qdev-global-props, and test-qga,
-  # are not runnable under TSan due to a known issue.
-  # https://github.com/google/sanitizers/issues/1116
-  if 'CONFIG_TSAN' not in config_host
-    if 'CONFIG_POSIX' in config_host
-        tests += {
-          'test-char': ['socket-helpers.c', qom, io, chardev]
-        }
-    endif
-
-    tests += {
-      'test-qdev-global-props': [qom, hwcore, testqapi]
-    }
-  endif
-endif
-
-if 'CONFIG_TSAN' not in config_host and \
-   'CONFIG_GUEST_AGENT' in config_host and \
-   'CONFIG_LINUX' in config_host
-  tests += {'test-qga': ['qtest/libqtest.c']}
-  test_deps += {'test-qga': qga}
-endif
-
-test_env = environment()
-test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
-test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
-
-slow_tests = {
-  'test-crypto-tlscredsx509': 45,
-  'test-crypto-tlssession': 45
-}
-
-foreach test_name, extra: tests
-  src = [test_name + '.c']
-  deps = [qemuutil]
-  if extra.length() > 0
-    # use a sourceset to quickly separate sources and deps
-    test_ss = ss.source_set()
-    test_ss.add(extra)
-    src += test_ss.all_sources()
-    deps += test_ss.all_dependencies()
-  endif
-  exe = executable(test_name, src, genh, dependencies: deps)
-
-  test(test_name, exe,
-       depends: test_deps.get(test_name, []),
-       env: test_env,
-       args: ['--tap', '-k'],
-       protocol: 'tap',
-       timeout: slow_tests.get(test_name, 30),
-       priority: slow_tests.get(test_name, 30),
-       suite: ['unit'])
-endforeach
-
-foreach bench_name, deps: benchs
-  exe = executable(bench_name, bench_name + '.c',
-                   dependencies: [qemuutil] + deps)
-  benchmark(bench_name, exe,
-            args: ['--tap', '-k'],
-            protocol: 'tap',
-            timeout: 0,
-            suite: ['speed'])
-endforeach
-
 if have_tools and 'CONFIG_VHOST_USER' in config_host and 'CONFIG_LINUX' in config_host
   executable('vhost-user-bridge',
              sources: files('vhost-user-bridge.c'),
@@ -299,6 +86,7 @@ if not get_option('tcg').disabled()
   endif
 endif
 
+subdir('unit')
 subdir('qapi-schema')
 subdir('qtest')
 subdir('migration')
diff --git a/tests/qtest/npcm7xx_pwm-test.c b/tests/qtest/npcm7xx_pwm-test.c
index 3d82654b81..bd15a1c294 100644
--- a/tests/qtest/npcm7xx_pwm-test.c
+++ b/tests/qtest/npcm7xx_pwm-test.c
@@ -45,6 +45,7 @@
 #define PLL_FBDV(rv)    extract32((rv), 16, 12)
 #define PLL_OTDV1(rv)   extract32((rv), 8, 3)
 #define PLL_OTDV2(rv)   extract32((rv), 13, 3)
+#define APB4CKDIV(rv)   extract32((rv), 30, 2)
 #define APB3CKDIV(rv)   extract32((rv), 28, 2)
 #define CLK2CKDIV(rv)   extract32((rv), 0, 1)
 #define CLK4CKDIV(rv)   extract32((rv), 26, 2)
@@ -52,6 +53,49 @@
 
 #define MAX_DUTY        1000000
 
+/* MFT (PWM fan) related */
+#define MFT_BA(n)       (0xf0180000 + ((n) * 0x1000))
+#define MFT_IRQ(n)      (96 + (n))
+#define MFT_CNT1        0x00
+#define MFT_CRA         0x02
+#define MFT_CRB         0x04
+#define MFT_CNT2        0x06
+#define MFT_PRSC        0x08
+#define MFT_CKC         0x0a
+#define MFT_MCTRL       0x0c
+#define MFT_ICTRL       0x0e
+#define MFT_ICLR        0x10
+#define MFT_IEN         0x12
+#define MFT_CPA         0x14
+#define MFT_CPB         0x16
+#define MFT_CPCFG       0x18
+#define MFT_INASEL      0x1a
+#define MFT_INBSEL      0x1c
+
+#define MFT_MCTRL_ALL   0x64
+#define MFT_ICLR_ALL    0x3f
+#define MFT_IEN_ALL     0x3f
+#define MFT_CPCFG_EQ_MODE 0x44
+
+#define MFT_CKC_C2CSEL  BIT(3)
+#define MFT_CKC_C1CSEL  BIT(0)
+
+#define MFT_ICTRL_TFPND BIT(5)
+#define MFT_ICTRL_TEPND BIT(4)
+#define MFT_ICTRL_TDPND BIT(3)
+#define MFT_ICTRL_TCPND BIT(2)
+#define MFT_ICTRL_TBPND BIT(1)
+#define MFT_ICTRL_TAPND BIT(0)
+
+#define MFT_MAX_CNT     0xffff
+#define MFT_TIMEOUT     0x5000
+
+#define DEFAULT_RPM     19800
+#define DEFAULT_PRSC    255
+#define MFT_PULSE_PER_REVOLUTION 2
+
+#define MAX_ERROR       1
+
 typedef struct PWMModule {
     int irq;
     uint64_t base_addr;
@@ -210,19 +254,36 @@ static uint64_t pwm_get_duty(QTestState *qts, int module_index, int pwm_index)
     return pwm_qom_get(qts, path, name);
 }
 
+static void mft_qom_set(QTestState *qts, int index, const char *name,
+                        uint32_t value)
+{
+    QDict *response;
+    char *path = g_strdup_printf("/machine/soc/mft[%d]", index);
+
+    g_test_message("Setting properties %s of mft[%d] with value %u",
+                   name, index, value);
+    response = qtest_qmp(qts, "{ 'execute': 'qom-set',"
+            " 'arguments': { 'path': %s, "
+            " 'property': %s, 'value': %u}}",
+            path, name, value);
+    /* The qom set message returns successfully. */
+    g_assert_true(qdict_haskey(response, "return"));
+}
+
 static uint32_t get_pll(uint32_t con)
 {
     return REF_HZ * PLL_FBDV(con) / (PLL_INDV(con) * PLL_OTDV1(con)
             * PLL_OTDV2(con));
 }
 
-static uint64_t read_pclk(QTestState *qts)
+static uint64_t read_pclk(QTestState *qts, bool mft)
 {
     uint64_t freq = REF_HZ;
     uint32_t clksel = qtest_readl(qts, CLK_BA + CLKSEL);
     uint32_t pllcon;
     uint32_t clkdiv1 = qtest_readl(qts, CLK_BA + CLKDIV1);
     uint32_t clkdiv2 = qtest_readl(qts, CLK_BA + CLKDIV2);
+    uint32_t apbdiv = mft ? APB4CKDIV(clkdiv2) : APB3CKDIV(clkdiv2);
 
     switch (CPUCKSEL(clksel)) {
     case 0:
@@ -241,7 +302,7 @@ static uint64_t read_pclk(QTestState *qts)
         g_assert_not_reached();
     }
 
-    freq >>= (CLK2CKDIV(clkdiv1) + CLK4CKDIV(clkdiv1) + APB3CKDIV(clkdiv2));
+    freq >>= (CLK2CKDIV(clkdiv1) + CLK4CKDIV(clkdiv1) + apbdiv);
 
     return freq;
 }
@@ -267,7 +328,7 @@ static uint32_t pwm_selector(uint32_t csr)
 static uint64_t pwm_compute_freq(QTestState *qts, uint32_t ppr, uint32_t csr,
         uint32_t cnr)
 {
-    return read_pclk(qts) / ((ppr + 1) * pwm_selector(csr) * (cnr + 1));
+    return read_pclk(qts, false) / ((ppr + 1) * pwm_selector(csr) * (cnr + 1));
 }
 
 static uint64_t pwm_compute_duty(uint32_t cnr, uint32_t cmr, bool inverted)
@@ -301,6 +362,28 @@ static void pwm_write(QTestState *qts, const TestData *td, unsigned offset,
     qtest_writel(qts, td->module->base_addr + offset, value);
 }
 
+static uint8_t mft_readb(QTestState *qts, int index, unsigned offset)
+{
+    return qtest_readb(qts, MFT_BA(index) + offset);
+}
+
+static uint16_t mft_readw(QTestState *qts, int index, unsigned offset)
+{
+    return qtest_readw(qts, MFT_BA(index) + offset);
+}
+
+static void mft_writeb(QTestState *qts, int index, unsigned offset,
+                        uint8_t value)
+{
+    qtest_writeb(qts, MFT_BA(index) + offset, value);
+}
+
+static void mft_writew(QTestState *qts, int index, unsigned offset,
+                        uint16_t value)
+{
+    return qtest_writew(qts, MFT_BA(index) + offset, value);
+}
+
 static uint32_t pwm_read_ppr(QTestState *qts, const TestData *td)
 {
     return extract32(pwm_read(qts, td, PPR), ppr_base[pwm_index(td->pwm)], 8);
@@ -351,11 +434,116 @@ static void pwm_write_cmr(QTestState *qts, const TestData *td, uint32_t value)
     pwm_write(qts, td, td->pwm->cmr_offset, value);
 }
 
+static int mft_compute_index(const TestData *td)
+{
+    int index = pwm_module_index(td->module) * ARRAY_SIZE(pwm_list) +
+                pwm_index(td->pwm);
+
+    g_assert_cmpint(index, <,
+                    ARRAY_SIZE(pwm_module_list) * ARRAY_SIZE(pwm_list));
+
+    return index;
+}
+
+static void mft_reset_counters(QTestState *qts, int index)
+{
+    mft_writew(qts, index, MFT_CNT1, MFT_MAX_CNT);
+    mft_writew(qts, index, MFT_CNT2, MFT_MAX_CNT);
+    mft_writew(qts, index, MFT_CRA, MFT_MAX_CNT);
+    mft_writew(qts, index, MFT_CRB, MFT_MAX_CNT);
+    mft_writew(qts, index, MFT_CPA, MFT_MAX_CNT - MFT_TIMEOUT);
+    mft_writew(qts, index, MFT_CPB, MFT_MAX_CNT - MFT_TIMEOUT);
+}
+
+static void mft_init(QTestState *qts, const TestData *td)
+{
+    int index = mft_compute_index(td);
+
+    /* Enable everything */
+    mft_writeb(qts, index, MFT_CKC, 0);
+    mft_writeb(qts, index, MFT_ICLR, MFT_ICLR_ALL);
+    mft_writeb(qts, index, MFT_MCTRL, MFT_MCTRL_ALL);
+    mft_writeb(qts, index, MFT_IEN, MFT_IEN_ALL);
+    mft_writeb(qts, index, MFT_INASEL, 0);
+    mft_writeb(qts, index, MFT_INBSEL, 0);
+
+    /* Set cpcfg to use EQ mode, same as kernel driver */
+    mft_writeb(qts, index, MFT_CPCFG, MFT_CPCFG_EQ_MODE);
+
+    /* Write default counters, timeout and prescaler */
+    mft_reset_counters(qts, index);
+    mft_writeb(qts, index, MFT_PRSC, DEFAULT_PRSC);
+
+    /* Write default max rpm via QMP */
+    mft_qom_set(qts, index, "max_rpm[0]", DEFAULT_RPM);
+    mft_qom_set(qts, index, "max_rpm[1]", DEFAULT_RPM);
+}
+
+static int32_t mft_compute_cnt(uint32_t rpm, uint64_t clk)
+{
+    uint64_t cnt;
+
+    if (rpm == 0) {
+        return -1;
+    }
+
+    cnt = clk * 60 / ((DEFAULT_PRSC + 1) * rpm * MFT_PULSE_PER_REVOLUTION);
+    if (cnt >= MFT_TIMEOUT) {
+        return -1;
+    }
+    return MFT_MAX_CNT - cnt;
+}
+
+static void mft_verify_rpm(QTestState *qts, const TestData *td, uint64_t duty)
+{
+    int index = mft_compute_index(td);
+    uint16_t cnt, cr;
+    uint32_t rpm = DEFAULT_RPM * duty / MAX_DUTY;
+    uint64_t clk = read_pclk(qts, true);
+    int32_t expected_cnt = mft_compute_cnt(rpm, clk);
+
+    qtest_irq_intercept_in(qts, "/machine/soc/a9mpcore/gic");
+    g_test_message(
+        "verifying rpm for mft[%d]: clk: %" PRIu64 ", duty: %" PRIu64 ", rpm: %u, cnt: %d",
+        index, clk, duty, rpm, expected_cnt);
+
+    /* Verify rpm for fan A */
+    /* Stop capture */
+    mft_writeb(qts, index, MFT_CKC, 0);
+    mft_writeb(qts, index, MFT_ICLR, MFT_ICLR_ALL);
+    mft_reset_counters(qts, index);
+    g_assert_cmphex(mft_readw(qts, index, MFT_CNT1), ==, MFT_MAX_CNT);
+    g_assert_cmphex(mft_readw(qts, index, MFT_CRA), ==, MFT_MAX_CNT);
+    g_assert_cmphex(mft_readw(qts, index, MFT_CPA), ==,
+                    MFT_MAX_CNT - MFT_TIMEOUT);
+    /* Start capture */
+    mft_writeb(qts, index, MFT_CKC, MFT_CKC_C1CSEL);
+    g_assert_true(qtest_get_irq(qts, MFT_IRQ(index)));
+    if (expected_cnt == -1) {
+        g_assert_cmphex(mft_readb(qts, index, MFT_ICTRL), ==, MFT_ICTRL_TEPND);
+    } else {
+        g_assert_cmphex(mft_readb(qts, index, MFT_ICTRL), ==, MFT_ICTRL_TAPND);
+        cnt = mft_readw(qts, index, MFT_CNT1);
+        /*
+         * Due to error in clock measurement and rounding, we might have a small
+         * error in measuring RPM.
+         */
+        g_assert_cmphex(cnt + MAX_ERROR, >=, expected_cnt);
+        g_assert_cmphex(cnt, <=, expected_cnt + MAX_ERROR);
+        cr = mft_readw(qts, index, MFT_CRA);
+        g_assert_cmphex(cnt, ==, cr);
+    }
+
+    /* Verify rpm for fan B */
+
+    qtest_irq_intercept_out(qts, "/machine/soc/a9mpcore/gic");
+}
+
 /* Check pwm registers can be reset to default value */
 static void test_init(gconstpointer test_data)
 {
     const TestData *td = test_data;
-    QTestState *qts = qtest_init("-machine quanta-gsj");
+    QTestState *qts = qtest_init("-machine npcm750-evb");
     int module = pwm_module_index(td->module);
     int pwm = pwm_index(td->pwm);
 
@@ -369,7 +557,7 @@ static void test_init(gconstpointer test_data)
 static void test_oneshot(gconstpointer test_data)
 {
     const TestData *td = test_data;
-    QTestState *qts = qtest_init("-machine quanta-gsj");
+    QTestState *qts = qtest_init("-machine npcm750-evb");
     int module = pwm_module_index(td->module);
     int pwm = pwm_index(td->pwm);
     uint32_t ppr, csr, pcr;
@@ -400,13 +588,15 @@ static void test_oneshot(gconstpointer test_data)
 static void test_toggle(gconstpointer test_data)
 {
     const TestData *td = test_data;
-    QTestState *qts = qtest_init("-machine quanta-gsj");
+    QTestState *qts = qtest_init("-machine npcm750-evb");
     int module = pwm_module_index(td->module);
     int pwm = pwm_index(td->pwm);
     uint32_t ppr, csr, pcr, cnr, cmr;
     int i, j, k, l;
     uint64_t expected_freq, expected_duty;
 
+    mft_init(qts, td);
+
     pcr = CH_EN | CH_MOD;
     for (i = 0; i < ARRAY_SIZE(ppr_list); ++i) {
         ppr = ppr_list[i];
@@ -440,6 +630,9 @@ static void test_toggle(gconstpointer test_data)
                                 ==, expected_freq);
                     }
 
+                    /* Test MFT's RPM is correct. */
+                    mft_verify_rpm(qts, td, expected_duty);
+
                     /* Test inverted mode */
                     expected_duty = pwm_compute_duty(cnr, cmr, true);
                     pwm_write_pcr(qts, td, pcr | CH_INV);
diff --git a/tests/check-block-qdict.c b/tests/unit/check-block-qdict.c
index 5a25825093..5a25825093 100644
--- a/tests/check-block-qdict.c
+++ b/tests/unit/check-block-qdict.c
diff --git a/tests/check-qdict.c b/tests/unit/check-qdict.c
index b5efa859b0..b5efa859b0 100644
--- a/tests/check-qdict.c
+++ b/tests/unit/check-qdict.c
diff --git a/tests/check-qjson.c b/tests/unit/check-qjson.c
index c845f91d43..c845f91d43 100644
--- a/tests/check-qjson.c
+++ b/tests/unit/check-qjson.c
diff --git a/tests/check-qlist.c b/tests/unit/check-qlist.c
index 3cd0ccbf19..3cd0ccbf19 100644
--- a/tests/check-qlist.c
+++ b/tests/unit/check-qlist.c
diff --git a/tests/check-qlit.c b/tests/unit/check-qlit.c
index bd6798d912..bd6798d912 100644
--- a/tests/check-qlit.c
+++ b/tests/unit/check-qlit.c
diff --git a/tests/check-qnull.c b/tests/unit/check-qnull.c
index ebf21db83c..ebf21db83c 100644
--- a/tests/check-qnull.c
+++ b/tests/unit/check-qnull.c
diff --git a/tests/check-qnum.c b/tests/unit/check-qnum.c
index b85fca2302..b85fca2302 100644
--- a/tests/check-qnum.c
+++ b/tests/unit/check-qnum.c
diff --git a/tests/check-qobject.c b/tests/unit/check-qobject.c
index c1713d15af..c1713d15af 100644
--- a/tests/check-qobject.c
+++ b/tests/unit/check-qobject.c
diff --git a/tests/check-qom-interface.c b/tests/unit/check-qom-interface.c
index c99be97ed8..c99be97ed8 100644
--- a/tests/check-qom-interface.c
+++ b/tests/unit/check-qom-interface.c
diff --git a/tests/check-qom-proplist.c b/tests/unit/check-qom-proplist.c
index 1b76581980..1b76581980 100644
--- a/tests/check-qom-proplist.c
+++ b/tests/unit/check-qom-proplist.c
diff --git a/tests/check-qstring.c b/tests/unit/check-qstring.c
index 4bf9772093..4bf9772093 100644
--- a/tests/check-qstring.c
+++ b/tests/unit/check-qstring.c
diff --git a/tests/crypto-tls-psk-helpers.c b/tests/unit/crypto-tls-psk-helpers.c
index a8395477c3..a8395477c3 100644
--- a/tests/crypto-tls-psk-helpers.c
+++ b/tests/unit/crypto-tls-psk-helpers.c
diff --git a/tests/crypto-tls-psk-helpers.h b/tests/unit/crypto-tls-psk-helpers.h
index 5aa9951cb6..5aa9951cb6 100644
--- a/tests/crypto-tls-psk-helpers.h
+++ b/tests/unit/crypto-tls-psk-helpers.h
diff --git a/tests/crypto-tls-x509-helpers.c b/tests/unit/crypto-tls-x509-helpers.c
index 97658592a2..97658592a2 100644
--- a/tests/crypto-tls-x509-helpers.c
+++ b/tests/unit/crypto-tls-x509-helpers.c
diff --git a/tests/crypto-tls-x509-helpers.h b/tests/unit/crypto-tls-x509-helpers.h
index 8fcd7785ab..8fcd7785ab 100644
--- a/tests/crypto-tls-x509-helpers.h
+++ b/tests/unit/crypto-tls-x509-helpers.h
diff --git a/tests/io-channel-helpers.c b/tests/unit/io-channel-helpers.c
index ff156ed3c4..ff156ed3c4 100644
--- a/tests/io-channel-helpers.c
+++ b/tests/unit/io-channel-helpers.c
diff --git a/tests/io-channel-helpers.h b/tests/unit/io-channel-helpers.h
index 3d14043710..3d14043710 100644
--- a/tests/io-channel-helpers.h
+++ b/tests/unit/io-channel-helpers.h
diff --git a/tests/iothread.c b/tests/unit/iothread.c
index afde12b4ef..afde12b4ef 100644
--- a/tests/iothread.c
+++ b/tests/unit/iothread.c
diff --git a/tests/iothread.h b/tests/unit/iothread.h
index 4877cea6a3..4877cea6a3 100644
--- a/tests/iothread.h
+++ b/tests/unit/iothread.h
diff --git a/tests/unit/meson.build b/tests/unit/meson.build
new file mode 100644
index 0000000000..4bfe4627ba
--- /dev/null
+++ b/tests/unit/meson.build
@@ -0,0 +1,184 @@
+
+testblock = declare_dependency(dependencies: [block], sources: 'iothread.c')
+
+tests = {
+  'check-block-qdict': [],
+  'check-qdict': [],
+  'check-qnum': [],
+  'check-qstring': [],
+  'check-qlist': [],
+  'check-qnull': [],
+  'check-qobject': [],
+  'check-qjson': [],
+  'check-qlit': [],
+  'test-qobject-output-visitor': [testqapi],
+  'test-clone-visitor': [testqapi],
+  'test-qobject-input-visitor': [testqapi],
+  'test-string-input-visitor': [testqapi],
+  'test-string-output-visitor': [testqapi],
+  'test-opts-visitor': [testqapi],
+  'test-visitor-serialization': [testqapi],
+  'test-bitmap': [],
+  # all code tested by test-x86-cpuid is inside topology.h
+  'test-x86-cpuid': [],
+  'test-cutils': [],
+  'test-shift128': [],
+  'test-mul64': [],
+  # all code tested by test-int128 is inside int128.h
+  'test-int128': [],
+  'rcutorture': [],
+  'test-rcu-list': [],
+  'test-rcu-simpleq': [],
+  'test-rcu-tailq': [],
+  'test-rcu-slist': [],
+  'test-qdist': [],
+  'test-qht': [],
+  'test-bitops': [],
+  'test-bitcnt': [],
+  'test-qgraph': ['../qtest/libqos/qgraph.c'],
+  'check-qom-interface': [qom],
+  'check-qom-proplist': [qom],
+  'test-qemu-opts': [],
+  'test-keyval': [testqapi],
+  'test-logging': [],
+  'test-uuid': [],
+  'ptimer-test': ['ptimer-test-stubs.c', meson.source_root() / 'hw/core/ptimer.c'],
+  'test-qapi-util': [],
+}
+
+if have_system or have_tools
+  tests += {
+    'test-qmp-event': [testqapi],
+  }
+endif
+
+if have_block
+  tests += {
+    'test-coroutine': [testblock],
+    'test-aio': [testblock],
+    'test-aio-multithread': [testblock],
+    'test-throttle': [testblock],
+    'test-thread-pool': [testblock],
+    'test-hbitmap': [testblock],
+    'test-bdrv-drain': [testblock],
+    'test-bdrv-graph-mod': [testblock],
+    'test-blockjob': [testblock],
+    'test-blockjob-txn': [testblock],
+    'test-block-backend': [testblock],
+    'test-block-iothread': [testblock],
+    'test-write-threshold': [testblock],
+    'test-crypto-hash': [crypto],
+    'test-crypto-hmac': [crypto],
+    'test-crypto-cipher': [crypto],
+    'test-crypto-secret': [crypto, keyutils],
+    'test-authz-simple': [authz],
+    'test-authz-list': [authz],
+    'test-authz-listfile': [authz],
+    'test-io-task': [testblock],
+    'test-io-channel-socket': ['socket-helpers.c', 'io-channel-helpers.c', io],
+    'test-io-channel-file': ['io-channel-helpers.c', io],
+    'test-io-channel-command': ['io-channel-helpers.c', io],
+    'test-io-channel-buffer': ['io-channel-helpers.c', io],
+    'test-crypto-ivgen': [io],
+    'test-crypto-afsplit': [io],
+    'test-crypto-block': [io],
+  }
+  if 'CONFIG_GNUTLS' in config_host and \
+     'CONFIG_TASN1' in config_host and \
+     'CONFIG_POSIX' in config_host
+    tests += {
+      'test-crypto-tlscredsx509': ['crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c',
+                                   tasn1, crypto, gnutls],
+      'test-crypto-tlssession': ['crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c', 'crypto-tls-psk-helpers.c',
+                                 tasn1, crypto, gnutls],
+      'test-io-channel-tls': ['io-channel-helpers.c', 'crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c',
+                              tasn1, io, crypto, gnutls]}
+  endif
+  if 'CONFIG_AUTH_PAM' in config_host
+    tests += {'test-authz-pam': [authz]}
+  endif
+  if 'CONFIG_QEMU_PRIVATE_XTS' in config_host
+    tests += {'test-crypto-xts': [crypto, io]}
+  endif
+  if 'CONFIG_POSIX' in config_host
+    tests += {'test-image-locking': [testblock]}
+  endif
+  if 'CONFIG_REPLICATION' in config_host
+    tests += {'test-replication': [testblock]}
+  endif
+  if 'CONFIG_NETTLE' in config_host or 'CONFIG_GCRYPT' in config_host
+    tests += {'test-crypto-pbkdf': [io]}
+  endif
+  if 'CONFIG_EPOLL_CREATE1' in config_host
+    tests += {'test-fdmon-epoll': [testblock]}
+  endif
+endif
+
+if have_system
+  tests += {
+    'test-iov': [],
+    'test-qmp-cmds': [testqapi],
+    'test-xbzrle': [migration],
+    'test-timed-average': [],
+    'test-util-sockets': ['socket-helpers.c'],
+    'test-base64': [],
+    'test-bufferiszero': [],
+    'test-vmstate': [migration, io]
+  }
+  if 'CONFIG_INOTIFY1' in config_host
+    tests += {'test-util-filemonitor': []}
+  endif
+
+  # Some tests: test-char, test-qdev-global-props, and test-qga,
+  # are not runnable under TSan due to a known issue.
+  # https://github.com/google/sanitizers/issues/1116
+  if 'CONFIG_TSAN' not in config_host
+    if 'CONFIG_POSIX' in config_host
+        tests += {
+          'test-char': ['socket-helpers.c', qom, io, chardev]
+        }
+    endif
+
+    tests += {
+      'test-qdev-global-props': [qom, hwcore, testqapi]
+    }
+  endif
+endif
+
+if 'CONFIG_TSAN' not in config_host and \
+   'CONFIG_GUEST_AGENT' in config_host and \
+   'CONFIG_LINUX' in config_host
+  tests += {'test-qga': ['../qtest/libqtest.c']}
+  test_deps += {'test-qga': qga}
+endif
+
+test_env = environment()
+test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
+test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
+
+slow_tests = {
+  'test-crypto-tlscredsx509': 45,
+  'test-crypto-tlssession': 45
+}
+
+foreach test_name, extra: tests
+  src = [test_name + '.c']
+  deps = [qemuutil]
+  if extra.length() > 0
+    # use a sourceset to quickly separate sources and deps
+    test_ss = ss.source_set()
+    test_ss.add(extra)
+    src += test_ss.all_sources()
+    deps += test_ss.all_dependencies()
+  endif
+  exe = executable(test_name, src, genh, dependencies: deps)
+
+  test(test_name, exe,
+       depends: test_deps.get(test_name, []),
+       env: test_env,
+       args: ['--tap', '-k'],
+       protocol: 'tap',
+       timeout: slow_tests.get(test_name, 30),
+       priority: slow_tests.get(test_name, 30),
+       suite: ['unit'])
+endforeach
diff --git a/tests/pkix_asn1_tab.c b/tests/unit/pkix_asn1_tab.c
index 4aaf736d3f..15397cf77a 100644
--- a/tests/pkix_asn1_tab.c
+++ b/tests/unit/pkix_asn1_tab.c
@@ -4,7 +4,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "tests/crypto-tls-x509-helpers.h"
+#include "crypto-tls-x509-helpers.h"
 
 #ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT
 
diff --git a/tests/ptimer-test-stubs.c b/tests/unit/ptimer-test-stubs.c
index 7f801a4d09..7f801a4d09 100644
--- a/tests/ptimer-test-stubs.c
+++ b/tests/unit/ptimer-test-stubs.c
diff --git a/tests/ptimer-test.c b/tests/unit/ptimer-test.c
index 9176b96c1c..9176b96c1c 100644
--- a/tests/ptimer-test.c
+++ b/tests/unit/ptimer-test.c
diff --git a/tests/ptimer-test.h b/tests/unit/ptimer-test.h
index 09ac56da9e..09ac56da9e 100644
--- a/tests/ptimer-test.h
+++ b/tests/unit/ptimer-test.h
diff --git a/tests/rcutorture.c b/tests/unit/rcutorture.c
index de6f649058..de6f649058 100644
--- a/tests/rcutorture.c
+++ b/tests/unit/rcutorture.c
diff --git a/tests/socket-helpers.c b/tests/unit/socket-helpers.c
index f704fd1a69..f704fd1a69 100644
--- a/tests/socket-helpers.c
+++ b/tests/unit/socket-helpers.c
diff --git a/tests/socket-helpers.h b/tests/unit/socket-helpers.h
index 512a004811..512a004811 100644
--- a/tests/socket-helpers.h
+++ b/tests/unit/socket-helpers.h
diff --git a/tests/test-aio-multithread.c b/tests/unit/test-aio-multithread.c
index a555cc8835..a555cc8835 100644
--- a/tests/test-aio-multithread.c
+++ b/tests/unit/test-aio-multithread.c
diff --git a/tests/test-aio.c b/tests/unit/test-aio.c
index 8a46078463..8a46078463 100644
--- a/tests/test-aio.c
+++ b/tests/unit/test-aio.c
diff --git a/tests/test-authz-list.c b/tests/unit/test-authz-list.c
index 5351992a01..5351992a01 100644
--- a/tests/test-authz-list.c
+++ b/tests/unit/test-authz-list.c
diff --git a/tests/test-authz-listfile.c b/tests/unit/test-authz-listfile.c
index 64d0e1500f..64d0e1500f 100644
--- a/tests/test-authz-listfile.c
+++ b/tests/unit/test-authz-listfile.c
diff --git a/tests/test-authz-pam.c b/tests/unit/test-authz-pam.c
index 4fe1ef2603..4fe1ef2603 100644
--- a/tests/test-authz-pam.c
+++ b/tests/unit/test-authz-pam.c
diff --git a/tests/test-authz-simple.c b/tests/unit/test-authz-simple.c
index 6f9034d8ff..6f9034d8ff 100644
--- a/tests/test-authz-simple.c
+++ b/tests/unit/test-authz-simple.c
diff --git a/tests/test-base64.c b/tests/unit/test-base64.c
index 3012d7be26..3012d7be26 100644
--- a/tests/test-base64.c
+++ b/tests/unit/test-base64.c
diff --git a/tests/test-bdrv-drain.c b/tests/unit/test-bdrv-drain.c
index 8a29e33e00..8a29e33e00 100644
--- a/tests/test-bdrv-drain.c
+++ b/tests/unit/test-bdrv-drain.c
diff --git a/tests/test-bdrv-graph-mod.c b/tests/unit/test-bdrv-graph-mod.c
index c4f7d16039..c4f7d16039 100644
--- a/tests/test-bdrv-graph-mod.c
+++ b/tests/unit/test-bdrv-graph-mod.c
diff --git a/tests/test-bitcnt.c b/tests/unit/test-bitcnt.c
index e153dcb8a2..e153dcb8a2 100644
--- a/tests/test-bitcnt.c
+++ b/tests/unit/test-bitcnt.c
diff --git a/tests/test-bitmap.c b/tests/unit/test-bitmap.c
index 8db4f67883..8db4f67883 100644
--- a/tests/test-bitmap.c
+++ b/tests/unit/test-bitmap.c
diff --git a/tests/test-bitops.c b/tests/unit/test-bitops.c
index 5a791d2e17..5a791d2e17 100644
--- a/tests/test-bitops.c
+++ b/tests/unit/test-bitops.c
diff --git a/tests/test-block-backend.c b/tests/unit/test-block-backend.c
index 2fb1a444bd..2fb1a444bd 100644
--- a/tests/test-block-backend.c
+++ b/tests/unit/test-block-backend.c
diff --git a/tests/test-block-iothread.c b/tests/unit/test-block-iothread.c
index 3f866a35c6..3f866a35c6 100644
--- a/tests/test-block-iothread.c
+++ b/tests/unit/test-block-iothread.c
diff --git a/tests/test-blockjob-txn.c b/tests/unit/test-blockjob-txn.c
index 8bd13b9949..8bd13b9949 100644
--- a/tests/test-blockjob-txn.c
+++ b/tests/unit/test-blockjob-txn.c
diff --git a/tests/test-blockjob.c b/tests/unit/test-blockjob.c
index 7519847912..7519847912 100644
--- a/tests/test-blockjob.c
+++ b/tests/unit/test-blockjob.c
diff --git a/tests/test-bufferiszero.c b/tests/unit/test-bufferiszero.c
index e45fd31804..e45fd31804 100644
--- a/tests/test-bufferiszero.c
+++ b/tests/unit/test-bufferiszero.c
diff --git a/tests/test-char.c b/tests/unit/test-char.c
index 755d54c15e..755d54c15e 100644
--- a/tests/test-char.c
+++ b/tests/unit/test-char.c
diff --git a/tests/test-clone-visitor.c b/tests/unit/test-clone-visitor.c
index 4944b3d857..4944b3d857 100644
--- a/tests/test-clone-visitor.c
+++ b/tests/unit/test-clone-visitor.c
diff --git a/tests/test-coroutine.c b/tests/unit/test-coroutine.c
index e946d93a65..e946d93a65 100644
--- a/tests/test-coroutine.c
+++ b/tests/unit/test-coroutine.c
diff --git a/tests/test-crypto-afsplit.c b/tests/unit/test-crypto-afsplit.c
index 00a7c180fd..00a7c180fd 100644
--- a/tests/test-crypto-afsplit.c
+++ b/tests/unit/test-crypto-afsplit.c
diff --git a/tests/test-crypto-block.c b/tests/unit/test-crypto-block.c
index 3b1f0d509f..3b1f0d509f 100644
--- a/tests/test-crypto-block.c
+++ b/tests/unit/test-crypto-block.c
diff --git a/tests/test-crypto-cipher.c b/tests/unit/test-crypto-cipher.c
index 280319a223..280319a223 100644
--- a/tests/test-crypto-cipher.c
+++ b/tests/unit/test-crypto-cipher.c
diff --git a/tests/test-crypto-hash.c b/tests/unit/test-crypto-hash.c
index ce7d0ab9b5..ce7d0ab9b5 100644
--- a/tests/test-crypto-hash.c
+++ b/tests/unit/test-crypto-hash.c
diff --git a/tests/test-crypto-hmac.c b/tests/unit/test-crypto-hmac.c
index ee55382a3c..ee55382a3c 100644
--- a/tests/test-crypto-hmac.c
+++ b/tests/unit/test-crypto-hmac.c
diff --git a/tests/test-crypto-ivgen.c b/tests/unit/test-crypto-ivgen.c
index f581e6aba7..f581e6aba7 100644
--- a/tests/test-crypto-ivgen.c
+++ b/tests/unit/test-crypto-ivgen.c
diff --git a/tests/test-crypto-pbkdf.c b/tests/unit/test-crypto-pbkdf.c
index c50fd639d2..c50fd639d2 100644
--- a/tests/test-crypto-pbkdf.c
+++ b/tests/unit/test-crypto-pbkdf.c
diff --git a/tests/test-crypto-secret.c b/tests/unit/test-crypto-secret.c
index 34a4aecc12..34a4aecc12 100644
--- a/tests/test-crypto-secret.c
+++ b/tests/unit/test-crypto-secret.c
diff --git a/tests/test-crypto-tlscredsx509.c b/tests/unit/test-crypto-tlscredsx509.c
index f487349c32..f487349c32 100644
--- a/tests/test-crypto-tlscredsx509.c
+++ b/tests/unit/test-crypto-tlscredsx509.c
diff --git a/tests/test-crypto-tlssession.c b/tests/unit/test-crypto-tlssession.c
index 8b2453fa79..8b2453fa79 100644
--- a/tests/test-crypto-tlssession.c
+++ b/tests/unit/test-crypto-tlssession.c
diff --git a/tests/test-crypto-xts.c b/tests/unit/test-crypto-xts.c
index 7acbc956fd..7acbc956fd 100644
--- a/tests/test-crypto-xts.c
+++ b/tests/unit/test-crypto-xts.c
diff --git a/tests/test-cutils.c b/tests/unit/test-cutils.c
index bad3a60993..bad3a60993 100644
--- a/tests/test-cutils.c
+++ b/tests/unit/test-cutils.c
diff --git a/tests/test-fdmon-epoll.c b/tests/unit/test-fdmon-epoll.c
index 11fd8a2fa9..11fd8a2fa9 100644
--- a/tests/test-fdmon-epoll.c
+++ b/tests/unit/test-fdmon-epoll.c
diff --git a/tests/test-hbitmap.c b/tests/unit/test-hbitmap.c
index b6726cf76b..b6726cf76b 100644
--- a/tests/test-hbitmap.c
+++ b/tests/unit/test-hbitmap.c
diff --git a/tests/test-image-locking.c b/tests/unit/test-image-locking.c
index ba057bd66c..ba057bd66c 100644
--- a/tests/test-image-locking.c
+++ b/tests/unit/test-image-locking.c
diff --git a/tests/test-int128.c b/tests/unit/test-int128.c
index b86a3c76e6..b86a3c76e6 100644
--- a/tests/test-int128.c
+++ b/tests/unit/test-int128.c
diff --git a/tests/test-io-channel-buffer.c b/tests/unit/test-io-channel-buffer.c
index 9c6724dea4..9c6724dea4 100644
--- a/tests/test-io-channel-buffer.c
+++ b/tests/unit/test-io-channel-buffer.c
diff --git a/tests/test-io-channel-command.c b/tests/unit/test-io-channel-command.c
index 99056e07c0..99056e07c0 100644
--- a/tests/test-io-channel-command.c
+++ b/tests/unit/test-io-channel-command.c
diff --git a/tests/test-io-channel-file.c b/tests/unit/test-io-channel-file.c
index 29038e67b6..29038e67b6 100644
--- a/tests/test-io-channel-file.c
+++ b/tests/unit/test-io-channel-file.c
diff --git a/tests/test-io-channel-socket.c b/tests/unit/test-io-channel-socket.c
index c49eec1f03..c49eec1f03 100644
--- a/tests/test-io-channel-socket.c
+++ b/tests/unit/test-io-channel-socket.c
diff --git a/tests/test-io-channel-tls.c b/tests/unit/test-io-channel-tls.c
index ad7554c534..ad7554c534 100644
--- a/tests/test-io-channel-tls.c
+++ b/tests/unit/test-io-channel-tls.c
diff --git a/tests/test-io-task.c b/tests/unit/test-io-task.c
index 953a50ae66..953a50ae66 100644
--- a/tests/test-io-task.c
+++ b/tests/unit/test-io-task.c
diff --git a/tests/test-iov.c b/tests/unit/test-iov.c
index 9c415e2f1f..9c415e2f1f 100644
--- a/tests/test-iov.c
+++ b/tests/unit/test-iov.c
diff --git a/tests/test-keyval.c b/tests/unit/test-keyval.c
index e20c07cf3e..e20c07cf3e 100644
--- a/tests/test-keyval.c
+++ b/tests/unit/test-keyval.c
diff --git a/tests/test-logging.c b/tests/unit/test-logging.c
index ccb819f193..ccb819f193 100644
--- a/tests/test-logging.c
+++ b/tests/unit/test-logging.c
diff --git a/tests/test-mul64.c b/tests/unit/test-mul64.c
index 9be775d084..9be775d084 100644
--- a/tests/test-mul64.c
+++ b/tests/unit/test-mul64.c
diff --git a/tests/test-opts-visitor.c b/tests/unit/test-opts-visitor.c
index 23e897061c..23e897061c 100644
--- a/tests/test-opts-visitor.c
+++ b/tests/unit/test-opts-visitor.c
diff --git a/tests/test-qapi-util.c b/tests/unit/test-qapi-util.c
index 847f305cff..847f305cff 100644
--- a/tests/test-qapi-util.c
+++ b/tests/unit/test-qapi-util.c
diff --git a/tests/test-qdev-global-props.c b/tests/unit/test-qdev-global-props.c
index c8862cac5f..c8862cac5f 100644
--- a/tests/test-qdev-global-props.c
+++ b/tests/unit/test-qdev-global-props.c
diff --git a/tests/test-qdist.c b/tests/unit/test-qdist.c
index 9541ce31eb..9541ce31eb 100644
--- a/tests/test-qdist.c
+++ b/tests/unit/test-qdist.c
diff --git a/tests/test-qemu-opts.c b/tests/unit/test-qemu-opts.c
index 6568e31a72..6568e31a72 100644
--- a/tests/test-qemu-opts.c
+++ b/tests/unit/test-qemu-opts.c
diff --git a/tests/test-qga.c b/tests/unit/test-qga.c
index eb33264e8e..5cb140d1b5 100644
--- a/tests/test-qga.c
+++ b/tests/unit/test-qga.c
@@ -4,7 +4,7 @@
 #include <sys/socket.h>
 #include <sys/un.h>
 
-#include "qtest/libqos/libqtest.h"
+#include "../qtest/libqos/libqtest.h"
 #include "qapi/qmp/qdict.h"
 #include "qapi/qmp/qlist.h"
 
diff --git a/tests/test-qgraph.c b/tests/unit/test-qgraph.c
index ae2f7b2dd8..f819430e2c 100644
--- a/tests/test-qgraph.c
+++ b/tests/unit/test-qgraph.c
@@ -17,8 +17,8 @@
  */
 
 #include "qemu/osdep.h"
-#include "qtest/libqos/qgraph.h"
-#include "qtest/libqos/qgraph_internal.h"
+#include "../qtest/libqos/qgraph.h"
+#include "../qtest/libqos/qgraph_internal.h"
 
 #define MACHINE_PC "x86_64/pc"
 #define MACHINE_RASPI2 "arm/raspi2"
diff --git a/tests/test-qht.c b/tests/unit/test-qht.c
index 4d23cefab6..4d23cefab6 100644
--- a/tests/test-qht.c
+++ b/tests/unit/test-qht.c
diff --git a/tests/test-qmp-cmds.c b/tests/unit/test-qmp-cmds.c
index d3413bfef0..d3413bfef0 100644
--- a/tests/test-qmp-cmds.c
+++ b/tests/unit/test-qmp-cmds.c
diff --git a/tests/test-qmp-event.c b/tests/unit/test-qmp-event.c
index 7dd0053190..7dd0053190 100644
--- a/tests/test-qmp-event.c
+++ b/tests/unit/test-qmp-event.c
diff --git a/tests/test-qobject-input-visitor.c b/tests/unit/test-qobject-input-visitor.c
index e41b91a2a6..e41b91a2a6 100644
--- a/tests/test-qobject-input-visitor.c
+++ b/tests/unit/test-qobject-input-visitor.c
diff --git a/tests/test-qobject-output-visitor.c b/tests/unit/test-qobject-output-visitor.c
index 9dc1e075e7..9dc1e075e7 100644
--- a/tests/test-qobject-output-visitor.c
+++ b/tests/unit/test-qobject-output-visitor.c
diff --git a/tests/test-rcu-list.c b/tests/unit/test-rcu-list.c
index 49641e1936..49641e1936 100644
--- a/tests/test-rcu-list.c
+++ b/tests/unit/test-rcu-list.c
diff --git a/tests/test-rcu-simpleq.c b/tests/unit/test-rcu-simpleq.c
index 057f7d33f7..057f7d33f7 100644
--- a/tests/test-rcu-simpleq.c
+++ b/tests/unit/test-rcu-simpleq.c
diff --git a/tests/test-rcu-slist.c b/tests/unit/test-rcu-slist.c
index 868e1e472e..868e1e472e 100644
--- a/tests/test-rcu-slist.c
+++ b/tests/unit/test-rcu-slist.c
diff --git a/tests/test-rcu-tailq.c b/tests/unit/test-rcu-tailq.c
index 8d487e0ee0..8d487e0ee0 100644
--- a/tests/test-rcu-tailq.c
+++ b/tests/unit/test-rcu-tailq.c
diff --git a/tests/test-replication.c b/tests/unit/test-replication.c
index b067240add..b067240add 100644
--- a/tests/test-replication.c
+++ b/tests/unit/test-replication.c
diff --git a/tests/test-shift128.c b/tests/unit/test-shift128.c
index f3ff736e5c..f3ff736e5c 100644
--- a/tests/test-shift128.c
+++ b/tests/unit/test-shift128.c
diff --git a/tests/test-string-input-visitor.c b/tests/unit/test-string-input-visitor.c
index 249faafc9d..249faafc9d 100644
--- a/tests/test-string-input-visitor.c
+++ b/tests/unit/test-string-input-visitor.c
diff --git a/tests/test-string-output-visitor.c b/tests/unit/test-string-output-visitor.c
index e2bedc5c7c..e2bedc5c7c 100644
--- a/tests/test-string-output-visitor.c
+++ b/tests/unit/test-string-output-visitor.c
diff --git a/tests/test-thread-pool.c b/tests/unit/test-thread-pool.c
index 70dc6314a1..70dc6314a1 100644
--- a/tests/test-thread-pool.c
+++ b/tests/unit/test-thread-pool.c
diff --git a/tests/test-throttle.c b/tests/unit/test-throttle.c
index 7adb5e6652..7adb5e6652 100644
--- a/tests/test-throttle.c
+++ b/tests/unit/test-throttle.c
diff --git a/tests/test-timed-average.c b/tests/unit/test-timed-average.c
index 82c92500df..82c92500df 100644
--- a/tests/test-timed-average.c
+++ b/tests/unit/test-timed-average.c
diff --git a/tests/test-util-filemonitor.c b/tests/unit/test-util-filemonitor.c
index b629e10857..b629e10857 100644
--- a/tests/test-util-filemonitor.c
+++ b/tests/unit/test-util-filemonitor.c
diff --git a/tests/test-util-sockets.c b/tests/unit/test-util-sockets.c
index 67486055ed..67486055ed 100644
--- a/tests/test-util-sockets.c
+++ b/tests/unit/test-util-sockets.c
diff --git a/tests/test-uuid.c b/tests/unit/test-uuid.c
index c111de5fc1..c111de5fc1 100644
--- a/tests/test-uuid.c
+++ b/tests/unit/test-uuid.c
diff --git a/tests/test-visitor-serialization.c b/tests/unit/test-visitor-serialization.c
index 4629958647..4629958647 100644
--- a/tests/test-visitor-serialization.c
+++ b/tests/unit/test-visitor-serialization.c
diff --git a/tests/test-vmstate.c b/tests/unit/test-vmstate.c
index a001879585..a001879585 100644
--- a/tests/test-vmstate.c
+++ b/tests/unit/test-vmstate.c
diff --git a/tests/test-write-threshold.c b/tests/unit/test-write-threshold.c
index fc1c45a2eb..fc1c45a2eb 100644
--- a/tests/test-write-threshold.c
+++ b/tests/unit/test-write-threshold.c
diff --git a/tests/test-x86-cpuid.c b/tests/unit/test-x86-cpuid.c
index bfabc0403a..bfabc0403a 100644
--- a/tests/test-x86-cpuid.c
+++ b/tests/unit/test-x86-cpuid.c
diff --git a/tests/test-xbzrle.c b/tests/unit/test-xbzrle.c
index 795d6f1cba..795d6f1cba 100644
--- a/tests/test-xbzrle.c
+++ b/tests/unit/test-xbzrle.c