-
Notifications
You must be signed in to change notification settings - Fork 283
/
Copy pathlocale.pm
95 lines (83 loc) · 2.98 KB
/
locale.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# SUSE's openQA tests
#
# Copyright 2021 SUSE LLC
# SPDX-License-Identifier: FSFAP
package locale;
use base "opensusebasetest";
use strict;
use warnings;
use testapi;
use utils;
use Utils::Backends 'has_ttys';
use x11utils 'turn_off_gnome_suspend';
sub verify_default_keymap_textmode_non_us {
my ($self, $test_string, $tag) = @_;
# Installation with different keyboard layout is not feature ready but
# in case of autoyast scenarios we can simply test on login prompt without changing tty
type_string $test_string;
assert_screen ["${tag}", "${tag}_not_ready"];
if (match_has_tag "${tag}_not_ready") {
# i.e: in cz keyboard the first half in the keystroke list is not displayed in 1st login'
send_key 'ret' for (1 .. 2);
assert_screen 'login-incorrect';
record_soft_failure 'bsc#1125886 - Special characters when switching keyboard layout only available after 2nd login';
assert_screen([qw(linux-login cleared-console)]);
type_string $test_string;
assert_screen "${tag}";
}
}
sub verify_default_keymap_textmode {
my ($self, $test_string, $tag, %tty) = @_;
if (defined($tty{console})) {
select_console($tty{console});
}
else {
send_key('alt-f3');
# remote backends can not provide a "not logged in console" so we use
# a cleared remote terminal instead
assert_screen(has_ttys() ? 'linux-login' : 'cleared-console');
}
wait_still_screen;
type_string($test_string);
assert_screen($tag);
# clear line in order to add user bernhard to tty group
# clear line to avoid possible failures in following console tests if scheduled
assert_screen_change { send_key("ctrl-u") };
}
sub notification_handler {
my ($feature, $state) = @_;
select_console('user-console');
assert_script_run("(gsettings get $feature && gsettings set $feature $state) 2>/dev/null || true");
}
sub verify_default_keymap_x11 {
my ($self, $test_string, $tag, $program) = @_;
notification_handler('org.gnome.DejaDup periodic', 'false') if (check_var('DESKTOP', 'gnome'));
turn_off_gnome_suspend if (check_var('DESKTOP', 'gnome'));
select_console('x11');
x11_start_program($program);
type_string($test_string);
assert_screen($tag);
# clear line to avoid possible failures in following tests (eg. updates_packagekit_gpk)
send_key("ctrl-w");
# close xterm
send_key("ctrl-d");
}
sub get_keystroke_list {
my ($self, $layout) = @_;
my %keystrokes = (
us => '`1234567890-=~!@#$%^&*()_+',
fr => '²&é"(-è_çà)=~1234567890°+',
de => '1234567890ß°!"§$%&/()=?',
cz => ';+ěščřžýáíé=1234567890%'
);
return $keystrokes{$layout};
}
# post_fail_hook for upload logs for test module which uses it as base
# see https://progress.opensuse.org/issues/56636
sub post_fail_hook {
my ($self) = shift;
return if get_var('NOLOGS');
select_console('log-console');
$self->SUPER::post_fail_hook;
}
1;