Skip to content
Permalink
Newer
Older
100644 59 lines (48 sloc) 2.58 KB
1
# https://tools.ietf.org/html/draft-young-md-query-09
2
3
*** Settings ***
4
Library Collections
5
Library Process
6
Resource MDQ.robot
7
Variables variables.py
8
9
*** Test Cases ***
10
2.2.1 HTTP Version (Required)
11
# Using curl because the Requests library doesn't let us specify HTTP version
12
13
${Curl} Run Process /usr/bin/curl --http1.0 -i ${BASE_URL}entities/${ENTITY_ID_ENCODED} |head -n 1 shell=true
14
Should Contain ${Curl.stdout} 505 HTTP Version Not Supported msg=MUST NOT support HTTP versions prior to 1.1
15
16
${Curl} Run Process /usr/bin/curl --http1.1 -i ${BASE_URL}entities/${ENTITY_ID_ENCODED} |head -n 1 shell=true
17
Should Contain ${Curl.stdout} 200 OK msg=MUST support HTTP version 1.1
18
19
2.2.2 HTTP Version (Optional)
20
[Tags] optional
21
22
${Curl} Run Process /usr/bin/curl --http2 -i ${BASE_URL}entities/${ENTITY_ID_ENCODED} |head -n 1 shell=true
23
Should Contain ${Curl.stdout} 200 OK msg=MAY support HTTP versions later than 1.1
24
25
2.5 Response Headers (Required)
26
# Content-Encoding
27
${resp}= Get With Gzip uri=entities/${ENTITY_ID_ENCODED}
28
Dictionary Should Contain Key ${resp.headers} content-encoding msg=MUST return Content-Encoding header if compressed
29
# Content-Type
30
${resp}= Get uri=entities/${ENTITY_ID_ENCODED}
31
Dictionary Should Contain Key ${resp.headers} content-type msg=MUST return Content-Type header
32
# ETag
33
${resp}= Get uri=entities/${ENTITY_ID_ENCODED}
34
Dictionary Should Contain Key ${resp.headers} etag msg=MUST return ETag header
35
36
2.5 Response Headers (Optional)
37
[Tags] optional
38
#Cache-Control
39
${resp}= Get uri=entities/${ENTITY_ID_ENCODED}
40
Dictionary Should Contain Key ${resp.headers} cache-control msg=SHOULD return Cache-Control header
41
# Content-Length
42
${resp}= Get uri=entities/${ENTITY_ID_ENCODED}
43
Dictionary Should Contain Key ${resp.headers} content-length msg=SHOULD return Content-Length header
44
# Last-Modified
45
${resp}= Get uri=entities/${ENTITY_ID_ENCODED}
46
Dictionary Should Contain Key ${resp.headers} last-modified msg=SHOULD return Last-Modified header
47
48
4.1 Conditional Retrieval
49
[Tags] optional
50
Get uri=entities/${ENTITY_ID_ENCODED}
51
${resp}= Get uri=/entities/${ENTITY_ID_ENCODED}
52
Should Be Equal As Strings ${resp.status_code} 304 msg=SHOULD return HTTP status code 304
53
54
# 4.2 Content Caching
55
56
4.3 Content Compression
57
${resp}= Get With Gzip uri=entities/${ENTITY_ID_ENCODED}
58
Should Be Equal As Strings ${resp.status_code} 200 msg=MUST support gzip compression
59
Dictionary Should Contain Item ${resp.headers} content-encoding gzip msg=MUST support gzip compression
You can’t perform that action at this time.