Skip to content

Commit

Permalink
Merge branch '6.15.z' into cherry-pick-6.15.z-4c00785383e3a0e2c71de44…
Browse files Browse the repository at this point in the history
…ce9411b41a6956f39
  • Loading branch information
pondrejk authored May 7, 2024
2 parents 687ebe8 + ea33153 commit d63fbb9
Show file tree
Hide file tree
Showing 450 changed files with 1,102 additions and 347 deletions.
7 changes: 2 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,12 @@ repos:
exclude: tests/foreman/data/
- id: check-yaml
- id: debug-statements
- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.0
rev: v0.4.1
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
- repo: local
hooks:
- id: fix-uuids
Expand Down
101 changes: 101 additions & 0 deletions conf/fam.yaml.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
FAM:
SERVER:
# Parameter for all tests
foreman_username: admin
foreman_password: "changeme"
foreman_server_url: "https://foreman.example.com"
foreman_validate_certs: false

foreman_proxy: "foreman.example.com"

# Parameter for snapshot test
snapshot_host_name: "test_host"

# Parameter for job invocation test
foreman_host: "foreman.example.com"

# Parameter for subscription_manifest test
subscription_manifest_path: "data/manifest_foreman-ansible-modules.zip"

# Parameter for redhat_manifest test
manifest_name: "katello.example.com"
rhsm_username: "john-smith"
rhsm_password: "changeme"
rhsm_pool_id: 8a85f99a7db4827d017dc512fcad00b0
rhsm_validate_certs: false

# Parameter for scc_product test
scc_account_name_for_scc_product: testaccount
scc_account_login_for_scc_product: testuser
scc_account_password_for_scc_product: testpass

# Parameter for external_usergroup testing
auth_source_ldap_host: ldap.example.com
auth_source_ldap_account: ansible
auth_source_ldap_account_password: pass
auth_source_ldap_base_dn: dc=example,dc=com
auth_source_ldap_attr_login: uid
auth_source_ldap_groups_base: cn=groups,cn=accounts,dc=example,dc=com
external_usergroup_name: "admins"

COMPUTE_PROFILE:
libvirt:
compute_resource:
name: libvirt-cr01
organizations:
- Test Organization
locations:
- Test Location
params:
url: qemu+ssh://libvirtuser@localhost/system
compute_profile:
name: app-small
attrs:
cpus: 1
memory: 2147483648
nics_attributes:
0:
type: bridge
bridge: ""
model: virtio
volumes_attributes:
0:
pool_name: default
capacity: 10G
allocation: 0G
format_type: raw
ovirt:
compute_resource:
name: ovirt-cr01
organizations:
- Test Organization
locations:
- Test Location
params:
url: "https://ovirt.example.com/ovirt-engine/api"
user: compute-user@internal
password: ovirtcompute123
use_v4: true
datacenter: c1479626-99a2-44eb-8401-14b5630f417f
ovirt_quota: 502a76bb-a3fe-42f1-aed6-2a7c892a6786
compute_profile:
name: app-small
attrs:
cluster: Devel-Infra
cores: 2
sockets: 1
memory: 1073741824
ha: 0
interfaces_attributes:
0:
name: ""
network: ovirtmgmt
interface: virtio
volumes_attributes:
0:
size_gb: '16'
storage_domain: 'Local-IBM'
preallocate: '1'
wipe_after_delete: '0'
interface: 'virtio_scsi'
bootable: 'true'
6 changes: 4 additions & 2 deletions conf/oscap.yaml.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
OSCAP:
CONTENT_PATH: /usr/share/xml/scap/ssg/content/ssg-rhel7-ds.xml
RHEL_MAJOR_VERSION: "@jinja {{this.server.version.rhel_version | int }}"
CONTENT_PATH: '@format /usr/share/xml/scap/ssg/content/ssg-rhel{this.oscap.rhel_major_version}-ds.xml'
# see: robottelo/constants/__init__.py OSCAP_PROFILE
PROFILE: security7
PROFILE: '@format security{this.oscap.rhel_major_version}'
CONTENT_DIR: /usr/share/xml/scap/ssg/content
1 change: 1 addition & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Global Configurations for py.test runner"""

import pytest

pytest_plugins = [
Expand Down
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
http://sphinx-doc.org/config.html
"""

import builtins
import os
import sys
Expand Down
24 changes: 7 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
[tool.black]
line-length = 100
skip-string-normalization = true
include = '\.pyi?$'
exclude = '''
/(
\.git
| \.hg
| \.mypy_cache
| \.venv
| _build
| buck-out
| build
| dist
)/
'''

[tool.ruff]
target-version = "py311"
# Allow lines to be as long as 100.
line-length = 100
exclude = [".git", ".hg", ".mypy_cache", ".venv", "_build", "buck-out", "build", "dist"]

[tool.ruff.format]
# Preserve quotes
quote-style = "preserve" # TODO: change to "single" when flake8-quotes is enabled

[tool.ruff.lint]
fixable = ["ALL"]
Expand Down
5 changes: 2 additions & 3 deletions pytest_fixtures/component/oscap.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pytest

from robottelo.config import robottelo_tmp_dir, settings
from robottelo.constants import OSCAP_PROFILE, OSCAP_TAILORING_FILE, DataFile
from robottelo.constants import OSCAP_TAILORING_FILE, DataFile


@pytest.fixture(scope="session")
Expand Down Expand Up @@ -35,11 +35,10 @@ def scap_content(import_ansible_roles, module_target_sat):
)
scap_id = scap_info['id']
scap_info = entities.ScapContents(id=scap_id).read()

scap_profile_id = [
profile['id']
for profile in scap_info.scap_content_profiles
if OSCAP_PROFILE[settings.oscap.profile] in profile['title']
if module_target_sat.OSCAP['dsrhel'] in profile['title']
][0]
return {
"title": title,
Expand Down
6 changes: 1 addition & 5 deletions pytest_fixtures/component/virtwho_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ def org_module(request, default_org, module_sca_manifest_org):

@pytest.fixture
def org_session(request, session, session_sca):
if 'sca' in request.module.__name__.split('.')[-1]:
org_session = session_sca
else:
org_session = session
return org_session
return session_sca if 'sca' in request.module.__name__.split('.')[-1] else session


@pytest.fixture
Expand Down
1 change: 1 addition & 0 deletions pytest_fixtures/core/contenthosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
The functions in this module are read in the pytest_plugins/fixture_markers.py module
All functions in this module will be treated as fixtures that apply the contenthost mark
"""

from broker import Broker
import pytest

Expand Down
5 changes: 1 addition & 4 deletions pytest_fixtures/core/xdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ def align_to_satellite(request, worker_id, satellite_factory):
settings.set("server.hostname", None)
on_demand_sat = None

if worker_id in ['master', 'local']:
worker_pos = 0
else:
worker_pos = int(worker_id.replace('gw', ''))
worker_pos = 0 if worker_id in ["master", "local"] else int(worker_id.replace("gw", ""))

# attempt to add potential satellites from the broker inventory file
if settings.server.inventory_filter:
Expand Down
1 change: 0 additions & 1 deletion pytest_plugins/capsule_n-minus.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def pytest_addoption(parser):


def pytest_collection_modifyitems(items, config):

if not config.getoption('n_minus', False):
return

Expand Down
1 change: 0 additions & 1 deletion pytest_plugins/requirements/req_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@


class ReqUpdater:

# Installed package name as key and its counterpart in requirements file as value
package_deviates = {
'Betelgeuse': 'betelgeuse',
Expand Down
1 change: 1 addition & 0 deletions pytest_plugins/requirements/update_requirements.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Plugin enables pytest to notify and update the requirements"""

from .req_updater import ReqUpdater

updater = ReqUpdater()
Expand Down
2 changes: 1 addition & 1 deletion pytest_plugins/sanity_plugin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" A sanity testing plugin to assist in executing robottelo tests as sanity tests smartly
"""A sanity testing plugin to assist in executing robottelo tests as sanity tests smartly
1. Make installer test to run first which should set the hostname and all other tests then
should run after that
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
apypie==0.4.0
betelgeuse==1.11.0
broker[docker]==0.4.9
cryptography==42.0.5
cryptography==42.0.7
deepdiff==7.0.1
dynaconf[vault]==3.2.5
fauxfactory==3.1.1
jinja2==3.1.3
jinja2==3.1.4
manifester==0.0.14
navmazing==1.2.2
productmd==1.38
Expand Down
1 change: 1 addition & 0 deletions robottelo/cli/acs.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
update Update an alternate content source.
"""

from robottelo.cli.base import Base


Expand Down
1 change: 1 addition & 0 deletions robottelo/cli/activationkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
subscriptions List associated subscriptions
update Update an activation key
"""

from robottelo.cli.base import Base


Expand Down
1 change: 1 addition & 0 deletions robottelo/cli/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
Options:
-h, --help Print help
"""

from robottelo.cli.base import Base


Expand Down
1 change: 1 addition & 0 deletions robottelo/cli/ansible.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
roles Manage ansible roles
variables Manage ansible variables
"""

from robottelo.cli.base import Base


Expand Down
1 change: 1 addition & 0 deletions robottelo/cli/architecture.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
remove_operatingsystem Disassociate a resource
update Update an architecture.
"""

from robottelo.cli.base import Base


Expand Down
1 change: 1 addition & 0 deletions robottelo/cli/arfreport.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
list List ARF reports
"""

from robottelo.cli.base import Base


Expand Down
1 change: 1 addition & 0 deletions robottelo/cli/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
logout Wipe your credentials
status Information about current connections
"""

from robottelo.cli.base import Base


Expand Down
1 change: 1 addition & 0 deletions robottelo/cli/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Generic base class for cli hammer commands."""

import re

from wait_for import wait_for
Expand Down
1 change: 1 addition & 0 deletions robottelo/cli/bootdisk.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
host Download host image
subnet Download subnet generic image
"""

from robottelo.cli.base import Base


Expand Down
1 change: 1 addition & 0 deletions robottelo/cli/capsule.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
refresh-features Refresh capsule features
update Update a capsule
"""

from robottelo.cli.base import Base


Expand Down
1 change: 1 addition & 0 deletions robottelo/cli/computeprofile.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
-h, --help Print help
Update a compute resource.
"""

from robottelo.cli.base import Base


Expand Down
1 change: 1 addition & 0 deletions robottelo/cli/computeresource.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
list List all compute resources.
update Update a compute resource.
"""

from robottelo.cli.base import Base


Expand Down
1 change: 1 addition & 0 deletions robottelo/cli/content_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
list List content credentials
update Update a content credential
"""

from robottelo.cli.base import Base


Expand Down
1 change: 1 addition & 0 deletions robottelo/cli/content_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
list View content view export histories
"""

from robottelo.cli.base import Base


Expand Down
1 change: 1 addition & 0 deletions robottelo/cli/content_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
version Imports a content archive to a content view version
"""

from robottelo.cli.base import Base


Expand Down
1 change: 1 addition & 0 deletions robottelo/cli/contentview.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
-h, --help print help
"""

from robottelo.cli import hammer
from robottelo.cli.base import Base, CLIError

Expand Down
Loading

0 comments on commit d63fbb9

Please sign in to comment.