Review the gnome_initial_setup_post.pm

This commit is contained in:
Lukáš Růžička 2026-04-28 22:48:25 +02:00
commit c0ddacebd3

View file

@ -4,13 +4,6 @@ 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) = @_;
enter_cmd("su - $user");
@ -55,10 +48,7 @@ sub run {
# However, if we did, we want to know.
$locale_check = 1 if (get_var('LANGSELECT'));
# 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.
# Switch to the serial console.
$self->root_console(tty => 3);
assert_script_run("chmod 666 /dev/${serialdev}");
@ -67,6 +57,8 @@ sub run {
record_info("Lang settings", "Language and keyboard layout checks are switched off!");
}
else {
# We have set up a non-US keyboard layout but to run commands successfully,
# we need to load US keyboard layout.
console_loadkeys_us();
# 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");
@ -75,7 +67,7 @@ sub run {
}
# Check that the time zone has been set to Bratislave, Europe
assert_cmd_output_eq(q{timedatectl show -p Timezone --value}, 'Europe/Bratislava');
validate_screen_output("timedatectl show -p Timezone --value", sub { /Europe\/Bratislava/ }, timeout => 60);
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.