aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2023-02-20 17:07:30 +0000
committerPeter Maydell <peter.maydell@linaro.org>2023-02-20 17:07:30 +0000
commit0aaf44776e00d9008806a4731a03271f039515a1 (patch)
tree09b1ba122d6c022f156a2a1c0449a4ba2f56c9d0 /tests
parent2d89cb1fe5c778f51b5fdc6878adacdb0d908949 (diff)
parenta6bfdaed4a735a2cf59f265e6955fe2adcc99637 (diff)
downloadqemu-0aaf44776e00d9008806a4731a03271f039515a1.zip
qemu-0aaf44776e00d9008806a4731a03271f039515a1.tar.gz
qemu-0aaf44776e00d9008806a4731a03271f039515a1.tar.bz2
Merge tag 'pull-virtiofs-20230216b' of https://gitlab.com/dagrh/qemu into staging
Remove C virtiofsd We deprecated the C virtiofsd in commit 34deee7b6a1418f3d62a in v7.0 in favour of the Rust implementation at https://gitlab.com/virtio-fs/virtiofsd since then, the Rust version has had more development and has held up well. It's time to say goodbye to the C version that got us going. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCAAdFiEERfXHG0oMt/uXep+pBRYzHrxb/ecFAmPudNkACgkQBRYzHrxb # /ed2ZBAAlz+bjTIoWjJr5/5nSjydd5ucARYDX4n0PI2byVDHFVaUCTIi+rLrxCYs # qnb7HVmQW4y6zy15sM1xsbqSyrVgqvDheAJPWVekkoIuVT1t6wVpAZ7sykwx8U1I # ge2T6pXcc4xKptyGnMAB0v0T5r9hN2Peghg3/KBn6WSD1WM2rD6KmvU4untYOeST # I/KeoEDc4WUHtaPoDIduQlEcxGKJft6ifS0ksL0Jlf06aDg9UXxcuovtN6GtmnD2 # oNPYR0qG6aN4FynTrcVBN38N3cEosdCtEK0kgvbxulnQ4Iwxyi9hBkvUJA3UmjQ/ # THkWa9Gl+bFTGfNFxUEBV+0bBI46MFn2zXmpatPeV6NvKhiaDi4DDUczueUH1+s+ # C5KWYN3LuDznmM2NQzFipG1NtP2tif6wM2dYTOHf62n4UZBSe0xSdM1OKwqKXQnN # w5TPlZEvnaYY7vz2fjDlnLKAD9WxlxvMYjr/eJrrjDPSWGxAoe59q0nXBlzXi1Bl # 6GcCqt/GQpLbY9X2l2pb1bvFOZcPtPZ6CiLBCslKZ5MxmiCvZWnJQ2ZHe9ccQeUX # 22wWB5gkvWz/1bPddQR7JJ48HxBEPRd4aZ93A3jJfZqWCaTaHQ6bZboghVywMbXJ # P0wkwaXsFshcyuZfus/dq61y+jsIVR3EyxxRMxd2rO6Mg6nvTcs= # =0FYt # -----END PGP SIGNATURE----- # gpg: Signature made Thu 16 Feb 2023 18:24:25 GMT # gpg: using RSA key 45F5C71B4A0CB7FB977A9FA90516331EBC5BFDE7 # gpg: Good signature from "Dr. David Alan Gilbert (RH2) <dgilbert@redhat.com>" [full] # Primary key fingerprint: 45F5 C71B 4A0C B7FB 977A 9FA9 0516 331E BC5B FDE7 * tag 'pull-virtiofs-20230216b' of https://gitlab.com/dagrh/qemu: virtiofsd: Swing deprecated message to removed-features virtiofsd: Remove source virtiofsd: Remove build and docs glue virtiofsd: Remove test Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/avocado/virtiofs_submounts.py217
1 files changed, 0 insertions, 217 deletions
diff --git a/tests/avocado/virtiofs_submounts.py b/tests/avocado/virtiofs_submounts.py
deleted file mode 100644
index e6dc32f..0000000
--- a/tests/avocado/virtiofs_submounts.py
+++ /dev/null
@@ -1,217 +0,0 @@
-import logging
-import re
-import os
-import subprocess
-import time
-
-from avocado import skipUnless
-from avocado_qemu import LinuxTest, BUILD_DIR
-from avocado_qemu import has_cmds
-from avocado_qemu import run_cmd
-from avocado_qemu import wait_for_console_pattern
-from avocado.utils import ssh
-
-
-class VirtiofsSubmountsTest(LinuxTest):
- """
- :avocado: tags=arch:x86_64
- :avocado: tags=accel:kvm
- """
-
- def run(self, args, ignore_error=False):
- stdout, stderr, ret = run_cmd(args)
-
- if ret != 0:
- cmdline = ' '.join(args)
- if not ignore_error:
- self.fail(f'{cmdline}: Returned {ret}: {stderr}')
- else:
- self.log.warn(f'{cmdline}: Returned {ret}: {stderr}')
-
- return (stdout, stderr, ret)
-
- def set_up_shared_dir(self):
- self.shared_dir = os.path.join(self.workdir, 'virtiofs-shared')
-
- os.mkdir(self.shared_dir)
-
- self.run(('cp', self.get_data('guest.sh'),
- os.path.join(self.shared_dir, 'check.sh')))
-
- self.run(('cp', self.get_data('guest-cleanup.sh'),
- os.path.join(self.shared_dir, 'cleanup.sh')))
-
- def set_up_virtiofs(self):
- attmp = os.getenv('AVOCADO_TESTS_COMMON_TMPDIR')
- self.vfsdsock = os.path.join(attmp, 'vfsdsock')
-
- self.run(('sudo', '-n', 'rm', '-f', self.vfsdsock), ignore_error=True)
-
- self.virtiofsd = \
- subprocess.Popen(('sudo', '-n',
- 'tools/virtiofsd/virtiofsd',
- f'--socket-path={self.vfsdsock}',
- '-o', f'source={self.shared_dir}',
- '-o', 'cache=always',
- '-o', 'xattr',
- '-o', 'announce_submounts',
- '-f'),
- stdout=subprocess.DEVNULL,
- stderr=subprocess.PIPE,
- universal_newlines=True)
-
- while not os.path.exists(self.vfsdsock):
- if self.virtiofsd.poll() is not None:
- self.fail('virtiofsd exited prematurely: ' +
- self.virtiofsd.communicate()[1])
- time.sleep(0.1)
-
- self.run(('sudo', '-n', 'chmod', 'go+rw', self.vfsdsock))
-
- self.vm.add_args('-chardev',
- f'socket,id=vfsdsock,path={self.vfsdsock}',
- '-device',
- 'vhost-user-fs-pci,queue-size=1024,chardev=vfsdsock' \
- ',tag=host',
- '-object',
- 'memory-backend-file,id=mem,size=1G,' \
- 'mem-path=/dev/shm,share=on',
- '-numa',
- 'node,memdev=mem')
-
- def set_up_nested_mounts(self):
- scratch_dir = os.path.join(self.shared_dir, 'scratch')
- try:
- os.mkdir(scratch_dir)
- except FileExistsError:
- pass
-
- args = ['bash', self.get_data('host.sh'), scratch_dir]
- if self.seed:
- args += [self.seed]
-
- out, _, _ = self.run(args)
- seed = re.search(r'^Seed: \d+', out)
- self.log.info(seed[0])
-
- def mount_in_guest(self):
- self.ssh_command('mkdir -p /mnt/host')
- self.ssh_command('mount -t virtiofs host /mnt/host')
-
- def check_in_guest(self):
- self.ssh_command('bash /mnt/host/check.sh /mnt/host/scratch/share')
-
- def live_cleanup(self):
- self.ssh_command('bash /mnt/host/cleanup.sh /mnt/host/scratch')
-
- # It would be nice if the above was sufficient to make virtiofsd clear
- # all references to the mounted directories (so they can be unmounted
- # on the host), but unfortunately it is not. To do so, we have to
- # resort to a remount.
- self.ssh_command('mount -o remount /mnt/host')
-
- scratch_dir = os.path.join(self.shared_dir, 'scratch')
- self.run(('bash', self.get_data('cleanup.sh'), scratch_dir))
-
- @skipUnless(*has_cmds(('sudo -n', ('sudo', '-n', 'true')),
- 'ssh-keygen', 'bash', 'losetup', 'mkfs.xfs', 'mount'))
- def setUp(self):
- vmlinuz = self.params.get('vmlinuz')
- if vmlinuz is None:
- """
- The Linux kernel supports FUSE auto-submounts only as of 5.10.
- boot_linux.py currently provides Fedora 31, whose kernel is too
- old, so this test cannot pass with the on-image kernel (you are
- welcome to try, hence the option to force such a test with
- -p vmlinuz=''). Therefore, for now the user must provide a
- sufficiently new custom kernel, or effectively explicitly
- request failure with -p vmlinuz=''.
- Once an image with a sufficiently new kernel is available
- (probably Fedora 34), we can make -p vmlinuz='' the default, so
- that this parameter no longer needs to be specified.
- """
- self.cancel('vmlinuz parameter not set; you must point it to a '
- 'Linux kernel binary to test (to run this test with ' \
- 'the on-image kernel, set it to an empty string)')
-
- self.seed = self.params.get('seed')
-
- self.ssh_key = os.path.join(self.workdir, 'id_ed25519')
-
- self.run(('ssh-keygen', '-N', '', '-t', 'ed25519', '-f', self.ssh_key))
-
- pubkey = self.ssh_key + '.pub'
-
- super(VirtiofsSubmountsTest, self).setUp(pubkey)
-
- if vmlinuz:
- self.vm.add_args('-kernel', vmlinuz,
- '-append', 'console=ttyS0 root=/dev/sda1')
-
- self.require_accelerator("kvm")
- self.vm.add_args('-accel', 'kvm')
-
- def tearDown(self):
- try:
- self.vm.shutdown()
- except:
- pass
-
- scratch_dir = os.path.join(self.shared_dir, 'scratch')
- self.run(('bash', self.get_data('cleanup.sh'), scratch_dir),
- ignore_error=True)
-
- def test_pre_virtiofsd_set_up(self):
- self.set_up_shared_dir()
-
- self.set_up_nested_mounts()
-
- self.set_up_virtiofs()
- self.launch_and_wait()
- self.mount_in_guest()
- self.check_in_guest()
-
- def test_pre_launch_set_up(self):
- self.set_up_shared_dir()
- self.set_up_virtiofs()
-
- self.set_up_nested_mounts()
-
- self.launch_and_wait()
- self.mount_in_guest()
- self.check_in_guest()
-
- def test_post_launch_set_up(self):
- self.set_up_shared_dir()
- self.set_up_virtiofs()
- self.launch_and_wait()
-
- self.set_up_nested_mounts()
-
- self.mount_in_guest()
- self.check_in_guest()
-
- def test_post_mount_set_up(self):
- self.set_up_shared_dir()
- self.set_up_virtiofs()
- self.launch_and_wait()
- self.mount_in_guest()
-
- self.set_up_nested_mounts()
-
- self.check_in_guest()
-
- def test_two_runs(self):
- self.set_up_shared_dir()
-
- self.set_up_nested_mounts()
-
- self.set_up_virtiofs()
- self.launch_and_wait()
- self.mount_in_guest()
- self.check_in_guest()
-
- self.live_cleanup()
- self.set_up_nested_mounts()
-
- self.check_in_guest()