Skip to content

Commit

Permalink
Add test for subnet disk image download
Browse files Browse the repository at this point in the history
Signed-off-by: Shubham Ganar <[email protected]>
  • Loading branch information
shubhamsg199 committed Nov 20, 2024
1 parent 54eff8d commit d0f0f70
Showing 1 changed file with 47 additions and 2 deletions.
49 changes: 47 additions & 2 deletions tests/foreman/cli/test_bootdisk.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
"""

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.rhel_ver_match('[^6]')
Expand Down Expand Up @@ -90,3 +90,48 @@ 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']


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']

0 comments on commit d0f0f70

Please sign in to comment.