Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

Commit

Permalink
[LibOS] regression: Skip mmap test case when SGX=1
Browse files Browse the repository at this point in the history
This test case passes without EDMM as all the enclave pages
are already EADDed but with EDMM, a SIGBUS is generated since
pages are only added when needed. Since SIGBUS isn't
implemented correctly for lack of memory protection, skipping
the mmap test case. Also, updated the mmap test case to remove
default default signal handler.

Signed-off-by: Vijay Dhanraj <[email protected]>
  • Loading branch information
vijaydhanraj committed Mar 5, 2021
1 parent 1fc6ffa commit dcb0a9d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
5 changes: 0 additions & 5 deletions LibOS/shim/test/regression/mmap_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,5 @@ int main(int argc, const char** argv) {
__asm__ volatile("nop" ::: "memory");
a[page_size] = 0xff;

if (signal(SIGBUS, SIG_DFL) == SIG_ERR) {
perror("signal");
return 1;
}

return 0;
}
13 changes: 4 additions & 9 deletions LibOS/shim/test/regression/test_libos.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,10 @@ def test_043_futex_wake_op(self):

self.assertIn('Test successful!', stdout)

def test_050_mmap(self):
@unittest.skipIf(HAS_SGX,
'On SGX, SIGBUS isn\'t always implemented correctly, for lack '
'of memory protection. For now, some of these cases won\'t work.')
def test_051_mmap_sgx(self):
stdout, _ = self.run_binary(['mmap_file'], timeout=60)

# Private mmap beyond file range
Expand All @@ -409,14 +412,6 @@ def test_050_mmap(self):
self.assertIn('mmap test 3 passed', stdout)
self.assertIn('mmap test 4 passed', stdout)

# "test 5" and "test 8" are checked below, in test_051_mmap_sgx

@unittest.skipIf(HAS_SGX,
'On SGX, SIGBUS isn\'t always implemented correctly, for lack '
'of memory protection. For now, some of these cases won\'t work.')
def test_051_mmap_sgx(self):
stdout, _ = self.run_binary(['mmap_file'], timeout=60)

# SIGBUS test
self.assertIn('mmap test 5 passed', stdout)
self.assertIn('mmap test 8 passed', stdout)
Expand Down

0 comments on commit dcb0a9d

Please sign in to comment.