From 89b5dabf8d1797e3875d949b6e2a903a5703be5c Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Mon, 11 Feb 2019 16:43:53 +0100 Subject: [PATCH] tests: skip test-relabel.pl when selinuxrelabel is not available test-relabel.pl performs a full SELinux relabelling of the phony guest, and the selinux_relabel API does not work if the "selinuxrelabel" feature is not available. --- tests/relabel/test-relabel.pl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/relabel/test-relabel.pl b/tests/relabel/test-relabel.pl index 744d1f5ec..06fb0840b 100755 --- a/tests/relabel/test-relabel.pl +++ b/tests/relabel/test-relabel.pl @@ -51,6 +51,13 @@ unless ($g->feature_available (["linuxxattrs"])) { exit 77 } +# If SELinux relabelling is not available then we cannot test this. +unless ($g->feature_available (["selinuxrelabel"])) { + print "$prog: test skipped because 'selinuxrelabel' feature not available.\n"; + $g->close (); + exit 77 +} + $g->part_disk ("/dev/sda", "mbr"); $g->mkfs ("ext4", "/dev/sda1");