2 Documentation Test suite for ALTO simple IRD (Information Resource Dictionary)
4 Library RequestsLibrary
5 Library ../../../libraries/ALTO/AltoParser.py
6 Variables ../../../variables/Variables.py
7 Variables ../../../variables/alto/Variables.py
8 Resource ${CURDIR}/../../../libraries/TemplatedRequests.robot
10 Suite Setup Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
11 Suite Teardown Delete All Sessions
15 ${THE_FIRST_IRD_RESOURCE_ID} hello
16 ${THE_SECOND_IRD_RESOURCE_ID} world
17 ${RESOURCE_IN_FIRST_IRD} test-model-networkmap
18 ${RESOURCE_IN_SECOND_IRD} test-model-filtered-costmap
20 ${RANDOM_CONTEXT_ID} ${EMPTY}
24 Check the simple IRD information
25 [Documentation] Get the default IRD information
26 Wait Until Keyword Succeeds 20s 2s Check GET Response Code Equals 200 /${ALTO_SIMPLE_IRD_INFO}
27 ${resp} RequestsLibrary.Get Request session /${ALTO_SIMPLE_IRD_INFO}
28 ${context_id} ${BASE_URL} Get Basic Info ${resp.content}
29 Set Suite Variable ${BASE_URL}
30 Set Suite Variable ${RANDOM_CONTEXT_ID} ${context_id}
31 Wait Until Keyword Succeeds
34 ... Check GET Response Code Equals 200
35 ... /${RESOURCE_POOL_BASE}/${context_id}
38 [Documentation] Create two IRDs and verify their existence
39 Create An IRD ${DEFAULT_CONTEXT_ID} ${THE_FIRST_IRD_RESOURCE_ID}
40 Wait Until Keyword Succeeds
43 ... Check GET Response Code Equals 200
44 ... /${ALTO_OPERATIONAL_IRD_INSTANCE}/${THE_FIRST_IRD_RESOURCE_ID}
45 Create An IRD ${DEFAULT_CONTEXT_ID} ${THE_SECOND_IRD_RESOURCE_ID}
46 Wait Until Keyword Succeeds
49 ... Check GET Response Code Equals 200
50 ... /${ALTO_OPERATIONAL_IRD_INSTANCE}/${THE_SECOND_IRD_RESOURCE_ID}
52 Add one IRD configuration entry in one IRD instance
53 [Documentation] Add one IRD configuration entry in an IRD whose name is hello. Link IRD entry to one existed resource.
54 Wait Until Keyword Succeeds
57 ... Add An IRD Configuration Entry
58 ... ${THE_FIRST_IRD_RESOURCE_ID}
59 ... ${DEFAULT_CONTEXT_ID}
60 ... ${RESOURCE_IN_FIRST_IRD}
62 Wait Until Keyword Succeeds
65 ... Add An IRD Configuration Entry
66 ... ${THE_SECOND_IRD_RESOURCE_ID}
67 ... ${DEFAULT_CONTEXT_ID}
68 ... ${RESOURCE_IN_SECOND_IRD}
73 Check GET Response Code Equals 200
74 [Arguments] ${uri_without_ip_port}
75 ${resp} RequestsLibrary.Get Request session ${uri_without_ip_port}
76 Should Be True ${resp.status_code}==200
79 [Arguments] ${context_id} ${IRD_id}
81 ... {"ird-instance-configuration":{"entry-context":"/alto-resourcepool:context[alto-resourcepool:context-id='${context_id}']","instance-id":"${IRD_id}"}}
82 ${resp} RequestsLibrary.Put Request session /${ALTO_CONFIG_IRD_INSTANCE_CONFIG}/${IRD_id} data=${body}
83 Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
85 Add An IRD Configuration Entry
86 [Arguments] ${IRD_id} ${context_id} ${resource_id} ${base_url}
88 ... {"ird-configuration-entry":{"entry-id":"${resource_id}","instance":"/alto-resourcepool:context[alto-resourcepool:context-id='${context_id}']/alto-resourcepool:resource[alto-resourcepool:resource-id='${resource_id}']","path":"${base_url}/${resource_id}"}}
89 ${resp} RequestsLibrary.Put Request
91 ... /${ALTO_CONFIG_IRD_INSTANCE_CONFIG}/${IRD_id}/ird-configuration-entry/${resource_id}
93 Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}