-
Notifications
You must be signed in to change notification settings - Fork 822
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add nginx integration test with shell script
- Loading branch information
Showing
6 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# `nginx` integration test | ||
|
||
|
||
This starts wasmer with the nginx wasm file and serves an html | ||
file with some simple text to assert on. The test script does | ||
the assertion. | ||
|
||
Run test with: | ||
|
||
``` | ||
> ./integration_tests/nginx/test.sh | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
wasmer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
26310 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
events { | ||
} | ||
|
||
# We need this for now, as we want to run nginx as a worker | ||
daemon off; | ||
master_process off; | ||
|
||
# We show the errors and info in stderr | ||
error_log /dev/stderr info; | ||
|
||
http { | ||
# We show access in the stdout | ||
access_log /dev/stdout; | ||
server { | ||
listen 8080; | ||
server_name _; | ||
|
||
location / { | ||
# IMPORTANT: Replace the dir with the one you want to serve (that have an index.html file) | ||
root ./html/; | ||
index index.html; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#! /bin/bash | ||
|
||
# Build the release and run nginx | ||
make release | ||
nohup ./target/release/wasmer run examples/nginx/nginx.wasm -- -p integration_tests/nginx/ -c nginx.conf & | ||
sleep 3s | ||
|
||
curl localhost:8080 > ./nginx.out | ||
|
||
|
||
if grep "wasmer" ./nginx.out | ||
then | ||
echo "nginx integration test succeeded" | ||
rm ./nohup.out | ||
rm ./nginx.out | ||
rm -rf ./integration_tests/nginx/*_temp | ||
exit 0 | ||
else | ||
echo "nginx integration test failed" | ||
rm ./nohup.out | ||
rm ./nginx.out | ||
rm -rf ./integration_tests/nginx/*_temp | ||
exit -1 | ||
fi |