From f424e5bac5c3887496881aa71f9b592fe31f73e7 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Fri, 9 Sep 2022 13:08:47 -0700 Subject: [PATCH] Try and get more detailed Firefox logs from startx When we run Firefox directly on X lately, we often hit a bug where X just suddenly exits in the middle of doing stuff in Firefox. I'm not sure if this is a bug in X or in Firefox (if Firefox crashed, X would immediately exit). Let's see if this helps get any info on what's going on with Firefox. Signed-off-by: Adam Williamson --- lib/cockpit.pm | 1 + lib/freeipa.pm | 1 + lib/installedtest.pm | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/lib/cockpit.pm b/lib/cockpit.pm index 50e7ce5c..227811b6 100644 --- a/lib/cockpit.pm +++ b/lib/cockpit.pm @@ -19,6 +19,7 @@ sub start_cockpit { # https://bugzilla.redhat.com/show_bug.cgi?id=1439429 assert_script_run "sed -i -e 's,enable_xauth=1,enable_xauth=0,g' /usr/bin/startx"; disable_firefox_studies; + assert_script_run "export MOZ_LOG_FILE=/tmp/firefox.log"; # run firefox directly in X as root. never do this, kids! type_string "startx /usr/bin/firefox -width 1024 -height 768 http://localhost:9090\n"; assert_screen "cockpit_login", 60; diff --git a/lib/freeipa.pm b/lib/freeipa.pm index ed64b032..59308f8f 100644 --- a/lib/freeipa.pm +++ b/lib/freeipa.pm @@ -42,6 +42,7 @@ sub start_webui { # https://bugzilla.redhat.com/show_bug.cgi?id=1439429 assert_script_run "sed -i -e 's,enable_xauth=1,enable_xauth=0,g' /usr/bin/startx"; disable_firefox_studies; + assert_script_run "export MOZ_LOG_FILE=/tmp/firefox.log"; type_string "startx /usr/bin/firefox -width 1024 -height 768 https://ipa001.test.openqa.fedoraproject.org\n"; assert_screen ["freeipa_webui_login", $user_screen], 60; wait_still_screen(stilltime => 5, similarity_level => 45); diff --git a/lib/installedtest.pm b/lib/installedtest.pm index 703f2301..b2cc3886 100644 --- a/lib/installedtest.pm +++ b/lib/installedtest.pm @@ -120,6 +120,11 @@ sub post_fail_hook { upload_logs "/var/lib/pgsql/initdb_postgresql.log"; } + # update Firefox default log (for startx firefox tests) + unless (script_run 'test -f /tmp/firefox.log') { + upload_logs "/tmp/firefox.log"; + } + # Upload /var/log # lastlog can mess up tar sometimes and it's not much use unless (script_run "tar czvf /tmp/var_log.tar.gz --exclude='lastlog' /var/log") {