Skip to content

Commit a9102fe

Browse files
tests/mac_admin: disable test of getting undefined label on nfs
We already had a workaround in the test script to expect a different result on NFS to the unique aspects of labeled NFS, but this workaround won't work when/if SELinux namespaces are enabled (due to the introduction of the global SID table and its correct preservation of the original context value) and was really only papering over the lack of support. Just disable this particular test when run on NFS filesystems. Signed-off-by: Stephen Smalley <[email protected]>
1 parent 69f0226 commit a9102fe

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

tests/mac_admin/test

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@ BEGIN {
77
$basedir =~ s|(.*)/[^/]*|$1|;
88

99
$isnfs = `stat -f --print %T $basedir`;
10-
11-
plan tests => 8;
10+
if ( $isnfs ne "nfs" ) {
11+
plan tests => 8;
12+
}
13+
else {
14+
plan tests => 7;
15+
}
1216
}
1317

1418
# Verify that test_mac_admin_t can relabel a file to an undefined context.
@@ -38,15 +42,14 @@ $result = system(
3842
);
3943
ok( $result, 0 ); # we expect this to succeed.
4044

41-
# Verify that test_mac_admin_t sees the undefined label value.
42-
$result = `runcon -t test_mac_admin_t -- secon -t -f $basedir/test_dir 2>&1`;
43-
chomp($result);
4445
if ( $isnfs ne "nfs" ) {
46+
47+
# Verify that test_mac_admin_t sees the undefined label value.
48+
$result =
49+
`runcon -t test_mac_admin_t -- secon -t -f $basedir/test_dir 2>&1`;
50+
chomp($result);
4551
ok( $result, "UNDEFINED" );
4652
}
47-
else {
48-
ok( $result, "unlabeled_t" );
49-
}
5053

5154
# Verify that test_no_mac_admin_t sees the unlabeled context.
5255
$result = `runcon -t test_no_mac_admin_t -- secon -t -f $basedir/test_dir 2>&1`;

0 commit comments

Comments
 (0)