Remove post_scriptum.pm

This commit is contained in:
Lukáš Růžička 2026-04-21 13:24:13 +02:00
commit 1b7d465e39

View file

@ -1,120 +0,0 @@
use base "installedtest";
use strict;
use warnings;
use testapi;
use utils;
sub assert_cmd_output_eq {
my ($cmd, $expected) = @_;
my $out = script_output($cmd, timeout => 60);
chomp($out);
die("Unexpected output for [$cmd]: got [$out], expected [$expected]") unless $out eq $expected;
}
sub run_as_user {
my ($user, $cmd) = @_;
return script_output(qq{su -l $user -c 'dbus-run-session bash -lc "$cmd"'}, timeout => 60);
}
sub assert_as_user_eq {
my ($user, $cmd, $expected) = @_;
my $out = run_as_user($user, $cmd);
chomp($out);
die("Unexpected user output for [$cmd]: got [$out], expected [$expected]") unless $out eq $expected;
}
sub assert_as_user_matches {
my ($user, $cmd, $regex) = @_;
my $out = run_as_user($user, $cmd);
die("Unexpected user output for [$cmd]: [$out] does not match [$regex]") unless $out =~ $regex;
}
sub assert_password {
# Test the password if it is correct.
my ($user, $password) = @_;
enter_cmd("su - $user"); # Switch to user account to lose admin rights.
# The following command will not show the username without the correct password
my $result = script_run("su - $user -c 'whoami' <<< $password | grep -x $user");
enter_cmd("exit");
return $result;
}
sub run {
my $self = shift;
my $user = get_var("TESTLOGIN", "rhood");
my $password = get_var("TESTPASSWORD", "nottingham");
# Switch to the serial console. To run commands successfully,
# we need to load english keyboard layout. Otherwise, we cannot
# run commands correctly. Note, that the loadkeys command must
# be presented in the foreign layout.
$self->root_console(tty => 3);
console_loadkeys_us();
assert_script_run("chmod 666 /dev/${serialdev}");
# Check that system locale are set to Czech (cs_CZ.UTF-8)
assert_script_run("grep -x 'LANG=cs_CZ.UTF-8' /etc/locale.conf");
assert_script_run("localectl status | grep -E 'System Locale:.*LANG=cs_CZ\.UTF-8'");
assert_script_run('localectl status | grep -E "VC Keymap: cz"');
# Check that the time zone has been set to Bratislave, Europe
assert_cmd_output_eq(q{timedatectl show -p Timezone --value}, 'Europe/Bratislava');
assert_script_run(q{readlink -f /etc/localtime | grep -x '/usr/share/zoneinfo/Europe/Bratislava'});
# Check that user exists and that a correct password is set.
assert_script_run("id $user");
die("The expected password: $password is not valid for user $user.") if (assert_password($user, $password) != 0);
# Check that third party repositories have been enabled.
# FIXME: Workaround, currently we have a bug
# https://bugzilla.redhat.com/show_bug.cgi?id=2446745 and third party repos are not
# enabled, even if clicked in GIS. This will record a soft fail and enable them for now.
# When the bug is gone, we should delete the workaround.
my $result = script_run(q{fedora-third-party query | grep enabled}, timeout => 60);
if ($result != 0) {
record_soft_failure("The third party repositories are not switched on.");
assert_script_run("fedora-third-party enable");
assert_script_run("fedora-third-party query | grep enabled");
}
else {
record_info("Workaround for BZ2446745", "It seems that the bug has been fixed. Edit the test script to disable workaround.");
}
assert_script_run(q{fedora-third-party list --csv --columns=name,type | grep -q .});
# Optional extra proof on the DNF side:
assert_script_run(q{dnf repolist --enabled | grep -E 'fedora-cisco-openh264|google-chrome|rpmfusion'});
# Check the geolocation service are enabled for the user
assert_as_user_eq($user,
q{gsettings get org.gnome.system.location enabled},
'true'
);
# Check that keyboard layout and the locales are correct in user space
assert_as_user_matches($user,
q{gsettings get org.gnome.desktop.input-sources sources},
qr/\('xkb',\s*'cz'\)/
);
assert_as_user_matches($user,
q{locale},
qr/^LANG=cs_CZ\.UTF-8$/m
);
# Check that automatic reporting is enabled.
# This is the most likely key. If this ever fails because the key changed,
# replace it with the exact key confirmed by a one-time gsettings diff.
assert_as_user_eq($user,
q{gsettings get org.gnome.desktop.privacy report-technical-problems},
'true'
);
}
sub test_flags {
return {fatal => 1};
}
1;
# vim: set sw=4 et: