Skip to content

Commit

Permalink
tests/nfs_filesystem: comment out failing mount
Browse files Browse the repository at this point in the history
For reasons unclear, we attempt to mount twice, the 2nd time yields EBUSY,
and then the following test fails. Comment out the 2nd mount, which also
resolves the failure.

This bug is tracked in
#92

Before:
Run NFS context specific tests
nfs_filesystem/test .. 2/56 creat(2) Failed: Permission denied

#   Failed test at nfs_filesystem/test line 118.
nfs_filesystem/test .. 30/56 creat(2) Failed: Permission denied

#   Failed test at nfs_filesystem/test line 118.
nfs_filesystem/test .. 53/56 # Looks like you failed 2 tests of 56.
nfs_filesystem/test .. Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/56 subtests

Test Summary Report
-------------------
nfs_filesystem/test (Wstat: 512 (exited 2) Tests: 56 Failed: 2)
  Failed tests:  7, 35
  Non-zero exit status: 2
Files=1, Tests=56, 12 wallclock secs ( 0.02 usr  0.00 sys +  0.15 cusr  0.25 csys =  0.42 CPU)
Result: FAIL
Failed 1/1 test programs. 2/56 subtests failed.
Error on line: 104 - Closing down NFS
umount: /mnt/selinux-testsuite: not mounted.
NFS Closed down

After:
No errors from this test script.

Signed-off-by: Stephen Smalley <[email protected]>
Signed-off-by: Ondrej Mosnacek <[email protected]>
  • Loading branch information
stephensmalley authored and WOnder93 committed Jun 3, 2024
1 parent 7738f9f commit 0815abc
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions tests/nfs_filesystem/test
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ BEGIN {
$v = " ";
}

plan tests => 56;
# A test (called twice) is commented out because it does not work
# for any known kernel.
# See https://github.com/SELinuxProject/selinux-testsuite/issues/92
#plan tests => 56;
plan tests => 54;
}

# Set for testing mount(2) on first run
Expand Down Expand Up @@ -100,16 +104,19 @@ while ( $i < 2 ) {
);
ok( $result eq 0, $test_msg );

# First mount(2) ok, second currently fails with EBUSY
$result = system(
"runcon -t test_filesystem_t $mount_cmd $v -s $dev -t $target -f $fs_type -o $mount_opts 2>&1"
);
if ( $i eq 0 and $result >> 8 eq 16 ) {
ok( 1, "$test_msg - returned EBUSY, possible bug/feature" );
}
else {
ok( $result eq 0 );
}
# The following test is commented out because it does not work
# for any known kernel.
# See https://github.com/SELinuxProject/selinux-testsuite/issues/92
# First mount(2) ok, second currently fails with EBUSY
# $result = system(
# "runcon -t test_filesystem_t $mount_cmd $v -s $dev -t $target -f $fs_type -o $mount_opts 2>&1"
# );
# if ( $i eq 0 and $result >> 8 eq 16 ) {
# ok( 1, "$test_msg - returned EBUSY, possible bug/feature" );
# }
# else {
# ok( $result eq 0 );
# }

# Create file and change context via type_transition rule, check ok:
$result = system(
Expand Down

0 comments on commit 0815abc

Please sign in to comment.