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 7, 2023
1 parent 6917878 commit 2f0fc7d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ui/webui/src/apis/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ export const resetPartitioning = () => {
return new StorageClient().client.call(
"/org/fedoraproject/Anaconda/Modules/Storage",
"org.fedoraproject.Anaconda.Modules.Storage",
"ResetPartitioning", []
"ResetPartitioningg", []
);
};

Expand Down
22 changes: 22 additions & 0 deletions ui/webui/test/check-basic
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ from language import Language
from review import Review
from storage import Storage
from testlib import nondestructive, test_main # pylint: disable=import-error
from time import sleep


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

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

# Test review of logs

logfile = "/tmp/webui.log"

# Reviewed log file does not exist
self.assertEqual("true", m.execute(f"test ! -f {logfile} && echo -n true"))

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

# It takes some time for the log to show up
sleep(3)

# Reviewed log exists
self.assertEqual("true", m.execute(f"test -f {logfile} && echo -n true"))

# Reviewed log contains more than 100 lines
wc_output = m.execute(f"wc -l {logfile}")
lines = int(wc_output.partition(" ")[0])
self.assertTrue(lines > 100)

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

0 comments on commit 2f0fc7d

Please sign in to comment.