Browse Source

[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.
Chia-Che Tsai 5 years ago
parent
commit
ffe2366beb

+ 10 - 3
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

+ 8 - 2
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 '''

+ 10 - 3
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

+ 8 - 2
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 '''

+ 12 - 4
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

+ 13 - 6
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

+ 6 - 1
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 \

+ 6 - 1
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
 

+ 1 - 1
LibOS/shim/test/apps

@@ -1 +1 @@
-Subproject commit d195eb0fdec2c5560fb4c85ef2943db6d30a4916
+Subproject commit 78426edb2c1fd3d06de3e465445f83218d1fd9ac