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