Badjedi04 / WebServerDesign

My first GitHub repository.
0 stars 0 forks source link

Assignment 1 #5

Open ibnesayeed opened 1 year ago

ibnesayeed commented 1 year ago
================================================================================
Assignment: cs531a1
Student: Prashant Tomar <cs_ptoma001@cs.odu.edu>
Time: 20221205-193113 UTC
Repository: https://github.com/Badjedi04/Hello-Git-World/tree/a1
Server: cs531-cs_ptoma001
================================================================================

Deploying server: cs531-cs_ptoma001

Cloning the `https://github.com/Badjedi04/Hello-Git-World.git` repo and checking the `a1` branch/tag out
Released at: 2022-12-05T01:00:26Z
Step 1/8 : FROM python
 ---> e285995a3494
Step 2/8 : WORKDIR /app
 ---> Using cache
 ---> 6600eabbab3a
Step 3/8 : COPY requirements.txt /app
 ---> Using cache
 ---> bfc62e00b6e5
Step 4/8 : ADD . /app
 ---> 0d4bf699cde7
Step 5/8 : RUN pip install --trusted-host pypi.python.org -r requirements.txt
 ---> Running in 6e47d9ec6032
Collecting pytz
  Downloading pytz-2022.6-py2.py3-none-any.whl (498 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 498.1/498.1 kB 11.0 MB/s eta 0:00:00
Installing collected packages: pytz
Successfully installed pytz-2022.6
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

[notice] A new release of pip available: 22.2.2 -> 22.3.1
[notice] To update, run: pip install --upgrade pip
Removing intermediate container 6e47d9ec6032
 ---> 704afa895b9a
Step 6/8 : EXPOSE 80
 ---> Running in f1a3de67b770
Removing intermediate container f1a3de67b770
 ---> 8dbbf2c80d6f
Step 7/8 : ENV NAME World
 ---> Running in 4edd67a395f1
Removing intermediate container 4edd67a395f1
 ---> abc65289e575
Step 8/8 : CMD ["python", "Server.py"]
 ---> Running in d6611e92a900
Removing intermediate container d6611e92a900
 ---> b8cd009dcda2
Successfully built b8cd009dcda2
Successfully tagged cs531/cs_ptoma001:a1

A new container is created and the server `cs531-cs_ptoma001` is deployed successfully

Testing server: cs531-cs_ptoma001 against cs531a1 test suite

Testing cs531-cs_ptoma001:80
--------------------------------------------------------------------------------
test_url_get_ok: Test whether the URL of the assignment 1 directory returns HTTP/1.1 200 OK on GET
* Connecting to the `cs531-cs_ptoma001:80` server
* Request data sent
* Response data read
* Response parsed
* HTTP version is `HTTP/1.1`
* Status is `200`
* `Date` header is present
* `Date` header is in the preferred RCF7231 format
[PASSED]

> GET http://cs531-cs_ptoma001/a1-test/2/index.html HTTP/1.1
> Host: cs531-cs_ptoma001
> Connection: close
> 

< HTTP/1.1 200 OK
< Date: Mon, 05 Dec 2022 19:31:30 GMT
< Server: Assignment1/Version/0.1
< Content-Length: 1936
< Last-Modified: Mon, 05 Dec 2022 19:31:14 GMT
< Content-Type: text/html
< Connection: close
< 
* [Payload redacted (1936 bytes)]

--------------------------------------------------------------------------------
test_url_head_ok: Test whether the URL of the assignment 1 directory returns 200 on HEAD
* Connecting to the `cs531-cs_ptoma001:80` server
* Request data sent
* Response data read
* Response parsed
* Status is `200`
* `Content-Type` header is present
* `Content-Type` header begins with `text/html`
* `Date` header is present
* `Date` header is in the preferred RCF7231 format
* Payload is empty
[PASSED]

> HEAD http://cs531-cs_ptoma001/a1-test/2/index.html HTTP/1.1
> Host: cs531-cs_ptoma001
> Connection: close
> 

< HTTP/1.1 200 OK
< Date: Mon, 05 Dec 2022 19:31:30 GMT
< Server: Assignment1/Version/0.1
< Content-Length: 1936
< Last-Modified: Mon, 05 Dec 2022 19:31:14 GMT
< Content-Type: text/html
< Connection: close

--------------------------------------------------------------------------------
test_path_head_ok: Test whether the relative path of the assignment 1 directory returns 200 on HEAD
* Connecting to the `cs531-cs_ptoma001:80` server
* Request data sent
* Response data read
* Response parsed
* Status is `200`
* `Content-Type` header is present
* `Content-Type` header begins with `text/html`
* `Date` header is present
* `Date` header is in the preferred RCF7231 format
* Payload is empty
[PASSED]

> HEAD /a1-test/2/index.html HTTP/1.1
> Host: cs531-cs_ptoma001
> Connection: close
> 

< HTTP/1.1 200 OK
< Date: Mon, 05 Dec 2022 19:31:30 GMT
< Server: Assignment1/Version/0.1
< Content-Length: 1936
< Last-Modified: Mon, 05 Dec 2022 19:31:14 GMT
< Content-Type: text/html
< Connection: close

--------------------------------------------------------------------------------
test_path_options_ok: Test whether the relative path of the assignment 1 directory returns 200 on OPTIONS
* Connecting to the `cs531-cs_ptoma001:80` server
* Request data sent
* Response data read
* Response parsed
* Status is `200`
* `Allow` header is present
* `Allow` header contains `GET`
* `Date` header is present
* `Date` header is in the preferred RCF7231 format
[PASSED]

> OPTIONS /a1-test/2/index.html HTTP/1.1
> Host: cs531-cs_ptoma001
> Connection: close
> 

< HTTP/1.1 200 OK
< Date: Mon, 05 Dec 2022 19:31:30 GMT
< Server: Assignment1/Version/0.1
< Content-Length: 0
< Allow: GET, HEAD, OPTIONS, TRACE 
< Connection: close

--------------------------------------------------------------------------------
test_get_missing: Test whether a non-existing path returns 404 on GET
* Connecting to the `cs531-cs_ptoma001:80` server
* Request data sent
* Response data read
* Response parsed
* HTTP version is `HTTP/1.1`
* Status is `404`
* `Date` header is present
* `Date` header is in the preferred RCF7231 format
[PASSED]

> GET /1/1.1/go%20hokies.html HTTP/1.1
> Host: cs531-cs_ptoma001
> Connection: close
> 

< HTTP/1.1 404 Not Found
< Date: Mon, 05 Dec 2022 19:31:30 GMT
< Server: Assignment1/Version/0.1
< Content-Length: 157
< Content-Type: text/html
< Connection: close
< 
* [Payload redacted (157 bytes)]

--------------------------------------------------------------------------------
test_get_duplicate_path_prefix: Test tight path prefix checking
* Connecting to the `cs531-cs_ptoma001:80` server
* Request data sent
* Response data read
* Response parsed
* HTTP version is `HTTP/1.1`
* Status is `404`
* `Date` header is present
* `Date` header is in the preferred RCF7231 format
[PASSED]

> GET /a1-test/a1-test/ HTTP/1.1
> Host: cs531-cs_ptoma001
> Connection: close
> 

< HTTP/1.1 404 Not Found
< Date: Mon, 05 Dec 2022 19:31:30 GMT
< Server: Assignment1/Version/0.1
< Content-Length: 157
< Content-Type: text/html
< Connection: close
< 
* [Payload redacted (157 bytes)]

--------------------------------------------------------------------------------
test_unsupported_version: Test whether a request with unsupported version returns 505
* Connecting to the `cs531-cs_ptoma001:80` server
* Request data sent
* Response data read
* Response parsed
* Status is `505`
* `Date` header is present
* `Date` header is in the preferred RCF7231 format
[PASSED]

> GET / HTTP/1.11
> Host: cs531-cs_ptoma001
> Connection: close
> 

< HTTP/1.1 505 HTTP Version Not Supported
< Date: Mon, 05 Dec 2022 19:31:30 GMT
< Server: Assignment1/Version/0.1
< Content-Length: 191
< Content-Type: text/html
< Connection: close
< 
* [Payload redacted (191 bytes)]

--------------------------------------------------------------------------------
test_invalid_request: Test whether an invalid request returns 400
* Connecting to the `cs531-cs_ptoma001:80` server
* Request data sent
* Response data read
* Response parsed
* Status is `400`
* `Date` header is present
* `Date` header is in the preferred RCF7231 format
[PASSED]

> qwerty
> 

< HTTP/1.1 400 Bad Request
< Date: Mon, 05 Dec 2022 19:31:30 GMT
< Server: Assignment1/Version/0.1
< Content-Length: 0
< Connection: close

--------------------------------------------------------------------------------
test_missing_host_header: Test whether missing Host header in a request returns 400
* Connecting to the `cs531-cs_ptoma001:80` server
* Request data sent
* Response data read
* Response parsed
* Status is `400`
* `Date` header is present
* `Date` header is in the preferred RCF7231 format
[PASSED]

> GET / HTTP/1.1
> Connection: close
> 

< HTTP/1.1 400 Bad Request
< Date: Mon, 05 Dec 2022 19:31:30 GMT
< Server: Assignment1/Version/0.1
< Content-Length: 161
< Content-Type: text/html
< Connection: close
< 
* [Payload redacted (161 bytes)]

--------------------------------------------------------------------------------
test_post_not_implemented: Test whether the assignment 1 returns 501 on POST
* Connecting to the `cs531-cs_ptoma001:80` server
* Request data sent
* Response data read
* Response parsed
* Status is `501`
* `Date` header is present
* `Date` header is in the preferred RCF7231 format
[PASSED]

> POST /a1-test/ HTTP/1.1
> Host: cs531-cs_ptoma001
> Connection: close
> 

< HTTP/1.1 501 Not Implemented
< Date: Mon, 05 Dec 2022 19:31:30 GMT
< Server: Assignment1/Version/0.1
< Content-Length: 0
< Allow: GET, HEAD, OPTIONS, TRACE 
< Connection: close

--------------------------------------------------------------------------------
test_trace_echoback: Test whether the server echoes back the request on TRACE
* Connecting to the `cs531-cs_ptoma001:80` server
* Request data sent
* Response data read
* Response parsed
* Status is `200`
* `Content-Type` header is present
* `Content-Type` header begins with `message/http`
* `Date` header is present
* `Date` header is in the preferred RCF7231 format
* Payload begins with `TRACE /a1-test/1/1.4/ HTTP/1.1`
* Payload contains `User-Agent: CS531 Assignment 1 Tester/1670268690`
* Payload contains `Connection: close`
[PASSED]

> TRACE /a1-test/1/1.4/ HTTP/1.1
> Host: cs531-cs_ptoma001
> User-Agent: CS531 Assignment 1 Tester/1670268690
> Connection: close
> 

< HTTP/1.1 200 OK
< Date: Mon, 05 Dec 2022 19:31:30 GMT
< Server: Assignment1/Version/0.1
< Content-Length: 128
< Content-Type: message/http
< Connection: close
< 
* [Payload redacted (128 bytes)]

--------------------------------------------------------------------------------
test_get_escaped_file_name: Test whether the escaped file name is respected
* Connecting to the `cs531-cs_ptoma001:80` server
* Request data sent
* Response data read
* Response parsed
[FAILED] ASSERTION: Status expected `200`, returned `404`

> GET http://cs531-cs_ptoma001/a1-test/1/1.4/test%3A.html HTTP/1.1
> Host: cs531-cs_ptoma001
> Connection: close
> 

< HTTP/1.1 404 Not Found
< Date: Mon, 05 Dec 2022 19:31:30 GMT
< Server: Assignment1/Version/0.1
< Content-Length: 157
< Content-Type: text/html
< Connection: close
< 
* [Payload redacted (157 bytes)]

--------------------------------------------------------------------------------
test_get_escape_escaping_character: Test whether the escaped escaping caracter in a file name is respected
* Connecting to the `cs531-cs_ptoma001:80` server
* Request data sent
* Response data read
* Response parsed
* Status is `200`
* Payload contains `Go Monarchs!`
[PASSED]

> GET http://cs531-cs_ptoma001/a1-test/1/1.4/escape%25this.html HTTP/1.1
> Host: cs531-cs_ptoma001
> Connection: close
> 

< HTTP/1.1 200 OK
< Date: Mon, 05 Dec 2022 19:31:30 GMT
< Server: Assignment1/Version/0.1
< Content-Length: 67
< Last-Modified: Mon, 05 Dec 2022 19:31:14 GMT
< Content-Type: text/html
< Connection: close
< 
* [Payload redacted (67 bytes)]

--------------------------------------------------------------------------------
test_get_jpeg_image: Test whether a JPEG image returns 200 with proper Content-Length on GET
* Connecting to the `cs531-cs_ptoma001:80` server
* Request data sent
* Response data read
* Response parsed
* Status is `200`
* `Content-Length` header is present
* `Content-Length` header has value `38457`
* Payload size is `38457` bytes
[PASSED]

> GET http://cs531-cs_ptoma001/a1-test/2/0.jpeg HTTP/1.1
> Host: cs531-cs_ptoma001
> Connection: close
> 

< HTTP/1.1 200 OK
< Date: Mon, 05 Dec 2022 19:31:30 GMT
< Server: Assignment1/Version/0.1
< Content-Length: 38457
< Last-Modified: Mon, 05 Dec 2022 19:31:14 GMT
< Content-Type: image/jpeg
< Connection: close
< 
* [Payload redacted (38457 bytes)]

--------------------------------------------------------------------------------
test_get_case_sensitive_file_extension: Test whether file extensions are treated case-sensitive
* Connecting to the `cs531-cs_ptoma001:80` server
* Request data sent
* Response data read
* Response parsed
* HTTP version is `HTTP/1.1`
* Status is `404`
[PASSED]

> GET http://cs531-cs_ptoma001/a1-test/2/0.JPEG HTTP/1.1
> Host: cs531-cs_ptoma001
> Connection: close
> 

< HTTP/1.1 404 Not Found
< Date: Mon, 05 Dec 2022 19:31:30 GMT
< Server: Assignment1/Version/0.1
< Content-Length: 157
< Content-Type: text/html
< Connection: close
< 
* [Payload redacted (157 bytes)]

--------------------------------------------------------------------------------
test_get_empty_text_file: Test whether an empty file returns zero bytes with 200 on GET
* Connecting to the `cs531-cs_ptoma001:80` server
* Request data sent
* Response data read
* Response parsed
* Status is `200`
* `Content-Type` header is present
* `Content-Type` header begins with `text/plain`
* `Content-Length` header is present
* `Content-Length` header has value `0`
* Payload is empty
[PASSED]

> GET http://cs531-cs_ptoma001/a1-test/4/thisfileisempty.txt HTTP/1.1
> Host: cs531-cs_ptoma001
> Connection: close
> 

< HTTP/1.1 200 OK
< Date: Mon, 05 Dec 2022 19:31:30 GMT
< Server: Assignment1/Version/0.1
< Content-Length: 0
< Last-Modified: Mon, 05 Dec 2022 19:31:14 GMT
< Content-Type: text/plain
< Connection: close

--------------------------------------------------------------------------------
test_get_empty_unknown_file_directory: Test whether an unknown empty file or directory returns zero bytes and a valid Content-Type with 200 on GET
* Connecting to the `cs531-cs_ptoma001:80` server
* Request data sent
* Response data read
* Response parsed
* Status is `200`
* `Content-Type` header is present
* `Content-Type` header begins with `application/octet-stream`
* `Content-Length` header is present
* `Content-Length` header has value `0`
* Payload is empty
[PASSED]

> GET http://cs531-cs_ptoma001/a1-test/4/directory3isempty HTTP/1.1
> Host: cs531-cs_ptoma001
> Connection: close
> 

< HTTP/1.1 200 OK
< Date: Mon, 05 Dec 2022 19:31:30 GMT
< Server: Assignment1/Version/0.1
< Content-Length: 0
< Last-Modified: Mon, 05 Dec 2022 19:31:14 GMT
< Content-Type: application/octet-stream
< Connection: close

--------------------------------------------------------------------------------
test_get_filename_with_many_dots: Test whether file names with multiple dots return 200 on GET
* Connecting to the `cs531-cs_ptoma001:80` server
* Request data sent
* Response data read
* Response parsed
* Status is `200`
* `Content-Type` header is present
* `Content-Type` header begins with `text/xml`
[PASSED]

> GET http://cs531-cs_ptoma001/a1-test/1/1.2/arXiv.org.Idenitfy.repsonse.xml HTTP/1.1
> Host: cs531-cs_ptoma001
> Connection: close
> 

< HTTP/1.1 200 OK
< Date: Mon, 05 Dec 2022 19:31:30 GMT
< Server: Assignment1/Version/0.1
< Content-Length: 3142
< Last-Modified: Mon, 05 Dec 2022 19:31:14 GMT
< Content-Type: text/xml
< Connection: close
< 
* [Payload redacted (3142 bytes)]

--------------------------------------------------------------------------------
test_get_magic_cookie_of_a_binary_file: Test whether a GIF file contains identifying magic cookie
* Connecting to the `cs531-cs_ptoma001:80` server
* Request data sent
* Response data read
* Response parsed
* Status is `200`
* Payload begins with `GIF89a`
[PASSED]

> GET http://cs531-cs_ptoma001/a1-test/2/6.gif HTTP/1.1
> Host: cs531-cs_ptoma001
> Connection: close
> 

< HTTP/1.1 200 OK
< Date: Mon, 05 Dec 2022 19:31:30 GMT
< Server: Assignment1/Version/0.1
< Content-Length: 49803
< Last-Modified: Mon, 05 Dec 2022 19:31:14 GMT
< Content-Type: image/gif
< Connection: close
< 
* [Payload redacted (49803 bytes)]

--------------------------------------------------------------------------------
test_access_log_as_virtual_uri: Test whether the access log is available as a Virtual URI in the Common Log Format
* Connecting to the `cs531-cs_ptoma001:80` server
* Request data sent
* Response data read
* Response parsed
[FAILED] ASSERTION: Status expected `200`, returned `404`

> GET /.well-known/access.log HTTP/1.1
> Host: cs531-cs_ptoma001
> Connection: close
> 

< HTTP/1.1 404 Not Found
< Date: Mon, 05 Dec 2022 19:31:30 GMT
< Server: Assignment1/Version/0.1
< Content-Length: 157
< Content-Type: text/html
< Connection: close
< 
* [Payload redacted (157 bytes)]

=================================== SUMMARY ====================================
Server: cs531-cs_ptoma001:80
Test Case Results:
PASSED: test_url_get_ok
PASSED: test_url_head_ok
PASSED: test_path_head_ok
PASSED: test_path_options_ok
PASSED: test_get_missing
PASSED: test_get_duplicate_path_prefix
PASSED: test_unsupported_version
PASSED: test_invalid_request
PASSED: test_missing_host_header
PASSED: test_post_not_implemented
PASSED: test_trace_echoback
FAILED: test_get_escaped_file_name
PASSED: test_get_escape_escaping_character
PASSED: test_get_jpeg_image
PASSED: test_get_case_sensitive_file_extension
PASSED: test_get_empty_text_file
PASSED: test_get_empty_unknown_file_directory
PASSED: test_get_filename_with_many_dots
PASSED: test_get_magic_cookie_of_a_binary_file
FAILED: test_access_log_as_virtual_uri
--------------------------------------------------------------------------------
TOTAL: 20, PASSED: 18, FAILED: 2
===============================================================================

Destroying server: cs531-cs_ptoma001
Server `cs531-cs_ptoma001` destroyed successfully.
ibnesayeed commented 1 year ago
* [PASSED]: cs531a1: test_url_get_ok
* [PASSED]: cs531a1: test_url_head_ok
* [PASSED]: cs531a1: test_path_head_ok
* [PASSED]: cs531a1: test_path_options_ok
* [PASSED]: cs531a1: test_get_missing
* [PASSED]: cs531a1: test_get_duplicate_path_prefix
* [PASSED]: cs531a1: test_unsupported_version
* [PASSED]: cs531a1: test_invalid_request
* [PASSED]: cs531a1: test_missing_host_header
* [PASSED]: cs531a1: test_post_not_implemented
* [PASSED]: cs531a1: test_trace_echoback
* [PASSED]: cs531a1: test_get_escaped_file_name
* [PASSED]: cs531a1: test_get_escape_escaping_character
* [PASSED]: cs531a1: test_get_jpeg_image
* [PASSED]: cs531a1: test_get_case_sensitive_file_extension
* [PASSED]: cs531a1: test_get_empty_text_file
* [PASSED]: cs531a1: test_get_empty_unknown_file_directory
* [PASSED]: cs531a1: test_get_filename_with_many_dots
* [PASSED]: cs531a1: test_get_magic_cookie_of_a_binary_file
* [PASSED]: cs531a1: test_access_log_as_virtual_uri

TOTAL: 20, PASSED: 20, FAILED: 0