Skip to content

Commit 05d57f2

Browse files
committed
WIP: Add separate-machine-basic-suite-master
Change-Id: I38f174d79b855c799483dd49218532a6ff13e44f Signed-off-by: Yedidyah Bar David <[email protected]>
1 parent 06d0972 commit 05d57f2

18 files changed

+428
-0
lines changed
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
{
2+
"networks": {
3+
"management": {
4+
"comment": "management generates DNS entries for ost-$suite-$nic, e.g. ost-basic-suite-master-engine",
5+
"is_management": true,
6+
"template": "common/libvirt-templates/net_template",
7+
"nics": [
8+
"engine",
9+
"dwh",
10+
"host-0",
11+
"host-1",
12+
"storage"
13+
]
14+
},
15+
"storage": {
16+
"template": "common/libvirt-templates/net_template",
17+
"nics": [
18+
"engine-storage",
19+
"dwh-storage",
20+
"host-0-storage",
21+
"host-1-storage",
22+
"storage-storage"
23+
]
24+
},
25+
"bonding": {
26+
"template": "common/libvirt-templates/net_template",
27+
"nics": [
28+
"host-0-eth2",
29+
"host-0-eth3",
30+
"host-1-eth2",
31+
"host-1-eth3"
32+
]
33+
}
34+
},
35+
"vms" : {
36+
"engine": {
37+
"template": "common/libvirt-templates/vm_template",
38+
"memory": "3584",
39+
"deploy-scripts": [
40+
"common/deploy-scripts/setup_engine.sh"
41+
],
42+
"nics": {
43+
"engine": { "template": "common/libvirt-templates/nic_template" },
44+
"engine-storage": { "template": "common/libvirt-templates/nic_template" }
45+
},
46+
"root_disk_var": "OST_IMAGES_ENGINE_INSTALLED",
47+
"disks": {}
48+
},
49+
"dwh": {
50+
"template": "common/libvirt-templates/vm_template",
51+
"memory": "3584",
52+
"deploy-scripts": [
53+
"common/deploy-scripts/setup_engine.sh"
54+
],
55+
"nics": {
56+
"dwh": { "template": "common/libvirt-templates/nic_template" },
57+
"dwh-storage": { "template": "common/libvirt-templates/nic_template" }
58+
},
59+
"root_disk_var": "OST_IMAGES_ENGINE_INSTALLED",
60+
"disks": {}
61+
},
62+
"storage": {
63+
"template": "common/libvirt-templates/vm_template",
64+
"memory": "2048",
65+
"deploy-scripts": [
66+
"common/deploy-scripts/setup_storage.sh"
67+
],
68+
"nics": {
69+
"storage": { "template": "common/libvirt-templates/nic_template" },
70+
"storage-storage": { "template": "common/libvirt-templates/nic_template" }
71+
},
72+
"root_disk_var": "OST_IMAGES_STORAGE_BASE",
73+
"disks": {
74+
"sda": {
75+
"comment": "Main NFS device",
76+
"template": "common/libvirt-templates/disk_template",
77+
"size": "101G"
78+
},
79+
"sdb": {
80+
"comment": "Main iSCSI device",
81+
"template": "common/libvirt-templates/disk_template",
82+
"size": "191G"
83+
}
84+
}
85+
},
86+
"host-0": {
87+
"template": "common/libvirt-templates/vm_template",
88+
"memory": "1792",
89+
"deploy-scripts": [
90+
"common/deploy-scripts/setup_host.sh"
91+
],
92+
"nics": {
93+
"host-0": { "template": "common/libvirt-templates/nic_template" },
94+
"host-0-storage": { "template": "common/libvirt-templates/nic_template" },
95+
"host-0-eth2": { "template": "common/libvirt-templates/nic_template" },
96+
"host-0-eth3": { "template": "common/libvirt-templates/nic_template" }
97+
},
98+
"root_disk_var": "OST_IMAGES_HOST_INSTALLED",
99+
"disks": {}
100+
},
101+
"host-1": {
102+
"template": "common/libvirt-templates/vm_template",
103+
"memory": "1792",
104+
"deploy-scripts": [
105+
"common/deploy-scripts/setup_host.sh"
106+
],
107+
"nics": {
108+
"host-1": { "template": "common/libvirt-templates/nic_template" },
109+
"host-1-storage": { "template": "common/libvirt-templates/nic_template" },
110+
"host-1-eth2": { "template": "common/libvirt-templates/nic_template" },
111+
"host-1-eth3": { "template": "common/libvirt-templates/nic_template" }
112+
},
113+
"root_disk_var": "OST_IMAGES_NODE",
114+
"disks": {}
115+
}
116+
}
117+
}

ost_utils/backend/base.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,13 @@ def hostnames(self):
138138
def engine_hostname(self):
139139
return next(hn for hn in self.hostnames() if "engine" in hn)
140140

141+
@cache
142+
def dwh_hostname(self):
143+
# This means I can't call the suite I added this for 'separate-dwh-basic-suite-master',
144+
# because it will collide. Already gave up on making this code more robust, so not
145+
# adding a "to do"...
146+
return next(hn for hn in self.hostnames() if "dwh" in hn)
147+
141148
@cache
142149
def hosts_hostnames(self):
143150
# The output should always be sorted, so we can refer by indices

ost_utils/pytest/fixtures/ansible.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ def ansible_engine(ansible_by_hostname, backend_engine_hostname):
2626
return ansible_by_hostname(backend_engine_hostname)
2727

2828

29+
@pytest.fixture(scope="session")
30+
def ansible_dwh(ansible_by_hostname, backend_dwh_hostname):
31+
return ansible_by_hostname(backend_dwh_hostname)
32+
33+
2934
@pytest.fixture(scope="session")
3035
def ansible_storage(ansible_by_hostname, storage_hostname):
3136
return ansible_by_hostname(storage_hostname)
@@ -83,6 +88,11 @@ def ansible_engine_facts(ansible_engine):
8388
return Facts(ansible_engine)
8489

8590

91+
@pytest.fixture(scope="session")
92+
def ansible_dwh_facts(ansible_dwh):
93+
return Facts(ansible_dwh)
94+
95+
8696
@pytest.fixture(scope="session")
8797
def ansible_storage_facts(ansible_storage):
8898
return Facts(ansible_storage)

ost_utils/pytest/fixtures/backend.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ def backend_engine_hostname(backend):
2727
return backend.engine_hostname()
2828

2929

30+
@pytest.fixture(scope="session")
31+
def backend_dwh_hostname(backend):
32+
return backend.dwh_hostname()
33+
34+
3035
@pytest.fixture(scope="session")
3136
def all_hostnames(backend):
3237
return backend.hostnames()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../common/init-configs/1_engine_1_dwh_2_hosts.json
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#
2+
# Copyright oVirt Authors
3+
# SPDX-License-Identifier: GPL-2.0-or-later
4+
#
5+
#
Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# Copyright oVirt Authors
4+
# SPDX-License-Identifier: GPL-2.0-or-later
5+
#
6+
7+
import pytest
8+
9+
from ost_utils import network_utils
10+
11+
from ost_utils.pytest import pytest_collection_modifyitems
12+
13+
from ost_utils.pytest.fixtures import root_password
14+
15+
from ost_utils.pytest.fixtures.ansible import ansible_all
16+
from ost_utils.pytest.fixtures.ansible import ansible_by_hostname
17+
from ost_utils.pytest.fixtures.ansible import ansible_clean_private_dirs
18+
from ost_utils.pytest.fixtures.ansible import ansible_collect_logs
19+
from ost_utils.pytest.fixtures.ansible import ansible_engine
20+
from ost_utils.pytest.fixtures.ansible import ansible_engine_facts
21+
from ost_utils.pytest.fixtures.ansible import ansible_dwh
22+
from ost_utils.pytest.fixtures.ansible import ansible_dwh_facts
23+
from ost_utils.pytest.fixtures.ansible import ansible_host0_facts
24+
from ost_utils.pytest.fixtures.ansible import ansible_host0
25+
from ost_utils.pytest.fixtures.ansible import ansible_host1
26+
from ost_utils.pytest.fixtures.ansible import ansible_hosts
27+
from ost_utils.pytest.fixtures.ansible import ansible_inventory
28+
from ost_utils.pytest.fixtures.ansible import ansible_storage
29+
from ost_utils.pytest.fixtures.ansible import ansible_storage_facts
30+
31+
from ost_utils.pytest.fixtures.artifacts import artifacts_dir
32+
from ost_utils.pytest.fixtures.artifacts import collect_artifacts
33+
from ost_utils.pytest.fixtures.artifacts import collect_vdsm_coverage_artifacts
34+
from ost_utils.pytest.fixtures.artifacts import dump_dhcp_leases
35+
from ost_utils.pytest.fixtures.artifacts import generate_sar_stat_plots
36+
37+
from ost_utils.pytest.fixtures.backend import all_hostnames
38+
from ost_utils.pytest.fixtures.backend import backend
39+
from ost_utils.pytest.fixtures.backend import backend_engine_hostname
40+
from ost_utils.pytest.fixtures.backend import backend_dwh_hostname
41+
from ost_utils.pytest.fixtures.backend import deploy_scripts
42+
from ost_utils.pytest.fixtures.backend import host0_hostname
43+
from ost_utils.pytest.fixtures.backend import host1_hostname
44+
from ost_utils.pytest.fixtures.backend import hosts_hostnames
45+
from ost_utils.pytest.fixtures.backend import management_network_supports_ipv4
46+
from ost_utils.pytest.fixtures.backend import storage_hostname
47+
48+
from ost_utils.pytest.fixtures.defaults import *
49+
50+
from ost_utils.pytest.fixtures.deployment import deploy
51+
from ost_utils.pytest.fixtures.deployment import run_scripts
52+
from ost_utils.pytest.fixtures.deployment import set_sar_interval
53+
54+
from ost_utils.pytest.fixtures.engine import *
55+
56+
from ost_utils.pytest.fixtures.grafana import *
57+
58+
from ost_utils.pytest.fixtures.keycloak import *
59+
60+
from ost_utils.pytest.fixtures.env import ost_images_distro
61+
from ost_utils.pytest.fixtures.env import root_dir
62+
from ost_utils.pytest.fixtures.env import ssh_key_file
63+
from ost_utils.pytest.fixtures.env import suite_dir
64+
from ost_utils.pytest.fixtures.env import working_dir
65+
from ost_utils.pytest.fixtures.env import master_storage_domain_type
66+
67+
from ost_utils.pytest.fixtures.network import bonding_network_name
68+
from ost_utils.pytest.fixtures.network import management_gw_ip
69+
from ost_utils.pytest.fixtures.network import management_network_name
70+
71+
from ost_utils.pytest.fixtures.node import *
72+
73+
from ost_utils.pytest.fixtures.sdk import *
74+
75+
from ost_utils.pytest.fixtures.storage import *
76+
77+
from ost_utils.pytest.running_time import *
78+
79+
80+
@pytest.fixture(scope="session")
81+
def sd_iscsi_host_ip(storage_ips_for_network, storage_network_name): # pylint: disable=function-redefined
82+
return storage_ips_for_network(storage_network_name)[0]
83+
84+
85+
@pytest.fixture(scope="session")
86+
def sd_nfs_host_storage_name(
87+
storage_hostname,
88+
): # pylint: disable=function-redefined
89+
return storage_hostname
90+
91+
92+
@pytest.fixture(scope="session")
93+
def sd_iscsi_ansible_host(
94+
ansible_storage,
95+
): # pylint: disable=function-redefined
96+
return ansible_storage
97+
98+
99+
@pytest.fixture(scope="session")
100+
def engine_db_password():
101+
return 'engine_db_password123'
102+
103+
104+
@pytest.fixture(scope="session")
105+
def dwh_fqdn(ansible_dwh_facts, suite):
106+
return ansible_dwh_facts.get("ansible_fqdn")
107+
108+
109+
@pytest.fixture(scope="session")
110+
def grafana_fqdn(
111+
dwh_fqdn,
112+
): # pylint: disable=function-redefined
113+
return dwh_fqdn
114+
115+
116+
@pytest.fixture(scope="session")
117+
def engine_answer_file_contents(
118+
engine_password,
119+
engine_fqdn,
120+
engine_full_username,
121+
engine_db_password,
122+
): # pylint: disable=function-redefined
123+
return (
124+
'# action=setup\n'
125+
'[environment:default]\n'
126+
'OVESETUP_DIALOG/confirmSettings=bool:True\n'
127+
'OVESETUP_CONFIG/applicationMode=str:both\n'
128+
'OVESETUP_CONFIG/remoteEngineSetupStyle=none:None\n'
129+
f'OVESETUP_CONFIG/adminPassword=str:{engine_password}\n'
130+
'OVESETUP_CONFIG/storageIsLocal=bool:False\n'
131+
'OVESETUP_CONFIG/firewallManager=str:firewalld\n'
132+
'OVESETUP_CONFIG/remoteEngineHostRootPassword=none:None\n'
133+
'OVESETUP_CONFIG/firewallChangesReview=none:None\n'
134+
'OVESETUP_CONFIG/updateFirewall=bool:True\n'
135+
'OVESETUP_CONFIG/remoteEngineHostSshPort=none:None\n'
136+
f'OVESETUP_CONFIG/fqdn=str:{engine_fqdn}\n'
137+
'OVESETUP_CONFIG/storageType=none:None\n'
138+
'OSETUP_RPMDISTRO/requireRollback=none:None\n'
139+
'OSETUP_RPMDISTRO/enableUpgrade=bool:True\n'
140+
'OVESETUP_DB/database=str:engine\n'
141+
'OVESETUP_DB/fixDbViolations=none:None\n'
142+
'OVESETUP_DB/secured=bool:False\n'
143+
'OVESETUP_DB/host=str:localhost\n'
144+
'OVESETUP_DB/user=str:engine\n'
145+
'OVESETUP_DB/securedHostValidation=bool:False\n'
146+
f'OVESETUP_DB/password=str:{engine_db_password}\n'
147+
'OVESETUP_DB/port=int:5432\n'
148+
'OVESETUP_ENGINE_CORE/enable=bool:True\n'
149+
'OVESETUP_CORE/engineStop=none:None\n'
150+
'OVESETUP_SYSTEM/memCheckEnabled=bool:False\n'
151+
'OVESETUP_SYSTEM/nfsConfigEnabled=bool:False\n'
152+
'OVESETUP_PKI/organization=str:Test\n'
153+
'OVESETUP_CONFIG/isoDomainMountPoint=none:None\n'
154+
'OVESETUP_CONFIG/isoDomainName=none:None\n'
155+
'OVESETUP_CONFIG/isoDomainACL=none:None\n'
156+
'OVESETUP_AIO/configure=none:None\n'
157+
'OVESETUP_AIO/storageDomainName=none:None\n'
158+
'OVESETUP_AIO/storageDomainDir=none:None\n'
159+
'OVESETUP_PROVISIONING/postgresProvisioningEnabled=bool:True\n'
160+
'OVESETUP_APACHE/configureRootRedirection=bool:True\n'
161+
'OVESETUP_APACHE/configureSsl=bool:True\n'
162+
'OVESETUP_CONFIG/websocketProxyConfig=bool:True\n'
163+
f'OVESETUP_ENGINE_CONFIG/fqdn=str:{engine_fqdn}\n'
164+
'OVESETUP_CONFIG/sanWipeAfterDelete=bool:False\n'
165+
'OVESETUP_VMCONSOLE_PROXY_CONFIG/vmconsoleProxyConfig=bool:True\n'
166+
'OVESETUP_DWH_CORE/enable=bool:False\n'
167+
'QUESTION/1/OVESETUP_GRAFANA_ENABLE=str:no\n'
168+
f'OVESETUP_OVN/ovirtProviderOvnUser=str:{engine_full_username}\n'
169+
f'OVESETUP_OVN/ovirtProviderOvnPassword=str:{engine_password}\n'
170+
'OVESETUP_CONFIG/imageioProxyConfig=bool:True\n'
171+
'QUESTION/1/ovirt-cinderlib-enable=str:yes\n'
172+
)
173+
174+
175+
@pytest.fixture(scope="session")
176+
def dwh_answer_file_contents(
177+
engine_password,
178+
engine_fqdn,
179+
dwh_fqdn,
180+
root_password,
181+
engine_db_password,
182+
engine_full_username,
183+
): # pylint: disable=function-redefined
184+
return (
185+
'# action=setup\n'
186+
'[environment:default]\n'
187+
'QUESTION/1/OVESETUP_ENGINE_ENABLE=str:no\n'
188+
'QUESTION/1/OVESETUP_DWH_SCALE=str:2\n'
189+
'QUESTION/1/OVESETUP_ENGINE_DB_DATABASE=str:engine\n'
190+
f'QUESTION/1/OVESETUP_ENGINE_DB_HOST=str:{engine_fqdn}\n'
191+
f'QUESTION/1/OVESETUP_ENGINE_DB_PASSWORD=str:{engine_db_password}\n'
192+
'QUESTION/1/OVESETUP_ENGINE_DB_PORT=str:5432\n'
193+
'QUESTION/1/OVESETUP_ENGINE_DB_SECURED=str:no\n'
194+
'QUESTION/1/OVESETUP_ENGINE_DB_USER=str:engine\n'
195+
f'QUESTION/1/OVESETUP_NETWORK_FQDN_the_engine=str:{engine_fqdn}\n'
196+
f'QUESTION/1/OVESETUP_NETWORK_FQDN_this=str:{dwh_fqdn}\n'
197+
f'QUESTION/1/SSH_ACCESS_REMOTE_ENGINE_PASSWORD=str:{root_password}\n'
198+
f'QUESTION/1/queryEnvKey_input_OVESETUP_GRAFANA_CONFIG/adminPassword=str:{root_password}\n'
199+
f'QUESTION/1/queryEnvKey_input_second_password=str:{root_password}\n'
200+
'QUESTION/1/queryEnvKey_warnverify_OVESETUP_GRAFANA_CONFIG/adminPassword=str:yes\n'
201+
'QUESTION/1/ovirt-provider-ovn=str:no\n'
202+
'QUESTION/1/OVESETUP_CONFIG_WEBSOCKET_PROXY=str:no\n'
203+
)
204+
205+
206+
@pytest.fixture(scope="session")
207+
def dwh_answer_file_path(dwh_answer_file_contents, working_dir):
208+
file_path = os.path.join(working_dir, 'dwh-answer-file')
209+
with open(file_path, 'w') as f:
210+
f.write(dwh_answer_file_contents)
211+
return file_path

0 commit comments

Comments
 (0)