Skip to content

Commit

Permalink
webui: add testing of log existence in critical error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
rvykydal committed Aug 8, 2023
1 parent 1d5dfe1 commit b56d44a
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion ui/webui/test/check-basic
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ from installer import Installer
from language import Language
from review import Review
from storage import Storage
from testlib import nondestructive, test_main # pylint: disable=import-error
from testlib import nondestructive, test_main, wait # pylint: disable=import-error
from time import sleep


@nondestructive
Expand Down Expand Up @@ -150,6 +151,23 @@ class TestQuit(anacondalib.VirtInstallMachineCase):

b.wait_visible("#critical-error-modal")

# Test review of logs

logfile = "/tmp/webui.log"

self.assertFalse(self.file_exists(logfile))

# Click report issue: save reviewed log and open BZ URL
b.click("#critical-error-modal .pf-c-button.pf-m-primary")

with b.wait_timeout(20):
b.wait(lambda: self.file_exists(logfile))

# Reviewed log contains more than 100 lines
wait(lambda: int(m.execute(f"wc -l {logfile} | cut -d' ' -f1").strip()) > 100)

sleep(3)

# Exit installer
b.click("#critical-error-modal .pf-c-button.pf-m-secondary")
m.wait_poweroff()
Expand Down

0 comments on commit b56d44a

Please sign in to comment.