Collect debugs before tempest teardown
[integration/test.git] / csit / variables / Variables.py
1 """
2 Definitions of common variables for the system test robot suites of the
3 OpenDaylight project.
4
5 Authors: Baohua Yang@IBM, Denghui Huang@IBM
6 Edited: Many times by many people
7 """
8
9 # VM Environment defaults
10 DEFAULT_LINUX_PROMPT = '>'
11 DEFAULT_LINUX_PROMPT_STRICT = ']>'
12 DEFAULT_USER = 'jenkins'
13 DEFAULT_TIMEOUT = '30s'
14
15 # ODL system variables
16 ODL_SYSTEM_IP = '127.0.0.1'  # Override if ODL is not running locally to pybot
17 ODL_SYSTEM_IP_LIST = ['ODL_SYSTEM_1_IP', 'ODL_SYSTEM_2_IP', 'ODL_SYSTEM_3_IP']
18 ODL_SYSTEM_USER = DEFAULT_USER
19 ODL_SYSTEM_PASSWORD = ''  # empty means use public key authentication
20 ODL_SYSTEM_PROMPT = DEFAULT_LINUX_PROMPT
21
22 # "Tools" system variables (mininet etc).
23 TOOLS_SYSTEM_IP = '127.0.0.1'  # Override if tools are not run locally to pybot
24 TOOLS_SYSTEM_USER = DEFAULT_USER
25 TOOLS_SYSTEM_PASSWORD = ''  # empty means use public key authentication
26 TOOLS_SYSTEM_PROMPT = DEFAULT_LINUX_PROMPT
27
28 # KARAF Variables
29 KARAF_SHELL_PORT = '8101'
30 ESCAPE_CHARACTER = '\x1B'
31 KARAF_DETAILED_PROMPT = '@' + ESCAPE_CHARACTER + '[0m' + ESCAPE_CHARACTER + '[34mroot' + ESCAPE_CHARACTER + '[0m>'
32 KARAF_USER = 'karaf'
33 KARAF_PASSWORD = 'karaf'
34 KARAF_PROMPT = 'opendaylight-user'
35
36 # Logging levels
37 DEFAULT_ODL_LOG_LEVEL = 'INFO'
38 DEFAULT_BGPCEP_LOG_LEVEL = DEFAULT_ODL_LOG_LEVEL
39 DEFAULT_PROTOCOL_LOG_LEVEL = DEFAULT_BGPCEP_LOG_LEVEL
40 BGPCEP_LOG_LEVEL = DEFAULT_BGPCEP_LOG_LEVEL
41 PROTOCOL_LOG_LEVEL = BGPCEP_LOG_LEVEL
42
43 # BGP variables
44 ODL_BGP_PORT = '1790'
45 BGP_TOOL_PORT = '17900'
46
47 # Restconf variables
48 ODL_RESTCONF_USER = 'admin'
49 ODL_RESTCONF_PASSWORD = 'admin'
50
51 # Netconf variables
52 ODL_NETCONF_CONFIG_PORT = '1830'
53 ODL_NETCONF_MDSAL_PORT = '2830'
54 ODL_NETCONF_USER = 'admin'
55 ODL_NETCONF_PASSWORD = 'admin'
56 ODL_NETCONF_PROMPT = ']]>]]>'
57 ODL_NETCONF_NAMESPACE = 'urn:ietf:params:xml:ns:netconf:base:1.0'
58
59 # OpenFlow variables
60 ODL_OF_PORT = '6633'
61 ODL_OF_PLUGIN = 'lithium'
62
63 # VTN Coordinator Variables
64 VTNC = '127.0.0.1'
65 VTNCPORT = '8083'
66 VTNC_PREFIX = 'http://' + VTNC + ':' + VTNCPORT
67 VTNC_HEADERS = {'Content-Type': 'application/json',
68                 'username': 'admin', 'password': 'adminpass'}
69
70 VTNWEBAPI = '/vtn-webapi'
71 # controllers URL
72 CTRLS_CREATE = 'controllers.json'
73 CTRLS = 'controllers'
74 SW = 'switches'
75
76 # vtn URL
77 VTNS_CREATE = 'vtns.json'
78 VTNS = 'vtns'
79
80 # vbridge URL
81 VBRS_CREATE = 'vbridges.json'
82 VBRS = 'vbridges'
83
84 # interfaces URL
85 VBRIFS_CREATE = 'interfaces.json'
86 VBRIFS = 'interfaces'
87
88 # portmap URL
89 PORTMAP_CREATE = 'portmap.json'
90
91 # vlanmap URL
92 VLANMAP_CREATE = 'vlanmaps.json'
93
94 # ports URL
95 PORTS = 'ports/detail.json'
96
97 # flowlist URL
98 FLOWLISTS_CREATE = 'flowlists.json'
99
100 # flowlistentry_URL
101 FLOWLISTENTRIES_CREATE = 'flowlistentries.json'
102 FLOWLISTS = 'flowlists'
103
104 # flowfilter_URL
105 FLOWFILTERS_CREATE = 'flowfilters.json'
106 FLOWFILTERENTRIES_CREATE = 'flowfilterentries.json'
107 FLOWFILTERS = 'flowfilters/in'
108 FLOWFILTERS_UPDATE = 'flowfilterentries'
109
110
111 # Common APIs
112 CONFIG_NODES_API = '/restconf/config/opendaylight-inventory:nodes'
113 OPERATIONAL_NODES_API = '/restconf/operational/opendaylight-inventory:nodes'
114 OPERATIONAL_NODES_NETVIRT = '/restconf/operational/network-topology:network-topology/topology/netvirt:1'
115 OPERATIONAL_TOPO_API = '/restconf/operational/network-topology:' \
116                        'network-topology'
117 CONFIG_TOPO_API = '/restconf/config/network-topology:network-topology'
118 CONTROLLER_CONFIG_MOUNT = ('/restconf/config/network-topology:'
119                            'network-topology/topology'
120                            '/topology-netconf/node/'
121                            'controller-config/yang-ext:mount')
122 CONFIG_API = '/restconf/config'
123 OPERATIONAL_API = '/restconf/operational'
124 MODULES_API = '/restconf/modules'
125 VTN_INVENTORY_NODE_API = '/restconf/operational/vtn-inventory:vtn-nodes'
126
127 # NEMO Variables
128 PREDEFINE_ROLE_URI = '/restconf/config/nemo-user:user-roles'
129 PREDEFINE_NODE_URI = '/restconf/config/nemo-object:node-definitions'
130 PREDEFINE_CONNECTION_URI = '/restconf/config/nemo-object:connection-definitions'
131 REGISTER_TENANT_URI = '/restconf/operations/nemo-intent:register-user'
132 STRUCTURE_INTENT_URI = '/restconf/operations/nemo-intent:structure-style-nemo-update'
133 GET_INTENTS_URI = '/retconf/config/intent:intents'
134
135 # TOKEN
136 AUTH_TOKEN_API = '/oauth2/token'
137 REVOKE_TOKEN_API = '/oauth2/revoke'
138
139 # Vlan Custom Topology Path and File
140 CREATE_VLAN_TOPOLOGY_FILE = "vlan_vtn_test.py"
141 CREATE_VLAN_TOPOLOGY_FILE_PATH = "MininetTopo/" +\
142                                  CREATE_VLAN_TOPOLOGY_FILE
143
144 # Mininet Custom Topology Path and File for Path Policy
145 CREATE_PATHPOLICY_TOPOLOGY_FILE = "topo-3sw-2host_multipath.py"
146 CREATE_PATHPOLICY_TOPOLOGY_FILE_PATH = "MininetTopo/" +\
147                                        CREATE_PATHPOLICY_TOPOLOGY_FILE
148
149 GBP_REGEP_API = "/restconf/operations/endpoint:register-endpoint"
150 GBP_UNREGEP_API = "/restconf/operations/endpoint:unregister-endpoint"
151 GBP_ENDPOINTS_API = "/restconf/operational/endpoint:endpoints"
152 GBP_BASE_ENDPOINTS_API = "/restconf/operational/base-endpoint:endpoints"
153 GBP_TENANTS_API = "/restconf/config/policy:tenants"
154 OPERATIONAL_GBP_TENANTS_API = "/restconf/operational/policy:tenants"
155 GBP_TUNNELS_API = "/restconf/config/opendaylight-inventory:nodes"
156
157 # LISP Flow Mapping variables
158 LFM_RPC_API = "/restconf/operations/odl-mappingservice"
159 LFM_RPC_API_LI = "/restconf/operations/lfm-mapping-database"
160 LFM_SB_RPC_API = "/restconf/operations/odl-lisp-sb"
161
162 # Neutron
163 NEUTRON_NB_API = '/controller/nb/v2/neutron'
164 NEUTRON_NETWORKS_API = NEUTRON_NB_API + '/' + 'networks'
165 NEUTRON_SUBNETS_API = NEUTRON_NB_API + '/' + 'subnets'
166 NEUTRON_PORTS_API = NEUTRON_NB_API + '/' + 'ports'
167 NEUTRON_ROUTERS_API = NEUTRON_NB_API + '/' + 'routers'
168 OSREST = '/v2.0/networks'
169
170 # Openstack System Prompt
171 OS_SYSTEM_PROMPT = '$'
172
173 # Other global variables
174 # TODO: Move these to more apropriate sections.
175 PORT = '8080'
176 RESTPORT = '8282'
177 RESTCONFPORT = '8181'
178 OVSDBPORT = '6640'
179 CONTAINER = 'default'
180 PREFIX = 'http://' + ODL_SYSTEM_IP + ':' + PORT  # TODO: determine where this is used; create a better named variable
181 USER = 'admin'  # TODO: who is using this?  Can we make it more specific? (e.g.  RESTCONF_USER)
182 PWD = 'admin'
183 PASSWORD = 'EMPTY'
184 AUTH = [u'admin', u'admin']
185 SCOPE = 'sdn'
186 HEADERS = {'Content-Type': 'application/json'}
187 HEADERS_YANG_JSON = {'Content-Type': 'application/yang.data+json'}
188 HEADERS_XML = {'Content-Type': 'application/xml'}
189 ACCEPT_XML = {'Accept': 'application/xml'}
190 ACCEPT_JSON = {'Accept': 'application/json'}
191 ACCEPT_EMPTY = {}  # Json should be default, but no-output RPC cannot have Accept header.
192 ODL_CONTROLLER_SESSION = None
193 TOPO_TREE_LEVEL = 2
194 TOPO_TREE_DEPTH = 3
195 TOPO_TREE_FANOUT = 2
196 KEYFILE_PASS = 'any'
197 SSH_KEY = 'id_rsa'
198 CONTROLLER_STOP_TIMEOUT = 120  # Max number of seconds test will wait for a controller to stop
199 TOPOLOGY_URL = 'network-topology:network-topology/topology'
200 SEND_ACCEPT_XML_HEADERS = {'Content-Type': 'application/xml', 'Accept': 'application/xml'}
201
202 # Test deadlines global control
203 ENABLE_GLOBAL_TEST_DEADLINES = True
204
205 # Deprecated old variables, to be removed once all tests that need them are
206 # updated to use the new names.
207 CONTROLLER = ODL_SYSTEM_IP
208 CONTROLLERS = ['ODL_SYSTEM_1_IP', 'ODL_SYSTEM_2_IP', 'ODL_SYSTEM_3_IP']
209 CONTROLLER_PASSWORD = ODL_SYSTEM_PASSWORD
210 CONTROLLER_PROMPT = ODL_SYSTEM_PROMPT
211
212 # Centinel Variables
213 SET_CONFIGURATION_URI = '/restconf/operations/configuration:set-centinel-configurations'
214 GET_CONFIGURATION_URI = '/restconf/operational/configuration:configurationRecord/'
215 STREAMRECORD_CONFIG = '/restconf/config/stream:streamRecord'
216 SET_STREAMRECORD = '/restconf/operations/stream:set-stream'
217 ALERTFIELDCONTENTRULERECORD = '/restconf/config/alertrule:alertFieldContentRuleRecord/'
218 SET_ALERTFIELDCONTENTRULERECORD = '/restconf/operations/alertrule:set-alert-field-content-rule'
219 ALERTFIELDVALUERULERECORD = '/restconf/config/alertrule:alertFieldValueRuleRecord'
220 SET_ALERTFIELDVALUERULERECORD = '/restconf/operations/alertrule:set-alert-field-value-rule'
221 ALERTMESSAGECOUNTRULERECORD = '/restconf/config/alertrule:alertMessageCountRuleRecord/'
222 SET_ALERTMESSAGECOUNTRULERECORD = '/restconf/operations/alertrule:set-alert-message-count-rule'
223 GET_DASHBOARDRECORD = '/restconf/operational/dashboardrule:dashboardRecord/'
224 SET_DASHBOARDRECORD = '/restconf/operations/dashboardrule:set-dashboard'
225 DELETE_DASHBOARDRECORD = '/restconf/operations/dashboardrule:delete-dashboard'
226 SET_SUBSCRIBEUSER = '/restconf/operations/subscribe:subscribe-user'
227 SUBSCRIPTION = '/restconf/config/subscribe:subscription/'
228
229 # Elasticsearch Variables
230 ELASTICPORT = 9200