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

[6.14.z] Add test for subnet disk image download #17282

Merged
Merged
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
53 changes: 50 additions & 3 deletions tests/foreman/cli/test_bootdisk.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@

"""

from fauxfactory import gen_mac, gen_string
from fauxfactory import gen_ipaddr, gen_mac, gen_string
import pytest

from robottelo.config import settings
from robottelo.constants import HTTPS_MEDIUM_URL
from robottelo.constants import HTTPS_MEDIUM_URL, SUBNET_IPAM_TYPES


@pytest.mark.parametrize('module_sync_kickstart_content', [7, 8, 9], indirect=True)
@pytest.mark.upgrade
@pytest.mark.rhel_ver_match('[^6]')
def test_positive_bootdisk_download_https(
request,
module_location,
Expand Down Expand Up @@ -90,3 +91,49 @@ def _finalize():
# Check if full-host bootdisk can be downloaded.
bootdisk = module_target_sat.cli.Bootdisk.host({'host-id': host['id'], 'full': 'true'})
assert 'Successfully downloaded host disk image' in bootdisk['message']


@pytest.mark.upgrade
def test_positive_bootdisk_subnet_download(module_location, module_org, module_target_sat):
"""Verify satellite is able to download subnet disk image.

:id: ed6da37f-ba3f-43c9-9169-40c818e42136

:steps:
1. Create a subnet
2. Download the subnet disk image
3. Check if subnet disk image is downloaded properly

:expectedresults: subnet disk image is downloaded properly

:Verifies: SAT-23549

:customerscenario: true
"""
capsule = module_target_sat.nailgun_smart_proxy
file_name = gen_string('alpha')
name = gen_string('alpha')
mask = '255.255.255.0'
network = gen_ipaddr()
domain = module_target_sat.cli_factory.make_domain(
{'organization-id': module_org.id, 'location-id': module_location.id}
)
gateway = gen_ipaddr()
subnet = module_target_sat.cli_factory.make_subnet(
{
'name': name,
'mask': mask,
'network': network,
'domain-ids': [domain['id']],
'gateway': gateway,
'ipam': SUBNET_IPAM_TYPES['dhcp'],
'tftp-id': capsule.id,
'discovery-id': capsule.id,
'remote-execution-proxy-ids': capsule.id,
}
)
# Check if subnet disk image bootdisk can be downloaded.
bootdisk = module_target_sat.cli.Bootdisk.subnet(
{'subnet-id': subnet['id'], 'file': f'{file_name}'}
)
assert f'Successfully downloaded subnet disk image to {file_name}' in bootdisk['message']
Loading