de3ad9735ecf39b71f768afe1f963df806180fdd
[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_USER = 'jenkins'
12 DEFAULT_TIMEOUT = '30s'
13
14 # ODL system variables
15 ODL_SYSTEM_IP = '127.0.0.1'  # Override if ODL is not running locally to pybot
16 ODL_SYSTEM_IP_LIST = ['ODL_SYSTEM_1_IP', 'ODL_SYSTEM_2_IP', 'ODL_SYSTEM_3_IP']
17 ODL_SYSTEM_USER = DEFAULT_USER
18 ODL_SYSTEM_PASSWORD = ''  # empty means use public key authentication
19 ODL_SYSTEM_PROMPT = DEFAULT_LINUX_PROMPT
20
21 # "Tools" system variables (mininet etc).
22 TOOLS_SYSTEM_IP = '127.0.0.1'  # Override if tools are not run locally to pybot
23 TOOLS_SYSTEM_USER = DEFAULT_USER
24 TOOLS_SYSTEM_PASSWORD = ''  # empty means use public key authentication
25 TOOLS_SYSTEM_PROMPT = DEFAULT_LINUX_PROMPT
26
27 # KARAF Variables
28 KARAF_SHELL_PORT = '8101'
29 ESCAPE_CHARACTER = '\x1B'
30 KARAF_DETAILED_PROMPT = '@' + ESCAPE_CHARACTER + '[0m' + ESCAPE_CHARACTER + '[34mroot' + ESCAPE_CHARACTER + '[0m>'
31 KARAF_USER = 'karaf'
32 KARAF_PASSWORD = 'karaf'
33 KARAF_PROMPT = 'opendaylight-user'
34
35 # Logging levels
36 DEFAULT_ODL_LOG_LEVEL = 'INFO'
37 DEFAULT_BGPCEP_LOG_LEVEL = DEFAULT_ODL_LOG_LEVEL
38 DEFAULT_PROTOCOL_LOG_LEVEL = DEFAULT_BGPCEP_LOG_LEVEL
39 BGPCEP_LOG_LEVEL = DEFAULT_BGPCEP_LOG_LEVEL
40 PROTOCOL_LOG_LEVEL = BGPCEP_LOG_LEVEL
41
42 # BGP variables
43 ODL_BGP_PORT = '1790'
44 BGP_TOOL_PORT = '17900'
45
46 # Netconf variables
47 ODL_NETCONF_PORT = '2830'
48 ODL_NETCONF_USER = 'admin'
49 ODL_NETCONF_PASSWORD = 'admin'
50 ODL_NETCONF_PROMPT = ']]>]]>'
51 ODL_NETCONF_NAMESPACE = 'urn:ietf:params:xml:ns:netconf:base:1.0'
52
53 # OpenFlow variables
54 ODL_OF_PLUGIN = 'lithium'
55
56 # VTN Coordinator Variables
57 VTNC = '127.0.0.1'
58 VTNCPORT = '8083'
59 VTNC_PREFIX = 'http://' + VTNC + ':' + VTNCPORT
60 VTNC_HEADERS = {'Content-Type': 'application/json',
61                 'username': 'admin', 'password': 'adminpass'}
62
63 VTNWEBAPI = '/vtn-webapi'
64 # controllers URL
65 CTRLS_CREATE = 'controllers.json'
66 CTRLS = 'controllers'
67 SW = 'switches'
68
69 # vtn URL
70 VTNS_CREATE = 'vtns.json'
71 VTNS = 'vtns'
72
73 # vbridge URL
74 VBRS_CREATE = 'vbridges.json'
75 VBRS = 'vbridges'
76
77 # interfaces URL
78 VBRIFS_CREATE = 'interfaces.json'
79 VBRIFS = 'interfaces'
80
81 # portmap URL
82 PORTMAP_CREATE = 'portmap.json'
83
84 # vlanmap URL
85 VLANMAP_CREATE = 'vlanmaps.json'
86
87 # ports URL
88 PORTS = 'ports/detail.json'
89
90 # flowlist URL
91 FLOWLISTS_CREATE = 'flowlists.json'
92
93 # flowlistentry_URL
94 FLOWLISTENTRIES_CREATE = 'flowlistentries.json'
95 FLOWLISTS = 'flowlists'
96
97 # flowfilter_URL
98 FLOWFILTERS_CREATE = 'flowfilters.json'
99 FLOWFILTERENTRIES_CREATE = 'flowfilterentries.json'
100 FLOWFILTERS = 'flowfilters/in'
101 FLOWFILTERS_UPDATE = 'flowfilterentries'
102
103
104 # Common APIs
105 CONFIG_NODES_API = '/restconf/config/opendaylight-inventory:nodes'
106 OPERATIONAL_NODES_API = '/restconf/operational/opendaylight-inventory:nodes'
107 OPERATIONAL_NODES_NETVIRT = '/restconf/operational/network-topology:network-topology/topology/netvirt:1'
108 OPERATIONAL_TOPO_API = '/restconf/operational/network-topology:' \
109                        'network-topology'
110 CONFIG_TOPO_API = '/restconf/config/network-topology:network-topology'
111 CONTROLLER_CONFIG_MOUNT = ('/restconf/config/network-topology:'
112                            'network-topology/topology'
113                            '/topology-netconf/node/'
114                            'controller-config/yang-ext:mount')
115 CONFIG_API = '/restconf/config'
116 OPERATIONAL_API = '/restconf/operational'
117 MODULES_API = '/restconf/modules'
118
119 # NEMO Variables
120 PREDEFINE_ROLE_URI = '/restconf/config/nemo-user:user-roles'
121 PREDEFINE_NODE_URI = '/restconf/config/nemo-object:node-definitions'
122 PREDEFINE_CONNECTION_URI = '/restconf/config/nemo-object:connection-definitions'
123 REGISTER_TENANT_URI = '/restconf/operations/nemo-intent:register-user'
124 STRUCTURE_INTENT_URI = '/restconf/operations/nemo-intent:structure-style-nemo-update'
125 GET_INTENTS_URI = '/retconf/config/intent:intents'
126
127 # TOKEN
128 AUTH_TOKEN_API = '/oauth2/token'
129 REVOKE_TOKEN_API = '/oauth2/revoke'
130
131 # Base Mininet Mac address. DPID of mininet switches will be derived from this.
132 BASE_MAC_1 = '00:4b:00:00:00:00'
133 # Base IP of mininet hosts
134 BASE_IP_1 = '75.75.0.0'
135
136 # Vlan Custom Topology Path and File
137 CREATE_VLAN_TOPOLOGY_FILE = "vlan_vtn_test.py"
138 CREATE_VLAN_TOPOLOGY_FILE_PATH = "MininetTopo/" +\
139                                  CREATE_VLAN_TOPOLOGY_FILE
140
141 # Mininet Custom Topology Path and File
142 CREATE_FULLYMESH_TOPOLOGY_FILE = "create_fullymesh.py"
143 CREATE_FULLYMESH_TOPOLOGY_FILE_PATH = "libraries/MininetTopo/" +\
144                                       CREATE_FULLYMESH_TOPOLOGY_FILE
145
146 # Mininet Custom Topology Path and File for Path Policy
147 CREATE_PATHPOLICY_TOPOLOGY_FILE = "topo-3sw-2host_multipath.py"
148 CREATE_PATHPOLICY_TOPOLOGY_FILE_PATH = "MininetTopo/" +\
149                                        CREATE_PATHPOLICY_TOPOLOGY_FILE
150
151 GBP_REGEP_API = "/restconf/operations/endpoint:register-endpoint"
152 GBP_UNREGEP_API = "/restconf/operations/endpoint:unregister-endpoint"
153 GBP_TENANTS_API = "/restconf/config/policy:tenants"
154 GBP_TUNNELS_API = "/restconf/config/opendaylight-inventory:nodes"
155
156 # LISP Flow Mapping variables
157 LFM_RPC_API = "/restconf/operations/odl-mappingservice"
158 LFM_RPC_API_LI = "/restconf/operations/lfm-mapping-database"
159 LFM_SB_RPC_API = "/restconf/operations/odl-lisp-sb"
160
161 # Other global variables
162 # TODO: Move these to more apropriate sections.
163 PORT = '8080'
164 RESTPORT = '8282'
165 RESTCONFPORT = '8181'
166 OVSDBPORT = '6640'
167 CONTAINER = 'default'
168 PREFIX = 'http://' + ODL_SYSTEM_IP + ':' + PORT  # TODO: determine where this is used; create a better named variable
169 USER = 'admin'  # TODO: who is using this?  Can we make it more specific? (e.g.  RESTCONF_USER)
170 PWD = 'admin'
171 PASSWORD = 'EMPTY'
172 AUTH = [u'admin', u'admin']
173 SCOPE = 'sdn'
174 HEADERS = {'Content-Type': 'application/json'}
175 HEADERS_YANG_JSON = {'Content-Type': 'application/yang.data+json'}
176 HEADERS_XML = {'Content-Type': 'application/xml'}
177 ACCEPT_XML = {'Accept': 'application/xml'}
178 ACCEPT_JSON = {'Accept': 'application/json'}
179 ODL_CONTROLLER_SESSION = None
180 TOPO_TREE_LEVEL = 2
181 TOPO_TREE_DEPTH = 3
182 TOPO_TREE_FANOUT = 2
183 KEYFILE_PASS = 'any'
184 SSH_KEY = 'id_rsa'
185 CONTROLLER_STOP_TIMEOUT = 120  # Max number of seconds test will wait for a controller to stop
186 TOPOLOGY_URL = 'network-topology:network-topology/topology'
187 SEND_ACCEPT_XML_HEADERS = {'Content-Type': 'application/xml', 'Accept': 'application/xml'}
188
189 # Test deadlines global control
190 ENABLE_GLOBAL_TEST_DEADLINES = True
191
192 # Deprecated old variables, to be removed once all tests that need them are
193 # updated to use the new names.
194 CONTROLLER = ODL_SYSTEM_IP
195 CONTROLLERS = ['CONTROLLER', 'CONTROLLER1', 'CONTROLLER2']
196 CONTROLLER_PASSWORD = ODL_SYSTEM_PASSWORD
197 CONTROLLER_PROMPT = ODL_SYSTEM_PROMPT
198 MININET = TOOLS_SYSTEM_IP
199 MININET_USER = TOOLS_SYSTEM_USER
200 MININET_PASSWORD = TOOLS_SYSTEM_PASSWORD
201 MININET_PROMPT = TOOLS_SYSTEM_PROMPT
202 PROMPT = '>'  # TODO: remove this as it's vague.  need to fix any occurances of it first.