-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
httpd - Add a cgi handler for handling post data and a system test to…
… curl post to the endpoint to check that it is working Add the first system test to tests/ along with a CMakeLists.txt
- Loading branch information
Showing
4 changed files
with
60 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
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,3 @@ | ||
cmake_minimum_required(VERSION 3.9) | ||
|
||
install(PROGRAMS test_post.sh DESTINATION bin) |
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,20 @@ | ||
# test that we can perform a post of data to a cgi handler | ||
|
||
./httpd& | ||
httpd_pid=$! | ||
|
||
# generate some random data to upload | ||
# NOTE: This test was previously failing at a size of 300000 but would work at 100000, | ||
# so we are using 300000 here | ||
dd bs=1 count=300000 if=/dev/urandom of=testfile.bin | ||
|
||
timeout 5s curl -k -X POST https://localhost:9000/upload --data-binary @testfile.bin | ||
if [ $? -ne 0 ] | ||
then | ||
exit_code=1 | ||
fi | ||
|
||
# shut down httpd | ||
kill -KILL ${httpd_pid} | ||
|
||
exit ${exit_code} |