Skip to content

Commit

Permalink
tests: read expected hidden screens on Live ISO from anaconda.conf
Browse files Browse the repository at this point in the history
Do not hardcode tests for hiddens screens.
  • Loading branch information
KKoukiou committed Jan 23, 2025
1 parent 3891137 commit 4009c02
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 25 deletions.
21 changes: 1 addition & 20 deletions test/check-basic
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@
from anacondalib import VirtInstallMachineCase
from installer import Installer
from language import Language
from review import Review
from storage import Storage
from testlib import nondestructive, test_main, wait # pylint: disable=import-error
from utils import get_pretty_name, pretend_live_iso
from utils import get_pretty_name


@nondestructive
Expand Down Expand Up @@ -86,24 +85,6 @@ class TestBasic(VirtInstallMachineCase):
]:
i.check_sidebar_step_disabled(step)

def testLanguageScreenHiddenLive(self):
b = self.browser
m = self.machine
i = Installer(b, m)
r = Review(b, m)

pretend_live_iso(self, i)

i.open()
i.reach(i.steps.INSTALLATION_METHOD)

# Back button should be disabled on the first screen
b.wait_visible("#installation-back-btn[aria-disabled=true]")

# For live media in the review screen language details should still be displayed
i.reach(i.steps.REVIEW)
r.check_language("English (United States)")

def testAboutModal(self):
b = self.browser
m = self.machine
Expand Down
2 changes: 1 addition & 1 deletion test/check-review
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class TestReview(VirtInstallMachineCase):
p = Password(b, s.encryption_id_prefix)
r = Review(b, m)

pretend_live_iso(self, i)
pretend_live_iso(self, i, m)
i.open()
# After clicking 'Next' on the storage step, partitioning is done, thus changing the available space on the disk
# Since this is a non-destructive test we need to make sure the we reset partitioning to how it was before the test started
Expand Down
2 changes: 1 addition & 1 deletion test/check-storage-cockpit
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class TestStorageCockpitIntegration(VirtInstallMachineCase, StorageCase):
i = Installer(b, m, scenario="use-configured-storage")
s = Storage(b, m)

pretend_live_iso(self, i)
pretend_live_iso(self, i, m)

i.open()
s.check_disk_selected("vda")
Expand Down
10 changes: 7 additions & 3 deletions test/helpers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,15 @@ def add_public_key(machine):
machine.write(authorized_keys, public_key, perm="0600")


def pretend_live_iso(test, installer):
installer.steps.hidden_steps.extend([installer.steps.ACCOUNTS, installer.steps.LANGUAGE])
def pretend_live_iso(test, installer, machine):
hidden_screens = machine.execute("cat /etc/anaconda/profile.d/fedora-workstation.conf | grep anaconda-screen").split('\n')
hidden_screens = [x.strip() for x in hidden_screens]

installer.steps.hidden_steps.extend(hidden_screens)

test.restore_file('/run/anaconda/anaconda.conf')
test.machine.execute("sed -i 's/type = BOOT_ISO/type = LIVE_OS/g' /run/anaconda/anaconda.conf")
test.machine.execute("sed -i '/[anaconda]/a hidden_webui_pages = anaconda-screen-language anaconda-screen-accounts' /run/anaconda/anaconda.conf")
test.machine.execute(f"sed -i '/[anaconda]/a hidden_webui_pages = {" ".join(hidden_screens)}' /run/anaconda/anaconda.conf")

def pretend_default_scheme(test, scheme):
test.restore_file('/run/anaconda/anaconda.conf')
Expand Down

0 comments on commit 4009c02

Please sign in to comment.