Skip to content
Permalink
d3d5dce814
Go to file
 
 
Cannot retrieve contributors at this time
58 lines (48 sloc) 2.83 KB
# https://tools.ietf.org/html/draft-young-md-query-09
*** Settings ***
Library Collections
Library Process
Resource MDQ.robot
Variables variables.py
*** Test Cases ***
2.2.1 HTTP Version (Required)
# Using curl because the Requests library doesn't let us specify HTTP version
${Curl} Run Process /usr/bin/curl --http1.0 -i ${BASE_URL}/entities/${ENTITY_ID_ENCODED} |head -n 1 shell=true
Should Contain ${Curl.stdout} 505 msg=MUST NOT support HTTP versions prior to 1.1
${Curl} Run Process /usr/bin/curl --http1.1 -i ${BASE_URL}/entities/${ENTITY_ID_ENCODED} |head -n 1 shell=true
Should Contain ${Curl.stdout} 200 OK msg=MUST support HTTP version 1.1
2.2.2 HTTP Version (Optional)
[Tags] optional
${Curl} Run Process /usr/bin/curl --http2 -i ${BASE_URL}/entities/${ENTITY_ID_ENCODED} |head -n 1 shell=true
Should Contain ${Curl.stdout} 200 OK msg=MAY support HTTP versions later than 1.1
2.5 Response Headers (Required)
# Content-Encoding
${resp}= Get Entity With Gzip baseUrl=${BASE_URL} identifier=${ENTITY_ID_ENCODED}
Dictionary Should Contain Key ${resp.headers} content-encoding msg=MUST return Content-Encoding header if compressed
# Content-Type
${resp}= Get Entity baseUrl=${BASE_URL} identifier=${ENTITY_ID_ENCODED}
Dictionary Should Contain Key ${resp.headers} content-type msg=MUST return Content-Type header
# ETag
${resp}= Get Entity baseUrl=${BASE_URL} identifier=${ENTITY_ID_ENCODED}
Dictionary Should Contain Key ${resp.headers} etag msg=MUST return ETag header
2.5 Response Headers (Optional)
[Tags] optional
#Cache-Control
${resp}= Get Entity baseUrl=${BASE_URL} identifier=${ENTITY_ID_ENCODED}
Dictionary Should Contain Key ${resp.headers} cache-control msg=SHOULD return Cache-Control header
# Content-Length
${resp}= Get Entity baseUrl=${BASE_URL} identifier=${ENTITY_ID_ENCODED}
Dictionary Should Contain Key ${resp.headers} content-length msg=SHOULD return Content-Length header
# Last-Modified
${resp}= Get Entity baseUrl=${BASE_URL} identifier=${ENTITY_ID_ENCODED}
Dictionary Should Contain Key ${resp.headers} last-modified msg=SHOULD return Last-Modified header
4.1 Conditional Retrieval
[Tags] optional
Get Entity baseUrl=${BASE_URL} identifier=${ENTITY_ID_ENCODED}
${resp}= Get Entity baseUrl=${BASE_URL} identifier=${ENTITY_ID_ENCODED}
Should Be Equal As Strings ${resp.status_code} 304 msg=SHOULD return HTTP status code 304
# 4.2 Content Caching
4.3 Content Compression
${resp}= Get Entity With Gzip baseUrl=${BASE_URL} identifier=${ENTITY_ID_ENCODED}
Should Be Equal As Strings ${resp.status_code} 200 msg=MUST support gzip compression
Dictionary Should Contain Item ${resp.headers} content-encoding gzip msg=MUST support gzip compression
You can’t perform that action at this time.