Skip to content

Commit ce49dcb

Browse files
authored
Migrate unit tests to jenkins (gramineproject#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.
1 parent 1ccac87 commit ce49dcb

File tree

10 files changed

+113
-14
lines changed

10 files changed

+113
-14
lines changed

.travis.yml

-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ before_script:
99

1010
script:
1111
- make
12-
- cd $TRAVIS_BUILD_DIR/Pal/regression && make regression
13-
- cd $TRAVIS_BUILD_DIR/LibOS/shim/test/regression && make regression
14-
- cd $TRAVIS_BUILD_DIR/LibOS/shim/test/apps/ltp && make regression
1512
- cd $TRAVIS_BUILD_DIR/Pal/src && make clean && make SGX=1
1613
- cd $TRAVIS_BUILD_DIR/Pal/src && make clean && make DEBUG=1
1714
- cd $TRAVIS_BUILD_DIR/Pal/src && make clean && make SGX=1 DEBUG=1

Jenkinsfiles/Jenkinsfile Jenkinsfiles/Linux

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pipeline {
44
stage('Build') {
55
steps {
66
sh '''
7-
make
7+
make clean && make
88
'''
99
}
1010
}

Jenkinsfiles/Linux-Debug

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
pipeline {
2+
agent any
3+
stages {
4+
stage('Build') {
5+
steps {
6+
sh '''
7+
make clean && make DEBUG=1
8+
'''
9+
}
10+
}
11+
stage('Test') {
12+
steps {
13+
sh '''
14+
cd LibOS/shim/test/apps/gcc
15+
make regression
16+
'''
17+
sh '''
18+
cd LibOS/shim/test/apps/lmbench
19+
make regression
20+
'''
21+
sh '''
22+
cd LibOS/shim/test/apps/python
23+
make regression
24+
'''
25+
sh '''
26+
cd LibOS/shim/test/apps/lighttpd
27+
make
28+
make start-graphene-server &
29+
./benchmark-http.sh 127.0.0.1:8000
30+
'''
31+
sh '''
32+
cd LibOS/shim/test/apps/apache
33+
make
34+
make start-graphene-server &
35+
./benchmark-http.sh 127.0.0.1:8000
36+
'''
37+
sh '''
38+
cd Pal/regression
39+
make regression
40+
'''
41+
sh '''
42+
cd LibOS/shim/test/regression
43+
make regression
44+
'''
45+
sh '''
46+
cd LibOS/shim/test/apps/ltp
47+
make
48+
./syscalls.sh
49+
'''
50+
}
51+
}
52+
stage('Deploy') {
53+
steps {
54+
sh 'echo Deploying code'
55+
}
56+
}
57+
}
58+
post {
59+
success {
60+
echo 'Deployment successful'
61+
}
62+
failure {
63+
echo 'Failure while on the pipeline'
64+
}
65+
unstable {
66+
echo 'Pipeline marked as "unstable"'
67+
}
68+
}
69+
}
70+

LibOS/shim/test/apps/gcc/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
bzip2
2+
gzip
3+
hello
+6
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
ab.*
22
result-*
3+
OUTPUT
4+
build
5+
html
6+
lighttpd-*
7+
lighttpd.conf
8+
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lmbench-2.5/bin
+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
*.pyc
2+
benchmarks

LibOS/shim/test/apps/python/Makefile

+2-10
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ $(PYTHON_SRC)/configure: $(PYTHON_SRC).tgz
2626
benchmarks: benchmarks.tar.gz
2727
tar -xzf $<
2828

29-
regression:
29+
regression:
3030
@echo "\n\nBuilding Python..."
3131
@$(MAKE) >> /dev/null 2>&1
3232

@@ -40,15 +40,7 @@ regression:
4040
-grep -q "fib2 55" OUTPUT
4141
@rm -f OUTPUT
4242

43-
@echo "\n\nRun a HTTP server in the background"
44-
python scripts/dummy-web-server.py 8000 & echo $$! > server.PID
45-
sleep 1
46-
@echo "\n\nRun test-http.py:"
47-
-./python.manifest scripts/test-http.py 127.0.0.1 8000 > OUTPUT1
48-
-wget -q http://127.0.0.1:8000/ -O OUTPUT2
49-
-diff -q OUTPUT1 OUTPUT2
50-
@kill `cat server.PID`
51-
@rm -f OUTPUT1 OUTPUT2 server.PID
43+
./web-test.sh
5244

5345

5446
BENCHMARK = all,-rietveld,-spitfire,-tornado_http
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/sh
2+
3+
## We really need to pick a unique ephemeral port; start by just picking pid+1024
4+
PORT=$(($$ + 1024))
5+
6+
echo "\n\nRun a HTTP server in the background on port " + $PORT
7+
python scripts/dummy-web-server.py $PORT & echo $! > server.PID
8+
sleep 1
9+
echo "\n\nRun test-http.py:"
10+
./python.manifest scripts/test-http.py 127.0.0.1 $PORT > OUTPUT1
11+
wget -q http://127.0.0.1:$PORT/ -O OUTPUT2
12+
diff -q OUTPUT1 OUTPUT2
13+
kill `cat server.PID`
14+
rm -f OUTPUT1 OUTPUT2 server.PID
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# the executable to run
2+
# loader.exec = file:./HelloWorld
3+
4+
# debug type: inline|file
5+
loader.debug_type = inline
6+
7+
# debug as file
8+
# loader.debug_file = <path>
9+
10+
fs.mount.root.uri = file:
11+
12+
# allow to bind on port 8000
13+
net.allow_bind.1 = 127.0.0.1:8000
14+
# allow to connect to port 8000
15+
net.allow_peer.1 = 127.0.0.1:8000

0 commit comments

Comments
 (0)