From fd7fc65916615ebd217a4cdaad575aa0ebf53c32 Mon Sep 17 00:00:00 2001 From: Jinen Gandhi Date: Tue, 23 Feb 2021 15:35:10 +0530 Subject: [PATCH] Adding LTP test suite to run with SGX Signed-off-by: Jinen Gandhi --- .ci/lib/stage-test-sgx.jenkinsfile | 19 +++++++++++++++++++ .gitmodules | 1 + LibOS/shim/test/ltp/ltp-bug-1075.cfg | 12 ------------ LibOS/shim/test/ltp/ltp-sgx.cfg | 18 ++++++++++++++++++ LibOS/shim/test/ltp/ltp.cfg | 4 +++- 5 files changed, 41 insertions(+), 13 deletions(-) diff --git a/.ci/lib/stage-test-sgx.jenkinsfile b/.ci/lib/stage-test-sgx.jenkinsfile index ff2170cd5d..431d7a7e21 100644 --- a/.ci/lib/stage-test-sgx.jenkinsfile +++ b/.ci/lib/stage-test-sgx.jenkinsfile @@ -1,4 +1,23 @@ stage('test-sgx') { + timeout(time: 45, unit: 'MINUTES') { + try { + sh ''' + cd LibOS/shim/test/ltp + + # To run LTP tests with SGX and work around the mmap issue, which + # is basically that LTP uses shared memory that isn't + # supported on SGX, as a workaround we changed the mmap flag + # from MAP_SHARED to MAP_PRIVATE inside the LTP framework. + sed -i 's/MAP_SHARED/MAP_PRIVATE/g' src/lib/tst_test.c + + make ${MAKEOPTS} all sgx-tokens + make ltp-sgx.xml + ''' + } finally { + archiveArtifacts 'LibOS/shim/test/ltp/ltp-sgx.xml' + junit 'LibOS/shim/test/ltp/ltp-sgx.xml' + } + } timeout(time: 5, unit: 'MINUTES') { sh ''' cd Examples/python-simple diff --git a/.gitmodules b/.gitmodules index 27e6d54987..a4ec7e43f3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ [submodule "LibOS/shim/test/ltp/src"] path = LibOS/shim/test/ltp/src url = https://github.com/linux-test-project/ltp.git + ignore = dirty diff --git a/LibOS/shim/test/ltp/ltp-bug-1075.cfg b/LibOS/shim/test/ltp/ltp-bug-1075.cfg index 84619238bf..b8472d5d62 100644 --- a/LibOS/shim/test/ltp/ltp-bug-1075.cfg +++ b/LibOS/shim/test/ltp/ltp-bug-1075.cfg @@ -25,12 +25,6 @@ skip = yes [add_key04] skip = yes -[chmod03] -skip = yes - -[chmod04] -skip = yes - [chmod05] skip = yes @@ -76,12 +70,6 @@ skip = yes [dirtyc0w] skip = yes -[epoll_wait01] -skip = yes - -[epoll_wait03] -skip = yes - [execl01] skip = yes diff --git a/LibOS/shim/test/ltp/ltp-sgx.cfg b/LibOS/shim/test/ltp/ltp-sgx.cfg index b0827e87b0..5c0be3e4d5 100644 --- a/LibOS/shim/test/ltp/ltp-sgx.cfg +++ b/LibOS/shim/test/ltp/ltp-sgx.cfg @@ -38,6 +38,18 @@ skip = yes [brk01] timeout = 60 +[chmod03] +skip = yes + +[chmod04] +skip = yes + +[epoll_wait01] +skip = yes + +[epoll_wait03] +skip = yes + [fork06] skip = yes @@ -96,6 +108,9 @@ skip = yes [kill09] timeout = 80 +[kill11] +skip = yes + [madvise01] skip = yes @@ -324,6 +339,9 @@ skip = yes [sethostname03] skip = yes +[setrlimit01] +skip = yes + [setrlimit02] skip = yes diff --git a/LibOS/shim/test/ltp/ltp.cfg b/LibOS/shim/test/ltp/ltp.cfg index f3351fa05a..ca08837d64 100644 --- a/LibOS/shim/test/ltp/ltp.cfg +++ b/LibOS/shim/test/ltp/ltp.cfg @@ -1087,6 +1087,9 @@ skip = yes [mkdir05A] skip = yes +[mkdir09] +skip = yes + [mkdirat02] skip = yes @@ -2024,7 +2027,6 @@ skip = yes [sendfile06_64] skip = yes - [sendfile07] skip = yes