~andreserl/maas/python3_qa_lab_tests

273.1.106 by Ricardo Banffy
Moved config items to separate config file so local testing can be built more easily
1
import os
2
import platform
3
4
# Environment variables that can be used to configure
5
# what is tested.
6
495.1.1 by Andres Rodriguez
Add ability to pause the CI before tests start running (MAAS will power on machines for enlistment)
7
# Whether or not to pause the CI. Useful when needing to use
8
# a static MAAS instance.
496.1.2 by Andres Rodriguez
Fix PAUSE_CI and KEEP_CI_RUNNING to correctly evaluate results
9
PAUSE_CI = bool(os.environ.get('PAUSE_CI', False))
495.1.1 by Andres Rodriguez
Add ability to pause the CI before tests start running (MAAS will power on machines for enlistment)
10
273.1.106 by Ricardo Banffy
Moved config items to separate config file so local testing can be built more easily
11
# Series to install on deployed nodes.
428 by Andres Rodriguez
update config
12
NODE_SERIES = os.environ.get('NODE_SERIES', 'xenial')
273.1.106 by Ricardo Banffy
Moved config items to separate config file so local testing can be built more easily
13
504 by Andres Rodriguez
Update control file to drop old dependencies
14
# MAAS user account
15
ADMIN_USER = "admin"
16
PASSWORD = "test"
17
273.1.106 by Ricardo Banffy
Moved config items to separate config file so local testing can be built more easily
18
# Whether or not the ARM nodes should be used
19
# in the test.
20
DO_NOT_USE_ARM_NODES = bool(
481 by Andres Rodriguez
Revert previous change as this enabled other arm nodes and not the GIGABYTE_SYSTEMS
21
    os.environ.get('DO_NOT_USE_ARM_NODES', True))
273.1.106 by Ricardo Banffy
Moved config items to separate config file so local testing can be built more easily
22
23
USE_ARM_NODES = not DO_NOT_USE_ARM_NODES
452.1.30 by Brendan Donegan
don't use ppc system by default
24
USE_PPC_NODES = bool(os.environ.get('USE_PPC_NODES', False))
482 by Andres Rodriguez
Add support to be able to disable the use of arm64 systems
25
USE_ARM64_NODES = bool(os.environ.get('USE_ARM64_NODES', False))
273.1.106 by Ricardo Banffy
Moved config items to separate config file so local testing can be built more easily
26
273.1.167 by Ricardo Banffy
Add the CLUSTER_CONTROLLER_IP var into config.py
27
CLUSTER_CONTROLLER_IP = '10.245.136.6'
28
325 by Ricardo Banffy
Use internal IPs for the proxies, PEP8 compliance
29
SQUID_DEB_PROXY_URL = 'http://10.55.32.185:8000'
273.1.165 by Ricardo Banffy
Removing duplicate definitions
30
# HTTP proxy used to access the external world.
330 by Ricardo Bánffy
Use external IP for proxy
31
HTTP_PROXY = "http://162.213.35.104:3128"
273.1.165 by Ricardo Banffy
Removing duplicate definitions
32
273.1.106 by Ricardo Banffy
Moved config items to separate config file so local testing can be built more easily
33
# Whether or not set the http proxy. Currently only working on raring
34
DO_NOT_SET_PROXY = bool("raring" not in platform.linux_distribution())
35
36
# Whether or not the cluster controller nodes in different network
37
# should be used.
38
USE_CC_NODES = bool(os.environ.get('USE_CC_NODES', False))
39
40
MAAS_URL = "http://10.245.136.6/MAAS"
440.1.5 by Andres Rodriguez
addressed comments
41
MAIN_ARCHIVE = "http://us.archive.ubuntu.com/ubuntu"
444.1.10 by Andres Rodriguez
Update
42
PORTS_ARCHIVE = "http://ports.ubuntu.com/ubuntu-ports"
273.1.106 by Ricardo Banffy
Moved config items to separate config file so local testing can be built more easily
43
USER_DATA_URL = "http://10.245.136.6/MAAS/metadata/enlist/latest/user-data"
44
493.1.2 by Brendan Donegan
make it a list of dicts, not a dict of dicts
45
SLAVES = [
493.1.3 by Brendan Donegan
syntax error in config
46
    {
493.1.4 by Brendan Donegan
nother syntax error
47
        "hostname": "lenovo-RD230-01",
493.1.1 by Brendan Donegan
refactor devices tests to consider both slaves
48
        "mac": "00:25:9C:2F:C7:9E",
49
        "ip": "10.245.136.5",
50
    },
496.2.6 by Andres Rodriguez
Updates
51
    # Jenkins master running on on old jenkins slave.
52
    # Currently used as the new lander
53
    {
54
        "hostname": "lenovo-RD230-01-jenkins-master",
55
        "mac": "00:e0:81:dd:d1:cf",
56
        "ip": "10.245.136.2",
496.2.7 by Andres Rodriguez
Fix typo
57
    },
493.1.3 by Brendan Donegan
syntax error in config
58
    {
493.1.4 by Brendan Donegan
nother syntax error
59
        "hostname": "HP-DL360-Gen9",
493.1.1 by Brendan Donegan
refactor devices tests to consider both slaves
60
        "mac": "94:18:82:76:C0:64",
61
        "ip": "10.245.136.7",
496.2.6 by Andres Rodriguez
Updates
62
    },
493.1.2 by Brendan Donegan
make it a list of dicts, not a dict of dicts
63
]
455.1.1 by Brendan Donegan
Create a device representing the CI slave and link the slaves actual IP to it
64
459.3.6 by Brendan Donegan
Move REGION_DHCP_CONFIG into config.py
65
# Uses the pre-1.6 API, where a cluster interface had no "name" field.
66
# MAAS will take the name from the "interface" field, as long as it's
67
# a unique name within the cluster.  Newer clients would pass a name.
68
REGION_DHCP_CONFIG = {
69
    "ip": "10.245.136.6",
70
    "interface": "eth1",
71
    "subnet_mask": "255.255.248.0",
72
    "broadcast_ip": "10.245.143.255",
73
    "router_ip": "10.245.136.1",
74
    "management": 2,
75
    "ip_range_low": "10.245.136.10",
76
    "ip_range_high": "10.245.136.200",
77
    # add cidr as it is now default in new networking configs.
78
    "cidr": "10.245.136.0/21"
79
}
80
504 by Andres Rodriguez
Update control file to drop old dependencies
81
# Lenovo machines
82
POWER_USER = "root"
83
POWER_PASS = "ubuntu"
273.1.106 by Ricardo Banffy
Moved config items to separate config file so local testing can be built more easily
84
REGION_CONTROLLER_NODES = {
324.1.2 by Ricardo Bánffy
Added extra machine names to config.py
85
    # lenovo-RD230-03, MAAS-03
273.1.106 by Ricardo Banffy
Moved config items to separate config file so local testing can be built more easily
86
    "00:E0:81:DD:D5:99": "10.245.143.103",
324.1.2 by Ricardo Bánffy
Added extra machine names to config.py
87
    # lenovo-RD230-04, MAAS-04
503 by Andres Rodriguez
Update config
88
    #"00:E0:81:DD:D1:0B": "10.245.143.104", # TODO: Investigate. Seems broken
324.1.2 by Ricardo Bánffy
Added extra machine names to config.py
89
    # lenovo-RD230-06, MAAS-06
466.2.1 by Brendan Donegan
Re-add machines that seem to be working
90
    "00:E0:81:D1:B1:47": "10.245.143.106",
324.1.2 by Ricardo Bánffy
Added extra machine names to config.py
91
    # lenovo-RD230-07, MAAS-07
440.1.2 by Andres Rodriguez
fix
92
    "00:E0:81:DD:D1:1B": "10.245.143.107",
324.1.2 by Ricardo Bánffy
Added extra machine names to config.py
93
    # lenovo-RD230-08, MAAS-08
440.1.2 by Andres Rodriguez
fix
94
    "00:E0:81:DD:D1:2B": "10.245.143.108",
466.2.1 by Brendan Donegan
Re-add machines that seem to be working
95
    # lenovo-RD230-10, MAAS-10
96
    "00:E0:81:DC:38:6D": "10.245.143.110",
423 by Andres Rodriguez
fix test_assign_machines_to_test_zone
97
}
98
478.1.1 by Brendan Donegan
block off .143.100-200 so that we have plenty of BMC address to work with
99
BMC_START_IP = '10.245.143.100'
100
BMC_END_IP = '10.245.143.200'
438.2.4 by Brendan Donegan
Add BMC_START/END_IP
101
503 by Andres Rodriguez
Update config
102
CLUSTER_CONTROLLER_NODES = None
273.1.106 by Ricardo Banffy
Moved config items to separate config file so local testing can be built more easily
103
104
LENOVO_LAB = REGION_CONTROLLER_NODES
105
if USE_CC_NODES:
106
    LENOVO_LAB.update(CLUSTER_CONTROLLER_NODES)
107
108
# TODO: mapping is outdated.
109
ARM_LAB = {
110
    'fc:2f:40:d8:fb:1a': '192.168.21.50',
111
    'fc:2f:40:fa:2f:9a': '192.168.21.51',
112
    'fc:2f:40:ec:73:42': '192.168.21.52',
113
    'fc:2f:40:d5:87:ce': '192.168.21.53'
325 by Ricardo Banffy
Use internal IPs for the proxies, PEP8 compliance
114
}
273.1.106 by Ricardo Banffy
Moved config items to separate config file so local testing can be built more easily
115
503 by Andres Rodriguez
Update config
116
# PPC64LE
452.1.6 by Brendan Donegan
refactor power commands so they work with the ppc system and restart image import rather than just starting
117
PPC_SYSTEMS = {
452.1.21 by Brendan Donegan
wrong mac for powerpc
118
    '98:BE:94:02:6A:C8': '10.245.143.113',
452.1.6 by Brendan Donegan
refactor power commands so they work with the ppc system and restart image import rather than just starting
119
}
503 by Andres Rodriguez
Update config
120
121
# ARM64
122
GIGABYTE_USER = "admin"
123
GIGABYTE_PASS = "password"
461.2.1 by Brendan Donegan
add gigabyte server to ci
124
GIGABYTE_SYSTEMS = {
461.2.9 by Brendan Donegan
remove pause and update setting of power parameters
125
    '1c:1b:0d:0d:52:7c': '10.245.143.114',
461.2.1 by Brendan Donegan
add gigabyte server to ci
126
}
452.1.6 by Brendan Donegan
refactor power commands so they work with the ppc system and restart image import rather than just starting
127
503 by Andres Rodriguez
Update config
128
# HP Gen9
483.1.2 by Brendan Donegan
Add Gen9 systems to the CI
129
GEN9_USER = 'Administrator'
130
GEN9_PASS = 'insecure'
131
GEN9_SYSTEMS = {
132
    "94:18:82:7a:72:44": "10.245.143.116",
503 by Andres Rodriguez
Update config
133
    "94:18:82:7a:72:64": "10.245.143.117", # Investigate
483.1.2 by Brendan Donegan
Add Gen9 systems to the CI
134
    "94:18:82:7a:82:c8": "10.245.143.118",
135
    "94:18:82:7a:72:80": "10.245.143.119",
136
}
137
504.1.1 by Andres Rodriguez
Add landscape systems to the CI
138
# Landscape hardware
139
LANDSCAPE_USER = 'landscape'
140
LANDSCAPE_PASS = 'insecure'
141
LANDSCAPE_SYSTEMS = {
142
    "2c:59:e5:4a:be:cc": "10.245.143.122", # amco
143
    "2c:59:e5:3b:c0:e4": "10.245.143.123", # barley
144
    "ec:b1:d7:80:00:08": "10.245.143.124", # lapras
145
    "ec:b1:d7:7f:ef:94": "10.245.143.125", # pidgey
146
    "2c:59:e5:3b:11:28": "10.245.143.126", # squier
147
    "ec:b1:d7:7f:ef:34": "10.245.143.127", # stunky
148
}
149
496.2.1 by Andres Rodriguez
Add support for Dell Servers
150
# Dell Hardware for CentOS / Windows CI testing
496.2.5 by Andres Rodriguez
Fix typos
151
USE_DELL_R630_SYSTEMS = bool(os.environ.get('USE_DELL_R630_SYSTEMS', False))
503 by Andres Rodriguez
Update config
152
DELL_R630_USER = "root"
153
DELL_R630_PASS = "calvin"
496.2.1 by Andres Rodriguez
Add support for Dell Servers
154
DELL_R630_SYSTEMS = {
155
    "f4:8e:38:d0:0e:d2": "10.245.143.120", # natasha
156
    "f4:8e:38:d0:0b:54": "10.245.143.121", # opelt
157
}
158
505.1.9 by Andres Rodriguez
Fix evaluation of variable
159
TEST_CUSTOM_IMAGES = bool(int(os.environ.get('TEST_CUSTOM_IMAGES', False)))
505.1.4 by Andres Rodriguez
Update suggestion
160
CUSTOM_IMAGES_SOURCE = os.environ.get(
505.1.6 by Andres Rodriguez
minor fix
161
                           'CUSTOM_IMAGES_SOURCE',
162
                           'http://10.245.136.7/images/streams/v1/index.json')
505.1.2 by Andres Rodriguez
Add support for testing with custom iamges
163
476.1.28 by Brendan Donegan
Only test windows if we ask to
164
TEST_WINDOWS = bool(os.environ.get('TEST_WINDOWS', False))
476.1.13 by Brendan Donegan
upload from local location
165
WINDOWS_IMAGE = "/home/ubuntu/windows-win2012hvr2-amd64-root-dd"
476.1.2 by Brendan Donegan
Download the image and deploy windows
166
273.1.106 by Ricardo Banffy
Moved config items to separate config file so local testing can be built more easily
167
# dnssec is now enabled by default, so disable it to avoid errors from the
168
# forwarder server.
169
# See StackOverflow question "ns got insecure response, parent indicates
170
# it should be secure": http://bit.ly/1pe8Hkk
171
LAB_DNS_CONFIG = """
172
options {
173
    directory "/var/cache/bind";
174
    forwarders {
175
    10.245.136.1;
176
    };
177
    allow-query-cache {any;};
178
    dnssec-enable no;
179
    dnssec-validation no;
180
    auth-nxdomain no;    # conform to RFC1035
181
};
182
"""
183
184
JUJU_CONFIG = """
185
default: maas
186
environments:
187
  maas:
188
    type: maas
189
    maas-server: '%s'
190
    maas-oauth: '%s'
191
    bootstrap-timeout: 18000
192
    admin-secret: 'nothing'
193
    default-series: %s
194
    logging-config: <root>=TRACE
273.1.184 by Blake Rouse
Fix juju config to not use LXC networking.
195
    disable-network-management: true
273.1.106 by Ricardo Banffy
Moved config items to separate config file so local testing can be built more easily
196
"""
433.2.46 by Brendan Donegan
Reinstate DO_NOT_TEST_JUJU as it may be useful later
197
444.2.12 by Brendan Donegan
Reverse to TEST_JUJU
198
TEST_JUJU = bool(os.environ.get('TEST_JUJU', False))