From ffe2366bebd7ef551accadbfcada5e45bc5af9e3 Mon Sep 17 00:00:00 2001 From: Chia-Che Tsai Date: Tue, 27 Aug 2019 10:59:21 -0500 Subject: [PATCH] [LibOS] test/apps: Rewrite Python example There are two Python3 examples now: - python-simple contains simple and secure Python3 scripts; - python-scipy-insecure contains SciPy and NumPy insecure Python3 scripts. Both examples are tested in Jenkins. --- Jenkinsfiles/Linux | 13 ++++++++++--- Jenkinsfiles/Linux-18.04 | 10 ++++++++-- Jenkinsfiles/Linux-Debug | 13 ++++++++++--- Jenkinsfiles/Linux-Debug-18.04 | 10 ++++++++-- Jenkinsfiles/Linux-SGX | 16 ++++++++++++---- Jenkinsfiles/Linux-SGX-18.04 | 19 +++++++++++++------ Jenkinsfiles/ubuntu-16.04.dockerfile | 7 ++++++- Jenkinsfiles/ubuntu-18.04.dockerfile | 7 ++++++- LibOS/shim/test/apps | 2 +- 9 files changed, 74 insertions(+), 23 deletions(-) diff --git a/Jenkinsfiles/Linux b/Jenkinsfiles/Linux index 9fd93ce4..dba48d69 100644 --- a/Jenkinsfiles/Linux +++ b/Jenkinsfiles/Linux @@ -37,8 +37,14 @@ pipeline { ''' timeout(time: 5, unit: 'MINUTES') { sh ''' - cd LibOS/shim/test/apps/python - make regression + cd LibOS/shim/test/apps/python-simple + make check + ''' + } + timeout(time: 5, unit: 'MINUTES') { + sh ''' + cd LibOS/shim/test/apps/python-scipy-insecure + make check ''' } sh ''' @@ -85,7 +91,8 @@ pipeline { rm -rf /tmp/graphene.clean-check.clean/LibOS/shim/test/apps/ltp/src rm -rf LibOS/shim/test/apps/ltp/src - make -C LibOS/shim/test/apps/python clean + make -C LibOS/shim/test/apps/python-simple clean + make -C LibOS/shim/test/apps/python-scipy-insecure clean make -C LibOS/shim/test/apps/bash clean make -C LibOS/shim/test/apps/gcc clean make -C LibOS/shim/test/apps/lmbench clean diff --git a/Jenkinsfiles/Linux-18.04 b/Jenkinsfiles/Linux-18.04 index 5fbe6317..eef3fa8b 100644 --- a/Jenkinsfiles/Linux-18.04 +++ b/Jenkinsfiles/Linux-18.04 @@ -31,8 +31,14 @@ pipeline { ''' timeout(time: 5, unit: 'MINUTES') { sh ''' - cd LibOS/shim/test/apps/python - make regression + cd LibOS/shim/test/apps/python-simple + PYTHONVERSION=python3.6 make check + ''' + } + timeout(time: 5, unit: 'MINUTES') { + sh ''' + cd LibOS/shim/test/apps/python-scipy-insecure + PYTHONVERSION=python3.6 make check ''' } sh ''' diff --git a/Jenkinsfiles/Linux-Debug b/Jenkinsfiles/Linux-Debug index 4fbc89e9..e402e9e2 100644 --- a/Jenkinsfiles/Linux-Debug +++ b/Jenkinsfiles/Linux-Debug @@ -33,8 +33,14 @@ pipeline { ''' timeout(time: 5, unit: 'MINUTES') { sh ''' - cd LibOS/shim/test/apps/python - make regression + cd LibOS/shim/test/apps/python-simple + make check + ''' + } + timeout(time: 5, unit: 'MINUTES') { + sh ''' + cd LibOS/shim/test/apps/python-scipy-insecure + make check ''' } sh ''' @@ -79,7 +85,8 @@ pipeline { rm -rf /tmp/graphene-debug.clean-check.clean/LibOS/shim/test/apps/ltp/src rm -rf LibOS/shim/test/apps/ltp/src - make -C LibOS/shim/test/apps/python clean + make -C LibOS/shim/test/apps/python-simple clean + make -C LibOS/shim/test/apps/python-scipy-insecure clean make -C LibOS/shim/test/apps/bash clean make -C LibOS/shim/test/apps/gcc clean make -C LibOS/shim/test/apps/lmbench clean diff --git a/Jenkinsfiles/Linux-Debug-18.04 b/Jenkinsfiles/Linux-Debug-18.04 index 2638af72..c1dedc93 100644 --- a/Jenkinsfiles/Linux-Debug-18.04 +++ b/Jenkinsfiles/Linux-Debug-18.04 @@ -28,8 +28,14 @@ pipeline { ''' timeout(time: 5, unit: 'MINUTES') { sh ''' - cd LibOS/shim/test/apps/python - make regression + cd LibOS/shim/test/apps/python-simple + PYTHONVERSION=python3.6 make check + ''' + } + timeout(time: 5, unit: 'MINUTES') { + sh ''' + cd LibOS/shim/test/apps/python-scipy-insecure + PYTHONVERSION=python3.6 make check ''' } sh ''' diff --git a/Jenkinsfiles/Linux-SGX b/Jenkinsfiles/Linux-SGX index 2fa79cae..7511c931 100644 --- a/Jenkinsfiles/Linux-SGX +++ b/Jenkinsfiles/Linux-SGX @@ -67,9 +67,16 @@ pipeline { timeout(time: 5, unit: 'MINUTES') { sh ''' - cd LibOS/shim/test/apps/python - make SGX=1 all sgx-tokens - make SGX=1 regression + cd LibOS/shim/test/apps/python-simple + make SGX=1 + make SGX=1 check + ''' + } + timeout(time: 5, unit: 'MINUTES') { + sh ''' + cd LibOS/shim/test/apps/python-scipy-insecure + make SGX=1 + make SGX=1 check ''' } timeout(time: 5, unit: 'MINUTES') { @@ -120,7 +127,8 @@ pipeline { rm -rf /tmp/graphene-sgx.clean-check.clean/LibOS/shim/test/apps/ltp/src rm -rf LibOS/shim/test/apps/ltp/src - make -C LibOS/shim/test/apps/python SGX=1 clean + make -C LibOS/shim/test/apps/python-simple SGX=1 clean + make -C LibOS/shim/test/apps/python-scipy-insecure SGX=1 clean make -C LibOS/shim/test/apps/bash SGX=1 clean make -C LibOS/shim/test/apps/gcc SGX=1 clean make -C LibOS/shim/test/apps/lmbench SGX=1 clean diff --git a/Jenkinsfiles/Linux-SGX-18.04 b/Jenkinsfiles/Linux-SGX-18.04 index 5d6c3edd..4cbb8c54 100644 --- a/Jenkinsfiles/Linux-SGX-18.04 +++ b/Jenkinsfiles/Linux-SGX-18.04 @@ -64,18 +64,25 @@ pipeline { timeout(time: 5, unit: 'MINUTES') { sh ''' - cd LibOS/shim/test/apps/python - make SGX=1 all sgx-tokens - make SGX=1 regression + cd LibOS/shim/test/apps/python-simple + PYTHONVERSION=python3.6 make SGX=1 + PYTHONVERSION=python3.6 make SGX=1 check ''' - } - timeout(time: 5, unit: 'MINUTES') { + } + timeout(time: 5, unit: 'MINUTES') { + sh ''' + cd LibOS/shim/test/apps/python-scipy-insecure + PYTHONVERSION=python3.6 make SGX=1 + PYTHONVERSION=python3.6 make SGX=1 check + ''' + } + timeout(time: 5, unit: 'MINUTES') { sh ''' cd LibOS/shim/test/apps/bash make SGX=1 all make SGX=1 regression ''' - } + } timeout(time: 10, unit: 'MINUTES') { sh ''' cd LibOS/shim/test/apps/gcc diff --git a/Jenkinsfiles/ubuntu-16.04.dockerfile b/Jenkinsfiles/ubuntu-16.04.dockerfile index bcf3afed..31ff0105 100644 --- a/Jenkinsfiles/ubuntu-16.04.dockerfile +++ b/Jenkinsfiles/ubuntu-16.04.dockerfile @@ -17,6 +17,7 @@ RUN apt-get update \ libaprutil1-dev \ libexpat1 \ libexpat1-dev \ + libnss-mdns \ libomp-dev \ libpcre2-dev \ libpcre3-dev \ @@ -26,10 +27,14 @@ RUN apt-get update \ net-tools \ protobuf-c-compiler \ python \ - python3-minimal \ + python3-apport \ + python3-apt \ python3-lxml \ + python3-minimal \ + python3-numpy \ python3-pip \ python3-pytest \ + python3-scipy \ texinfo \ wget \ && /usr/bin/pip3 install protobuf \ diff --git a/Jenkinsfiles/ubuntu-18.04.dockerfile b/Jenkinsfiles/ubuntu-18.04.dockerfile index cb3373e7..0a6d1498 100644 --- a/Jenkinsfiles/ubuntu-18.04.dockerfile +++ b/Jenkinsfiles/ubuntu-18.04.dockerfile @@ -17,6 +17,7 @@ RUN apt-get update && env DEBIAN_FRONTEND=noninteractive apt-get install -y \ libelf-dev \ libexpat1 \ libexpat1-dev \ + libnss-mdns \ libomp-dev \ libpcre2-dev \ libpcre3-dev \ @@ -26,11 +27,15 @@ RUN apt-get update && env DEBIAN_FRONTEND=noninteractive apt-get install -y \ net-tools \ protobuf-c-compiler \ python \ + python3-apport \ + python3-apt \ python3-breathe \ + python3-lxml \ + python3-numpy \ python3-pip \ python3-protobuf \ python3-pytest \ - python3-lxml \ + python3-scipy \ texinfo \ wget diff --git a/LibOS/shim/test/apps b/LibOS/shim/test/apps index d195eb0f..78426edb 160000 --- a/LibOS/shim/test/apps +++ b/LibOS/shim/test/apps @@ -1 +1 @@ -Subproject commit d195eb0fdec2c5560fb4c85ef2943db6d30a4916 +Subproject commit 78426edb2c1fd3d06de3e465445f83218d1fd9ac