iotests: Skip read-only cases in 118 when run as root
authorKevin Wolf <kwolf@redhat.com>
Fri, 18 Oct 2019 11:46:42 +0000 (13:46 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 25 Oct 2019 13:15:01 +0000 (15:15 +0200)
commitd926f4ddd284d8d9566937e4deff65f8284db09f
treefb7c0ad23315d5cc3d9dcb914c8bd47e51fcac22
parent35e32d9e2e8a1128dba75531aa763108c06f25f4
iotests: Skip read-only cases in 118 when run as root

Some tests in 118 use chmod to remove write permissions from the file
and assume that the image can indeed not be opened read-write
afterwards. This doesn't work when the test is run as root, because root
can still open the file as writable even when the permission bit isn't
set.

Introduce a @skip_if_root decorator and use it in 118 to skip the tests
in question when the script is run as root.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
tests/qemu-iotests/118
tests/qemu-iotests/iotests.py