Browse Source

Migrate unit tests to jenkins (#122)

* Migrate running unit tests for Linux host to Jenkins.  Add a unit test for the Linux host, Debug build

* Ignore files generated as part of unit testsing.

* A quick and dirty fix for port collisions during CI tests.  Come back and do a better job if we continue having problems

* For some reason, the PAL Process regression tests fail using the default manifest under a debug build.  Go ahead and explicate a template for the Process test.
Don Porter 4 years ago
parent
commit
ce49dcb03d

+ 0 - 3
.travis.yml

@@ -9,9 +9,6 @@ before_script:
 
 script:
   - make 
-  - cd $TRAVIS_BUILD_DIR/Pal/regression && make regression
-  - cd $TRAVIS_BUILD_DIR/LibOS/shim/test/regression && make regression
-  - cd $TRAVIS_BUILD_DIR/LibOS/shim/test/apps/ltp && make regression
   - cd $TRAVIS_BUILD_DIR/Pal/src && make clean && make SGX=1
   - cd $TRAVIS_BUILD_DIR/Pal/src && make clean && make DEBUG=1
   - cd $TRAVIS_BUILD_DIR/Pal/src && make clean && make SGX=1 DEBUG=1

+ 1 - 1
Jenkinsfiles/Jenkinsfile → Jenkinsfiles/Linux

@@ -4,7 +4,7 @@ pipeline {
                 stage('Build') {
                     steps {
                         sh '''
-                            make
+                            make clean && make
                            '''
                     }
                 }

+ 70 - 0
Jenkinsfiles/Linux-Debug

@@ -0,0 +1,70 @@
+pipeline {
+        agent any
+        stages {
+                stage('Build') {
+                    steps {
+                        sh '''
+                            make clean && make DEBUG=1
+                           '''
+                    }
+                }
+                stage('Test') {
+                    steps {
+                        sh '''
+                            cd LibOS/shim/test/apps/gcc
+                            make regression
+                           '''
+                        sh '''
+                            cd LibOS/shim/test/apps/lmbench
+                            make regression
+                            '''
+                        sh '''
+                            cd LibOS/shim/test/apps/python
+                            make regression
+                            '''
+                        sh '''
+                            cd LibOS/shim/test/apps/lighttpd
+                            make
+                            make start-graphene-server &
+                            ./benchmark-http.sh 127.0.0.1:8000
+                            '''
+                        sh '''
+                            cd LibOS/shim/test/apps/apache
+                            make
+                            make start-graphene-server &
+                            ./benchmark-http.sh 127.0.0.1:8000
+                            '''
+                        sh '''
+                            cd Pal/regression
+                            make regression
+                            '''
+                        sh '''
+                            cd LibOS/shim/test/regression
+                            make regression
+                            '''
+                        sh '''
+                            cd LibOS/shim/test/apps/ltp
+                            make
+                            ./syscalls.sh
+                            '''
+                    }
+                }
+                stage('Deploy') {
+                    steps {
+                        sh 'echo Deploying code'
+                    }
+                }
+        }
+        post {
+                success {
+                        echo 'Deployment successful'
+                }
+                failure {
+                        echo 'Failure while on the pipeline'
+                }
+                unstable {
+                        echo 'Pipeline marked as "unstable"'
+                }
+        }
+}
+

+ 3 - 0
LibOS/shim/test/apps/gcc/.gitignore

@@ -0,0 +1,3 @@
+bzip2
+gzip
+hello

+ 6 - 0
LibOS/shim/test/apps/lighttpd/.gitignore

@@ -1,2 +1,8 @@
 ab.*
 result-*
+OUTPUT
+build
+html
+lighttpd-*
+lighttpd.conf
+

+ 1 - 0
LibOS/shim/test/apps/lmbench/.gitignore

@@ -0,0 +1 @@
+lmbench-2.5/bin

+ 1 - 0
LibOS/shim/test/apps/python/.gitignore

@@ -1 +1,2 @@
 *.pyc
+benchmarks

+ 2 - 10
LibOS/shim/test/apps/python/Makefile

@@ -26,7 +26,7 @@ $(PYTHON_SRC)/configure: $(PYTHON_SRC).tgz
 benchmarks: benchmarks.tar.gz
 	tar -xzf $<
 
-regression:
+regression: 
 	@echo "\n\nBuilding Python..."
 	@$(MAKE) >> /dev/null 2>&1
 
@@ -40,15 +40,7 @@ regression:
 	-grep -q "fib2              55" OUTPUT
 	@rm -f OUTPUT
 
-	@echo "\n\nRun a HTTP server in the background"
-	python scripts/dummy-web-server.py 8000 & echo $$! > server.PID
-	sleep 1
-	@echo "\n\nRun test-http.py:"
-	-./python.manifest scripts/test-http.py 127.0.0.1 8000 > OUTPUT1
-	-wget -q http://127.0.0.1:8000/ -O OUTPUT2
-	-diff -q OUTPUT1 OUTPUT2
-	@kill `cat server.PID`
-	@rm -f OUTPUT1 OUTPUT2 server.PID
+	./web-test.sh
 
 
 BENCHMARK = all,-rietveld,-spitfire,-tornado_http

+ 14 - 0
LibOS/shim/test/apps/python/web-test.sh

@@ -0,0 +1,14 @@
+#!/bin/sh
+
+## We really need to pick a unique ephemeral port; start by just picking pid+1024
+PORT=$(($$ + 1024))
+
+echo "\n\nRun a HTTP server in the background on port " + $PORT
+python scripts/dummy-web-server.py $PORT & echo $! > server.PID
+sleep 1
+echo "\n\nRun test-http.py:"
+./python.manifest scripts/test-http.py 127.0.0.1 $PORT > OUTPUT1
+wget -q http://127.0.0.1:$PORT/ -O OUTPUT2
+diff -q OUTPUT1 OUTPUT2
+kill `cat server.PID`
+rm -f OUTPUT1 OUTPUT2 server.PID

+ 15 - 0
Pal/regression/Process.manifest.template

@@ -0,0 +1,15 @@
+# the executable to run
+# loader.exec = file:./HelloWorld
+
+# debug type: inline|file
+loader.debug_type = inline
+
+# debug as file
+# loader.debug_file = <path>
+
+fs.mount.root.uri = file:
+
+# allow to bind on port 8000
+net.allow_bind.1 = 127.0.0.1:8000
+# allow to connect to port 8000
+net.allow_peer.1 = 127.0.0.1:8000