From 41e62ae98294469c86daea25d470679c54e9c9b8 Mon Sep 17 00:00:00 2001 From: Qi Zheng Date: Fri, 29 Dec 2023 16:57:54 +0800 Subject: [PATCH] [demos] Update Linux LTP test demo --- .github/workflows/code_coverage.yaml | 2 +- .github/workflows/demo_test.yml | 2 +- demos/linux-ltp/README.md | 9 +++++++-- demos/linux-ltp/prepare_ltp.sh | 6 +++--- demos/linux-ltp/syscalls-occlum | 24 ++++++++++++------------ 5 files changed, 24 insertions(+), 19 deletions(-) diff --git a/.github/workflows/code_coverage.yaml b/.github/workflows/code_coverage.yaml index c506d297..98fb4f33 100644 --- a/.github/workflows/code_coverage.yaml +++ b/.github/workflows/code_coverage.yaml @@ -98,7 +98,7 @@ jobs: - name: LTP test run: docker exec code_coverage bash -c "cd /root/occlum/demos/linux-ltp && ./dl_and_build_ltp.sh && SGX_MODE=SIM ./prepare_ltp.sh; - cd ltp_instance; + cd occlum_instance; occlum run /opt/ltp/run-ltp.sh -f syscalls-occlum; cd /root/occlum/demos && rm -rf ./linux-ltp" diff --git a/.github/workflows/demo_test.yml b/.github/workflows/demo_test.yml index d12b846f..fcae7100 100644 --- a/.github/workflows/demo_test.yml +++ b/.github/workflows/demo_test.yml @@ -1144,7 +1144,7 @@ jobs: run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/linux-ltp && SGX_MODE=SIM ./prepare_ltp.sh" - name: Run the LTP demo - run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/linux-ltp/ltp_instance; + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/linux-ltp/occlum_instance; occlum run /opt/ltp/run-ltp.sh -f syscalls-occlum" - name: Clean LTP test diff --git a/demos/linux-ltp/README.md b/demos/linux-ltp/README.md index c09e8dc4..6aad32a5 100644 --- a/demos/linux-ltp/README.md +++ b/demos/linux-ltp/README.md @@ -18,7 +18,7 @@ Some test cases are failed due to multiple reasons, such as syscall is not imple * Some default LTP test cases may make the Occlum crash or hang (Only checked the cases in syscalls for now). * Occlum runable syscall test cases are defined in [`syscalls-occlum`](./syscalls-occlum). It may be updated with Occlum development. -The original [`syscalls`] test cases could be found in the built demo `ltp_instance/image/opt/ltp/runtest/syscalls`. +The original [`syscalls`] test cases could be found in the built demo `occlum_instance/image/opt/ltp/runtest/syscalls`. Panic/Sefault/hang testcases could be listed by a simple diff for these two files. ## Prepare the Occlum instance for LTP demo @@ -39,8 +39,13 @@ The script `run-ltp.sh` supports two optional arguments as below. example: run-ltp.sh -f syscalls-occlum -s timerfd ``` +To run in Occlum, use the following command. +``` +occlum run /opt/ltp/run-ltp.sh -f syscalls-occlum -s timerfd +``` + If no options provided, all the test cases in default LTP syscalls will be run one by one. Note: -* The `CMDFILES` are defined in the LTP install path, such as `ltp_instance/image/opt/ltp/runtest/` in this demo. +* The `CMDFILES` are defined in the LTP install path, such as `occlum_instance/image/opt/ltp/runtest/` in this demo. diff --git a/demos/linux-ltp/prepare_ltp.sh b/demos/linux-ltp/prepare_ltp.sh index 7bf58535..1219adf7 100755 --- a/demos/linux-ltp/prepare_ltp.sh +++ b/demos/linux-ltp/prepare_ltp.sh @@ -1,10 +1,10 @@ #! /bin/bash set -e -rm -rf ltp_instance -occlum new ltp_instance +rm -rf occlum_instance +occlum new occlum_instance -cd ltp_instance +cd occlum_instance rm -rf image copy_bom -f ../ltp.yaml --root image --include-dir /opt/occlum/etc/template diff --git a/demos/linux-ltp/syscalls-occlum b/demos/linux-ltp/syscalls-occlum index 3b41456b..b3246bb3 100644 --- a/demos/linux-ltp/syscalls-occlum +++ b/demos/linux-ltp/syscalls-occlum @@ -1004,8 +1004,8 @@ preadv03_64 preadv03_64 preadv201 preadv201 preadv201_64 preadv201_64 -preadv202 preadv202 -preadv202_64 preadv202_64 +# preadv202 preadv202 +# preadv202_64 preadv202_64 preadv203 preadv203 preadv203_64 preadv203_64 @@ -1052,15 +1052,15 @@ pwrite04_64 pwrite04_64 pwritev01 pwritev01 pwritev01_64 pwritev01_64 -# pwritev02 pwritev02 -# pwritev02_64 pwritev02_64 +pwritev02 pwritev02 +pwritev02_64 pwritev02_64 pwritev03 pwritev03 pwritev03_64 pwritev03_64 pwritev201 pwritev201 pwritev201_64 pwritev201_64 -pwritev202 pwritev202 -pwritev202_64 pwritev202_64 +# pwritev202 pwritev202 +# pwritev202_64 pwritev202_64 quotactl01 quotactl01 quotactl02 quotactl02 @@ -1090,7 +1090,7 @@ readlinkat01 readlinkat01 readlinkat02 readlinkat02 readv01 readv01 -readv02 readv02 +# readv02 readv02 realpath01 realpath01 @@ -1695,12 +1695,12 @@ write02 write02 write04 write04 #write05 write05 -#writev01 writev01 -#writev02 writev02 +writev01 writev01 +# writev02 writev02 writev03 writev03 -#writev05 writev05 +# writev05 writev05 writev06 writev06 -#writev07 writev07 +# writev07 writev07 perf_event_open01 perf_event_open01 perf_event_open02 perf_event_open02 @@ -1729,7 +1729,7 @@ copy_file_range03 copy_file_range03 statx01 statx01 statx02 statx02 -statx03 statx03 +# statx03 statx03 statx04 statx04 statx05 statx05 statx06 statx06