This document contains all the manual tests that should be performed to verify that the HTTP server is working correctly. Every feature required by the project should be tested before considering the server complete.
- Java installed.
- Your server compiled and running.
- Python installed (for CGI tests).
- JavaScript runtime installed (Node.js) if JavaScript CGI is supported.
curlinstalled.siegeinstalled (for stress testing).
Example:
java -jar server.jaror
java MainAssume the server is listening on:
http://localhost:8080
Open your browser:
http://localhost:8080
Expected:
- HTTP 200
- Default page displayed
Create:
www/index.html
Test:
curl http://localhost:8080/index.htmlExpected:
- Status 200
- HTML returned
Create:
www/images/logo.png
Test:
curl http://localhost:8080/images/logo.png --output logo.pngExpected:
- Status 200
- Downloaded image identical to original
curl http://localhost:8080/style.cssExpected:
Content-Type: text/css
curl http://localhost:8080/app.jsExpected:
Content-Type: application/javascript
curl http://localhost:8080/unknown.htmlExpected:
404 Not Found
Custom error page should be returned.
Try accessing a forbidden directory.
curl http://localhost:8080/private/Expected:
403 Forbidden
curl -X PUT http://localhost:8080/index.htmlExpected:
405 Method Not Allowed
curl -X POST \
-d "username=Ahmed&password=1234" \
http://localhost:8080/loginExpected:
- HTTP 200
- Body correctly received
curl \
-X POST \
-H "Content-Type: application/json" \
-d '{"name":"Ahmed"}' \
http://localhost:8080/apiExpected:
Server receives JSON correctly.
Create:
uploads/test.txt
Then:
curl -X DELETE http://localhost:8080/upload/test.txtExpected:
- File deleted
- HTTP 200
curl -X DELETE http://localhost:8080/upload/notfound.txtExpected:
404
Create:
hello.txt
Test:
curl \
-F "file=@hello.txt" \
http://localhost:8080/uploadExpected:
- File stored inside upload folder
- HTTP 200
curl \
-F "file1=@image.png" \
-F "file2=@hello.txt" \
http://localhost:8080/uploadExpected:
Both files uploaded.
Generate a 100 MB file on Linux:
dd if=/dev/zero of=large_file.bin bs=1M count=100Or a 1 GB file:
dd if=/dev/zero of=huge_file.bin bs=1M count=1024Upload:
curl \
-F "file=@large_file.bin" \
http://localhost:8080/uploadExpected:
If file exceeds configured limit:
413 Payload Too Large
Otherwise:
200 OK
curl -i http://localhost:8080Expected header:
Set-Cookie:
curl \
-H "Cookie: SESSIONID=12345" \
http://localhost:8080Expected:
Server receives cookie.
Open twice using:
curl -c cookies.txt http://localhost:8080Then
curl -b cookies.txt http://localhost:8080Expected:
Same session reused.
curl -L http://localhost:8080/homeExpected:
Redirect to configured page.
curl http://localhost:8080/images/Expected:
HTML listing files.
Expected:
403
or
404
depending on configuration.
Create:
folder/index.html
Test:
curl http://localhost:8080/folder/Expected:
Returns:
index.html
Open a connection without sending the full request.
Example using netcat:
nc localhost 8080Type:
GET /
Do not finish the request.
Expected:
Connection closes automatically after timeout.
curl \
-H "Transfer-Encoding: chunked" \
-T hello.txt \
http://localhost:8080/uploadExpected:
Server reconstructs request correctly.
printf "HELLO\r\n\r\n" | nc localhost 8080Expected:
400 Bad Request
printf "GET / HTTP/1.1\r\nHost\r\n\r\n" | nc localhost 8080Expected:
400
Run server on:
8080
8081
Test:
curl http://localhost:8081Expected:
HTTP 200.
for i in {1..100}
do
curl http://localhost:8080/index.html
doneExpected:
All successful.
Suppose:
cgi-bin/test.py
Example:
print("Content-Type: text/html")
print()
print("<h1>Hello Python CGI</h1>")Test:
curl http://localhost:8080/cgi-bin/test.pyExpected:
<h1>Hello Python CGI</h1>
Also test passing parameters:
curl "http://localhost:8080/cgi-bin/test.py?name=Ahmed"Expected:
Python receives query parameters correctly.
Example:
cgi-bin/test.js
console.log("Content-Type: text/html");
console.log();
console.log("<h1>Hello JavaScript CGI</h1>");Run:
curl http://localhost:8080/cgi-bin/test.jsExpected:
<h1>Hello JavaScript CGI</h1>
curl http://localhost:8080/cgi-bin/does_not_exist.pyExpected:
404
Python:
raise Exception("Crash")Test:
curl http://localhost:8080/cgi-bin/error.pyExpected:
500 Internal Server Error
Server must continue running.
Verify that:
PATH_INFO
contains the requested path and relative paths are handled correctly.
Modify configuration:
- Change port
- Change root
- Change upload folder
- Change error pages
Restart server.
Expected:
Changes applied without modifying Java code.
Trigger:
- 400
- 403
- 404
- 405
- 413
- 500
Verify custom HTML pages are returned.
Run:
siege -b -t60S http://localhost:8080or
siege -c100 -t2M http://localhost:8080Expected:
- No crash
- Stable memory usage
- Stable CPU usage
- Server still responds afterward
siege -b http://localhost:8080Expected:
Availability close to:
99.5%
or higher.
Verify using a browser:
- HTML pages
- CSS loading
- JavaScript loading
- Images
- Redirects
- File downloads
- Upload forms
- Cookies
- Sessions
Try requesting:
../../etc/passwd
Expected:
Access denied.
Try:
../../../secret.txt
Expected:
403 or 404.
Directory traversal must never work.
Run all previous tests multiple times.
Expected:
- No crashes
- No resource leaks
- No hanging connections
- All sockets closed properly
- Correct HTTP status codes
- Server remains responsive