1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-12-22 10:23:09 +00:00

Tweak desktop_vt tty detector a bit

The intent is that if the ps check finds nothing we'll use the
loginctl output, but that doesn't work because script_output
doesn't return the output if the script fails. There's an arg
you can pass to make it do so, but let's just make it always
succeed instead, by adding a ||: to the second grep like we have
for the first.

Also, I noticed this problem because the ps check started not
working on F36 KDE because none of the processes we check for
are shown as running on a tty, so let's add one more that *is*
shown as running on a tty...

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2022-02-22 16:54:03 -08:00
parent 10df5a57bf
commit c33b137e88

View File

@ -267,7 +267,7 @@ sub desktop_vt {
# os-autoinst calls the script with 'bash -e' which causes it to
# stop as soon as any command fails, so we use ||: to make the
# first grep return 0 even if it matches nothing
eval { $xout = script_output ' loginctl | grep test ||:; ps -e | egrep "(gnome-session|Xwayland|Xorg)" | grep -o tty[0-9]' };
eval { $xout = script_output ' loginctl | grep test ||:; ps -e | egrep "(startplasma|gnome-session|Xwayland|Xorg)" | grep -o tty[0-9] ||:' };
my $tty = 1; # default
while ($xout =~ /tty(\d)/g) {
$tty = $1; # most recent match is probably best