Browse Source

update regression scripts

Chia-Che Tsai 6 years ago
parent
commit
d003dc2ecc

+ 6 - 6
LibOS/shim/test/apps/gcc/Makefile

@@ -95,24 +95,24 @@ regression:
 	@$(MAKE) >> /dev/null 2>&1
 
 	@echo "\n\nCompile hello.c:"
-	./gcc.manifest test_files/helloworld.c -o hello
+	-./gcc.manifest test_files/helloworld.c -o hello
 	@chmod 755 hello
-	./hello
+	-./hello
 
 	@echo "\n\nCompile bzip2.c:"
-	./gcc.manifest test_files/bzip2.c -o bzip2
+	-./gcc.manifest test_files/bzip2.c -o bzip2
 	@chmod 755 bzip2
 	@[ ! -f bzip2.tmp ] || rm -f bzip2.tmp
 	@cp -f bzip2 bzip2.copy
-	./bzip2 -z bzip2.copy && ./bzip2 -d bzip2.copy.bz2
+	-./bzip2 -z bzip2.copy && ./bzip2 -d bzip2.copy.bz2
 	diff -q bzip2 bzip2.copy
 	@rm -f bzip2.copy
 
 	@echo "\n\nCompile gzip.c:"
-	./gcc.manifest test_files/gzip.c -o gzip
+	-./gcc.manifest test_files/gzip.c -o gzip
 	@chmod 755 gzip
 	@cp -f gzip gzip.copy
-	./gzip gzip.copy && ./gzip -d gzip.copy.gz
+	-./gzip gzip.copy && ./gzip -d gzip.copy.gz
 	diff -q gzip gzip.copy
 	@rm -f gzip.copy
 

+ 11 - 9
LibOS/shim/test/apps/python/Makefile

@@ -31,22 +31,24 @@ regression:
 	@$(MAKE) >> /dev/null 2>&1
 
 	@echo "\n\nRun helloworld.py:"
-	./python.manifest scripts/helloworld.py > OUTPUT
-	grep -q "Hello World" OUTPUT
+	-./python.manifest scripts/helloworld.py > OUTPUT
+	-grep -q "Hello World" OUTPUT
 	@rm OUTPUT
 
 	@echo "\n\nRun fibonacci.py:"
-	./python.manifest scripts/fibonacci.py  > OUTPUT
-	grep -q "fib2              55" OUTPUT
-	@rm OUTPUT
+	-./python.manifest scripts/fibonacci.py  > OUTPUT
+	-grep -q "fib2              55" OUTPUT
+	@rm -f OUTPUT
 
 	@echo "\n\nRun a HTTP server in the background"
-	python scripts/dummy-web-server.py 8000
+	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 > OUTPUT
-	wget -q http://127.0.0.1:8000/ -O OUTPUT2
+	-./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
-	@rm OUTPUT OUTPUT2
+	@kill `cat server.PID`
+	@rm -f OUTPUT1 OUTPUT2 server.PID
 
 
 BENCHMARK = all,-rietveld,-spitfire,-tornado_http

+ 3 - 3
LibOS/shim/test/apps/python/scripts/test-http.py

@@ -1,11 +1,11 @@
-import urllib2
+import sys,urllib2
 
-request = urllib2.Request("http://" + argv[1] + ":" + argv[2] + "/index.html")
+request = urllib2.Request("http://" + sys.argv[1] + ":" + sys.argv[2] + "/index.html")
 opener = urllib2.build_opener()
 response = opener.open(request, timeout=10)
 while True:
     data = response.read(1024)
     if data:
-        print data
+        sys.stdout.write(data)
     else:
         break