mirror of
https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git
synced 2024-12-21 18:03:11 +00:00
Update check_default_fonts to match the new test case
The test case was completely changed earlier this year. Per https://bugzilla.redhat.com/show_bug.cgi?id=2093080#c17 , atagoh wants us to use the new test case for validation and have openQA automate it, so, this does that. I already updated the matrix earlier in the year, I will update fedora_openqa when this is merged. Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
parent
8d6328ba8a
commit
cfb3b793e3
@ -0,0 +1,16 @@
|
||||
{
|
||||
"area": [
|
||||
{
|
||||
"width": 18,
|
||||
"type": "match",
|
||||
"height": 18,
|
||||
"ypos": 8,
|
||||
"xpos": 119
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"tags": [
|
||||
"gnome_layout_us",
|
||||
"gnome_layout_ascii"
|
||||
]
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 1.1 MiB |
@ -3,11 +3,21 @@ use strict;
|
||||
use testapi;
|
||||
use utils;
|
||||
|
||||
# This test cases automates the Testcase_i18n_default_fonts, see
|
||||
# https://fedoraproject.org/wiki/QA:Testcase_i18n_default_fonts.
|
||||
# This test cases automates Testcase_default_font_installation, see
|
||||
# https://fedoraproject.org/wiki/QA:Testcase_default_font_installation
|
||||
|
||||
sub run {
|
||||
my $self = shift;
|
||||
my $language = get_var("LANGUAGE");
|
||||
my @supported = qw(japanese arabic);
|
||||
return unless ($language ~~ @supported);
|
||||
# we need to install the check tool
|
||||
$self->root_console(tty => 3);
|
||||
script_run("loadkeys us");
|
||||
assert_script_run("dnf -y install fontquery");
|
||||
# and give the user tty perms for later
|
||||
assert_script_run("chmod 666 /dev/${serialdev}");
|
||||
desktop_vt;
|
||||
|
||||
# On the console, the fonts might differ than in GUI.
|
||||
# We will perform the tests in the gnome-terminal.
|
||||
@ -25,47 +35,11 @@ sub run {
|
||||
assert_screen("apps_run_terminal");
|
||||
wait_still_screen(stilltime => 5, similarity_level => 42);
|
||||
|
||||
# Run the test commands and record their output in the test file.
|
||||
enter_cmd("fc-match sans > test.txt");
|
||||
sleep(2);
|
||||
enter_cmd("fc-match serif >> test.txt");
|
||||
sleep(2);
|
||||
enter_cmd("fc-match monospace >> test.txt");
|
||||
sleep(2);
|
||||
|
||||
# Depending on the selected language (Japanese or Arabic), we
|
||||
# will download a reference file and compare it with the test
|
||||
# file obtained in the previous step.
|
||||
|
||||
my $language = get_var("LANGUAGE");
|
||||
my @supported = qw(japanese arabic);
|
||||
# If the language is among supported languages
|
||||
if ($language ~~ @supported) {
|
||||
# Go to root console for script assertions.
|
||||
$self->root_console(tty => 3);
|
||||
# Load us keys to be used on console
|
||||
script_run("loadkeys us");
|
||||
# Navigate to the home directory.
|
||||
my $username = get_var("USER_LOGIN") // "test";
|
||||
script_run("cd /home/$username/");
|
||||
# Download the language reference file.
|
||||
script_run("wget https://fedorapeople.org/groups/qa/openqa-fonts/$language-reference.txt");
|
||||
# upload the log for debugging.
|
||||
upload_logs "test.txt", failok => 1;
|
||||
# Compare the test file and the reference file.
|
||||
# We have been having a lot of failures on the Install Arabic test because of this
|
||||
# part, which is actually testing an optional test. Unfortunately, it is still
|
||||
# not clear what the current situation on Fedora should be and this will need
|
||||
# more investigation.
|
||||
# For now, let us softfail instead of fail until we know for sure how what the outcome
|
||||
# should be.
|
||||
my $exit = script_run("diff -u test.txt $language-reference.txt", timeout => 15);
|
||||
if ($exit != 0) {
|
||||
record_soft_failure("The default fonts differ from what is expected, see RBZ#2093080.");
|
||||
}
|
||||
}
|
||||
|
||||
# For the rest of languages that are not currently defined, do nothing.
|
||||
# Run the test command
|
||||
my %codes = ("japanese" => "ja", "arabic" => "ar");
|
||||
my $code = $codes{$language};
|
||||
my $release = lc(get_var("VERSION"));
|
||||
assert_script_run("fontquery-diff -l ${code} ${release}", 300);
|
||||
}
|
||||
|
||||
sub test_flags {
|
||||
|
Loading…
Reference in New Issue
Block a user