2 Documentation Test suite for the arp handler module.
3 Suite Setup Create Session session http://${CONTROLLER}:8080 auth=${AUTH} headers=${HEADERS}
4 Suite Teardown Delete All Sessions
7 Library ../../libraries/RequestsLibrary.py
8 Library ../../libraries/Common.py
9 Variables ../../variables/Variables.py
14 ${REST_CONTEXT} /controller/nb/v2/subnetservice
15 ${REST_CONTEXT_HT} /controller/nb/v2/hosttracker
19 [Documentation] List subnets and verify default is there
21 ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/subnets
22 Should Be Equal As Strings ${resp.status_code} 200
23 ${result} To JSON ${resp.content}
24 ${subnet} Get From Dictionary ${result} ${key}
25 ${content} Get From List ${subnet} 0
26 Dictionary Should Contain Value ${content} 0.0.0.0/0
28 [Documentation] Ping h1 to h4, verify no packet loss
35 Should Contain ${result} 64 bytes
37 [Documentation] List hosts and verify h1 and h4
39 ${resp} Get session ${REST_CONTEXT_HT}/${CONTAINER}/hosts/active
40 Should Be Equal As Strings ${resp.status_code} 200
41 Should Contain ${resp.content} 10.0.0.1
42 Should Contain ${resp.content} 10.0.0.4
44 [Documentation] Add a subnet, list to validate the result.
46 ${body} Create Dictionary name ${name} subnet 11.0.0.254/8
47 ${resp} Put session ${REST_CONTEXT}/${CONTAINER}/subnet/${name} data=${body}
48 Should Be Equal As Strings ${resp.status_code} 201
49 ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/subnets
50 Should Be Equal As Strings ${resp.status_code} 200
51 ${result} To JSON ${resp.content}
52 ${content} Get From Dictionary ${result} ${key}
53 List Should Contain Value ${content} ${body}
55 [Documentation] Remove a subnet, list to validate the result.
57 ${body} Create Dictionary name ${name} subnet 11.0.0.254/8
58 ${resp} Delete session ${REST_CONTEXT}/${CONTAINER}/subnet/${name}
59 Should Be Equal As Strings ${resp.status_code} 204
60 ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/subnets
61 Should Be Equal As Strings ${resp.status_code} 200
62 ${result} To JSON ${resp.content}
63 ${content} Get From Dictionary ${result} ${key}
64 List Should Not Contain Value ${content} ${body}