From d003dc2ecc43e809fa18d0dab2f116d827ee9937 Mon Sep 17 00:00:00 2001 From: Chia-Che Tsai Date: Tue, 3 Oct 2017 10:26:10 -0400 Subject: [PATCH] update regression scripts --- LibOS/shim/test/apps/gcc/Makefile | 12 +++++------ LibOS/shim/test/apps/python/Makefile | 20 ++++++++++--------- .../test/apps/python/scripts/test-http.py | 6 +++--- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/LibOS/shim/test/apps/gcc/Makefile b/LibOS/shim/test/apps/gcc/Makefile index fa2de1d0..6246eaca 100644 --- a/LibOS/shim/test/apps/gcc/Makefile +++ b/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 diff --git a/LibOS/shim/test/apps/python/Makefile b/LibOS/shim/test/apps/python/Makefile index 03bf60b0..6ed70b96 100644 --- a/LibOS/shim/test/apps/python/Makefile +++ b/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 diff --git a/LibOS/shim/test/apps/python/scripts/test-http.py b/LibOS/shim/test/apps/python/scripts/test-http.py index 770cb9a8..65a6dfd7 100644 --- a/LibOS/shim/test/apps/python/scripts/test-http.py +++ b/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