Skip to content

Commit

Permalink
test_positive_end_to_end_bulk_update (#6956)
Browse files Browse the repository at this point in the history
* Test the Update All Packages button on Update Packages dialogue
* Use the Host Collection view to get to it.
  • Loading branch information
swadeley committed May 31, 2019
1 parent 5d60bd0 commit 5e1d1cf
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions tests/foreman/ui_airgun/test_contenthost.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,52 @@ def test_positive_end_to_end(session, repos_collection, vm):
assert not session.contenthost.search(vm.hostname)


@upgrade
@tier3
def test_positive_end_to_end_bulk_update(session, vm):
"""Create VM, set up VM as host, register it as a content host,
read content host details, install a package ( e.g. walrus-0.71) and
use bulk action (Update All Packages) to update the package by name
to a later version.
:id: d460ba30-82c7-11e9-9af5-54ee754f2151
:expectedresults: package installation and update to a later version
are successful.
:BZ: 1712069
:CaseLevel: System
"""
hc_name = gen_string('alpha')
description = gen_string('alpha')
result = vm.run('yum -y install {0}'.format(FAKE_1_CUSTOM_PACKAGE))
assert result.return_code == 0
with session:
# Ensure content host is searchable
assert session.contenthost.search(vm.hostname)[0]['Name'] == vm.hostname
# Update package using bulk action
# use the Host Collection view to access Update Packages dialogue
session.hostcollection.create({
'name': hc_name,
'unlimited_hosts': False,
'max_hosts': 2,
'description': description
})
session.hostcollection.associate_host(hc_name, vm.hostname)
# Update the package by name
session.hostcollection.manage_packages(
hc_name, content_type='Package',
packages=FAKE_1_CUSTOM_PACKAGE_NAME,
action='update_all'
)
# Ensure package updated to a later version
packages = session.contenthost.search_package(vm.hostname, FAKE_2_CUSTOM_PACKAGE_NAME)
assert packages[0]['Installed Package'] == FAKE_2_CUSTOM_PACKAGE
# Delete content host
session.contenthost.delete(vm.hostname)


@tier3
def test_positive_search_by_subscription_status(session, vm):
"""Register host into the system and search for it afterwards by
Expand Down

0 comments on commit 5e1d1cf

Please sign in to comment.