tests/acceptance: Add virtiofs_submounts.py
commitc93a656f7b6585d9b6f8639d1fbb74dd944be239
authorMax Reitz <mreitz@redhat.com>
Wed, 9 Sep 2020 18:40:28 +0000 (9 20:40 +0200)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Mon, 26 Oct 2020 18:35:32 +0000 (26 18:35 +0000)
tree93642fb3664aa39e161f0cedfd99f0a1cfe631c3
parent45ced7ca2f2767c046fb1b9980ba938ad526262e
tests/acceptance: Add virtiofs_submounts.py

This test invokes several shell scripts to create a random directory
tree full of submounts, and then check in the VM whether every submount
has its own ID and the structure looks as expected.

(Note that the test scripts must be non-executable, so Avocado will not
try to execute them as if they were tests on their own, too.)

Because at this commit's date it is unlikely that the Linux kernel on
the image provided by boot_linux.py supports submounts in virtio-fs, the
test will be cancelled if no custom Linux binary is provided through the
vmlinuz parameter.  (The on-image kernel can be used by providing an
empty string via vmlinuz=.)

So, invoking the test can be done as follows:
$ avocado run \
    tests/acceptance/virtiofs_submounts.py \
    -p vmlinuz=/path/to/linux/build/arch/x86/boot/bzImage

This test requires root privileges (through passwordless sudo -n),
because at this point, virtiofsd requires them.  (If you have a
timestamp_timeout period for sudoers (e.g. the default of 5 min), you
can provide this by executing something like "sudo true" before invoking
Avocado.)

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20200909184028.262297-9-mreitz@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
tests/acceptance/virtiofs_submounts.py [new file with mode: 0644]
tests/acceptance/virtiofs_submounts.py.data/cleanup.sh [new file with mode: 0644]
tests/acceptance/virtiofs_submounts.py.data/guest-cleanup.sh [new file with mode: 0644]
tests/acceptance/virtiofs_submounts.py.data/guest.sh [new file with mode: 0644]
tests/acceptance/virtiofs_submounts.py.data/host.sh [new file with mode: 0644]