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