2 Documentation Testing of Group Based Policy Neutron-Mapper
3 Suite Setup Devstack Suite Setup Tests
4 Suite Teardown Clean Suite
6 Library OperatingSystem
7 Library RequestsLibrary
9 Resource Variables.robot
10 Resource ../../../../variables/gbp/Constants.robot
11 Resource ../../../../libraries/Utils.robot
12 Resource ../../../../libraries/GBP/RestconfUtils.robot
13 Resource ../../../../libraries/GBP/AssertionUtils.robot
14 Resource ../../../../libraries/DevstackUtils.robot
15 Resource ../../../../libraries/OpenStackOperations.robot
18 ${NETWORK_NAME} net123
19 ${SUBNET_NAME} subnet123
20 ${CLIENT_SG} client_sg
21 ${SERVER_SG} server_sg
22 ${TENANTS_CONF_PATH} restconf/config/policy:tenants
23 ${CLIENT_PORT_IP} 10.0.0.5
24 ${SERVER_PORT_IP} 10.0.0.6
25 ${CLIENT_PORT_NAME} client
26 ${SERVER_PORT_NAME} server
27 ${REMOTE_IP_PREFIX} 10.0.0.0/24
28 ${SUBNET_IP_PREFIX} 10.0.0.0/24
29 ${ROUTER_NAME} router123
44 Test Resolve Tenant ID
45 [Documentation] Test reading tenant id from default security group
46 ${tenant_id} Get Tenant ID From Security Group
47 ${tenant_id}= To Uuid ${tenant_id}
48 Should Match Regexp ${tenant_id} ${UUID_PATTERN}
49 Set Global Variable ${TENANT_ID} ${tenant_id}
52 [Documentation] Create sec group and verify data generated in GBP
53 ${uuid} Create Network net123 verbose=FALSE
54 ${l2_fd_id} Should Match Regexp ${uuid} ${UUID_PATTERN}
55 ${l2_fd_path} Get L2 Flood Domain Path ${TENANT_ID} ${l2_fd_id}
56 ${l2_fd} Get Data From URI session ${l2_fd_path} headers=${headers}
57 ${l2_bd_id} Assert L2-Flood-Domain ${l2_fd} ${NETWORK_NAME}
58 ${l2_bd_path} Get L2 Bridge Domain Path ${TENANT_ID} ${l2_bd_id}
59 ${l2_bd} Get Data From URI session ${l2_bd_path} headers=${headers}
60 ${l3_ctx_id} Assert L2-Bridge-Domain ${l2_bd} ${NETWORK_NAME}
61 ${l3_ctx_path} Get L3 Context Path ${TENANT_ID} ${l3_ctx_id}
62 ${l3_ctx} Get Data From URI session ${l3_ctx_path} headers=${headers}
63 Assert L3-Context ${l3_ctx} ${NETWORK_NAME}
64 Set Global Variable ${FLOOD_DOMAIN_ID} ${l2_fd_id}
65 Set Global Variable ${BRIDGE_DOMAIN_ID} ${l2_bd_id}
66 Set Global Variable ${L3_CONTEXT_ID} ${l3_ctx_id}
69 Create Neutron Entity And Return ID
70 [Documentation] Designed for creating neutron entities and returing their IDs.
71 [Arguments] ${cmd} ${pattern}=${UUID_PATTERN}
72 ${output} Write Commands Until Prompt ${cmd} | grep -w id | awk '{print $4}'
73 Should Not Be Empty ${output}
74 ${id} Should Match Regexp ${output} ${pattern}
78 [Documentation] Insert dashes if missing to generate proper UUID string.
79 [Arguments] ${init_string}
80 Should Match Regexp ${init_string} ${UUID_NO_DASHES}
81 ${first} Get Substring ${init_string} 0 8
82 ${second} Get Substring ${init_string} 8 12
83 ${third} Get Substring ${init_string} 12 16
84 ${fourth} Get Substring ${init_string} 16 20
85 ${fifth} Get Substring ${init_string} 20 32
86 [Return] ${first}-${second}-${third}-${fourth}-${fifth}
89 [Documentation] Clears Openstack. This is also helpful when debugging tests locally.
90 ${output} Write Commands Until Prompt neutron net-delete net123
91 Should Match Regexp ${output} Deleted|Removed