Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add separate machine basic suite master #293

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions basic-suite-master/test-scenarios/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@

from ost_utils.pytest.fixtures.engine import *

from ost_utils.pytest.fixtures.grafana import *

from ost_utils.pytest.fixtures.keycloak import *

from ost_utils.pytest.fixtures.env import master_storage_domain_type
Expand Down
4 changes: 2 additions & 2 deletions basic-suite-master/test-scenarios/test_100_basic_ui_sanity.py
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ def test_grafana(
engine_username,
engine_password,
engine_webadmin_url,
engine_fqdn,
grafana_fqdn,
):

ovirt_driver.get(engine_webadmin_url)
Expand All @@ -754,7 +754,7 @@ def test_grafana(
save_screenshot('grafana')

# navigate directly to Grafana Configuration/Data Sources page
ovirt_driver.get(f'https://{engine_fqdn}/ovirt-engine-grafana/datasources')
ovirt_driver.get(f'https://{grafana_fqdn}/ovirt-engine-grafana/datasources')
assert grafana.db_connection()
save_screenshot('grafana-datasource-connection')

Expand Down
25 changes: 25 additions & 0 deletions common/deploy-scripts/setup_dwh.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash -xe

systemctl enable firewalld
systemctl start firewalld

systemctl enable crond
systemctl start crond

rm -rf /dev/shm/yum /dev/shm/*.rpm
fstrim -va

firewall-cmd --permanent --zone=public --add-interface=eth0
firewall-cmd --reload

# rotate logs quicker, because of the debug logs they tend to flood the root partition if they run > 15 minutes
cat > /etc/cron.d/ovirt-engine << EOF
* * * * * root logrotate /etc/logrotate.d/ovirt-engine
* * * * * root logrotate /etc/logrotate.d/ovirt-engine-dwh
EOF

# We are using an OST image that includes the engine. We do not setup
# the engine, but install engine-setup code - thus might run it, with
# unintended side effects. Let's remove it.
# Current context: https://bugzilla.redhat.com/2126778
dnf remove -y --noautoremove ovirt-engine
117 changes: 117 additions & 0 deletions common/init-configs/1_engine_1_dwh_2_hosts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
{
"networks": {
"management": {
"comment": "management generates DNS entries for ost-$suite-$nic, e.g. ost-basic-suite-master-engine",
"is_management": true,
"template": "common/libvirt-templates/net_template",
"nics": [
"engine",
"dwh",
"host-0",
"host-1",
"storage"
]
},
"storage": {
"template": "common/libvirt-templates/net_template",
"nics": [
"engine-storage",
"dwh-storage",
"host-0-storage",
"host-1-storage",
"storage-storage"
]
},
"bonding": {
"template": "common/libvirt-templates/net_template",
"nics": [
"host-0-eth2",
"host-0-eth3",
"host-1-eth2",
"host-1-eth3"
]
}
},
"vms" : {
"engine": {
"template": "common/libvirt-templates/vm_template",
"memory": "3584",
"deploy-scripts": [
"common/deploy-scripts/setup_engine.sh"
],
"nics": {
"engine": { "template": "common/libvirt-templates/nic_template" },
"engine-storage": { "template": "common/libvirt-templates/nic_template" }
},
"root_disk_var": "OST_IMAGES_ENGINE_INSTALLED",
"disks": {}
},
"dwh": {
"template": "common/libvirt-templates/vm_template",
"memory": "3584",
"deploy-scripts": [
"common/deploy-scripts/setup_dwh.sh"
],
"nics": {
"dwh": { "template": "common/libvirt-templates/nic_template" },
"dwh-storage": { "template": "common/libvirt-templates/nic_template" }
},
"root_disk_var": "OST_IMAGES_ENGINE_INSTALLED",
"disks": {}
},
"storage": {
"template": "common/libvirt-templates/vm_template",
"memory": "2048",
"deploy-scripts": [
"common/deploy-scripts/setup_storage.sh"
],
"nics": {
"storage": { "template": "common/libvirt-templates/nic_template" },
"storage-storage": { "template": "common/libvirt-templates/nic_template" }
},
"root_disk_var": "OST_IMAGES_STORAGE_BASE",
"disks": {
"sda": {
"comment": "Main NFS device",
"template": "common/libvirt-templates/disk_template",
"size": "101G"
},
"sdb": {
"comment": "Main iSCSI device",
"template": "common/libvirt-templates/disk_template",
"size": "191G"
}
}
},
"host-0": {
"template": "common/libvirt-templates/vm_template",
"memory": "1792",
"deploy-scripts": [
"common/deploy-scripts/setup_host.sh"
],
"nics": {
"host-0": { "template": "common/libvirt-templates/nic_template" },
"host-0-storage": { "template": "common/libvirt-templates/nic_template" },
"host-0-eth2": { "template": "common/libvirt-templates/nic_template" },
"host-0-eth3": { "template": "common/libvirt-templates/nic_template" }
},
"root_disk_var": "OST_IMAGES_HOST_INSTALLED",
"disks": {}
},
"host-1": {
"template": "common/libvirt-templates/vm_template",
"memory": "1792",
"deploy-scripts": [
"common/deploy-scripts/setup_host.sh"
],
"nics": {
"host-1": { "template": "common/libvirt-templates/nic_template" },
"host-1-storage": { "template": "common/libvirt-templates/nic_template" },
"host-1-eth2": { "template": "common/libvirt-templates/nic_template" },
"host-1-eth3": { "template": "common/libvirt-templates/nic_template" }
},
"root_disk_var": "OST_IMAGES_NODE",
"disks": {}
}
}
}
7 changes: 7 additions & 0 deletions ost_utils/backend/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,13 @@ def hostnames(self):
def engine_hostname(self):
return next(hn for hn in self.hostnames() if "engine" in hn)

@cache
def dwh_hostname(self):
# This means I can't call the suite I added this for 'separate-dwh-basic-suite-master',
# because it will collide. Already gave up on making this code more robust, so not
# adding a "to do"...
return next(hn for hn in self.hostnames() if "dwh" in hn)

@cache
def hosts_hostnames(self):
# The output should always be sorted, so we can refer by indices
Expand Down
10 changes: 10 additions & 0 deletions ost_utils/pytest/fixtures/ansible.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ def ansible_engine(ansible_by_hostname, backend_engine_hostname):
return ansible_by_hostname(backend_engine_hostname)


@pytest.fixture(scope="session")
def ansible_dwh(ansible_by_hostname, backend_dwh_hostname):
return ansible_by_hostname(backend_dwh_hostname)


@pytest.fixture(scope="session")
def ansible_storage(ansible_by_hostname, storage_hostname):
return ansible_by_hostname(storage_hostname)
Expand Down Expand Up @@ -83,6 +88,11 @@ def ansible_engine_facts(ansible_engine):
return Facts(ansible_engine)


@pytest.fixture(scope="session")
def ansible_dwh_facts(ansible_dwh):
return Facts(ansible_dwh)


@pytest.fixture(scope="session")
def ansible_storage_facts(ansible_storage):
return Facts(ansible_storage)
Expand Down
5 changes: 5 additions & 0 deletions ost_utils/pytest/fixtures/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ def backend_engine_hostname(backend):
return backend.engine_hostname()


@pytest.fixture(scope="session")
def backend_dwh_hostname(backend):
return backend.dwh_hostname()


@pytest.fixture(scope="session")
def all_hostnames(backend):
return backend.hostnames()
Expand Down
12 changes: 12 additions & 0 deletions ost_utils/pytest/fixtures/grafana.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# Copyright oVirt Authors
# SPDX-License-Identifier: GPL-2.0-or-later
#
#

import pytest


@pytest.fixture(scope="session")
def grafana_fqdn(engine_fqdn):
return engine_fqdn
1 change: 1 addition & 0 deletions separate-machine-basic-suite-master/ost.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#
# Copyright oVirt Authors
# SPDX-License-Identifier: GPL-2.0-or-later
#
#
Loading