blob: 053b2824daa9620910e5cb704a0cc4c74b9406df [file] [log] [blame]
Gary Wu9abb61c2018-09-27 10:38:50 -07001*** Settings ***
2Library Collections
3Library RequestsLibrary
4Library OperatingSystem
5Library json
6
7
8*** Test Cases ***
9Check service up/non existent namespace
10 CreateSession checkerservice http://localhost:8080
11 &{headers}= Create Dictionary Accept=application/json
12 ${resp}= Get Request checkerservice /check_template/nosuchcatalog headers=${headers}
13 Should Be Equal As Strings ${resp.status_code} 404
14
15Check standalone template
16 CreateSession checkerservice http://localhost:8080
17 ${data}= Get Binary File ${CURDIR}${/}data${/}standalone.yaml
18 &{headers}= Create Dictionary Accept=application/json
19 ${resp}= Post Request checkerservice /check_template/ data=${data} headers=${headers}
20 Log Response received from checker ${resp.text}
21 Should Be Equal As Strings ${resp.status_code} 200
22 Should Be Equal As Strings ${resp.text} []
23
24Check standalone template with errors
25 CreateSession checkerservice http://localhost:8080
26 ${data}= Get Binary File ${CURDIR}${/}data${/}standalone_with_errors.yaml
27 &{headers}= Create Dictionary Accept=application/json
28 ${resp}= Post Request checkerservice /check_template/ data=${data} headers=${headers}
29 Log Response received from checker ${resp.text}
30 Should Be Equal As Strings ${resp.status_code} 200
31 Should Not Be Equal As Strings ${resp.text} []
32
33Check schema new namespace
34 CreateSession checkerservice http://localhost:8080
35 ${data}= Get Binary File ${CURDIR}${/}data${/}test_schema.yaml
36 &{headers}= Create Dictionary Accept=application/json
37 ${resp}= Post Request checkerservice /check_template/test/schema.yaml data=${data} headers=${headers}
38 Log Response received from checker ${resp.text}
39 Should Be Equal As Strings ${resp.status_code} 200
40 Should Be Equal As Strings ${resp.text} []
41
42Check template in namespace
43 CreateSession checkerservice http://localhost:8080
44 ${data}= Get Binary File ${CURDIR}${/}data${/}test_template.yaml
45 &{headers}= Create Dictionary Accept=application/json
46 ${resp}= Post Request checkerservice /check_template/test/ data=${data} headers=${headers}
47 Log Response received from checker ${resp.text}
48 Should Be Equal As Strings ${resp.status_code} 200
49 Should Be Equal As Strings ${resp.text} []
50
51Check named template does not exist
52 CreateSession checkerservice http://localhost:8080
53 &{headers}= Create Dictionary Accept=application/json
54 ${resp}= Get Request checkerservice /check_template/test/nosuchtemplate.yaml headers=${headers}
55 Should Be Equal As Strings ${resp.status_code} 404
56
57Check delete existing namespace
58 CreateSession checkerservice http://localhost:8080
59 &{headers}= Create Dictionary Accept=application/json
60 ${resp}= Delete Request checkerservice /check_template/test/ headers=${headers}
61 Log Response received from checker ${resp.text}
62 Should Be Equal As Strings ${resp.status_code} 200