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