From ce0202fe5a55ee0137681f59c3460ca496318e4e Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Apr 19 2023 23:41:53 +0000 Subject: Update to latest git, re-enable OCR tests, backport a patch --- diff --git a/.gitignore b/.gitignore index aa5dbf1..135f7df 100644 --- a/.gitignore +++ b/.gitignore @@ -58,3 +58,4 @@ /os-autoinst-d3d433bda958b473ba7c60bb434760566c0d356b.tar.gz /os-autoinst-436f134262416559c5b7248d4246cbfed67ae835.tar.gz /os-autoinst-5a76fb8e636ccc4fdf22b7738caae6aa40895920.tar.gz +/os-autoinst-6802f4479120a2954adbfba6dbe2779842c5ac91.tar.gz diff --git a/0001-Drop-setting-of-TESSDATA_PREFIX-in-invoke-tests.patch b/0001-Drop-setting-of-TESSDATA_PREFIX-in-invoke-tests.patch new file mode 100644 index 0000000..fad3868 --- /dev/null +++ b/0001-Drop-setting-of-TESSDATA_PREFIX-in-invoke-tests.patch @@ -0,0 +1,34 @@ +From 9ad6aff94093ee4fcc9231cd3eadd4c0934e2216 Mon Sep 17 00:00:00 2001 +From: Adam Williamson +Date: Wed, 19 Apr 2023 16:12:15 -0700 +Subject: [PATCH] Drop setting of TESSDATA_PREFIX in invoke-tests + +It's not appropriate to do this here. This is not the right path +on all distros. Forcing this path here makes it impossible to run +the tests successfully on e.g. Fedora, where the tesseract data +is in /usr/share/tesseract/tessdata (and there is no need to +explicitly specify this, as tesseract is built to find it there +without any such specification). + +Signed-off-by: Adam Williamson +--- + tools/invoke-tests | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/tools/invoke-tests b/tools/invoke-tests +index 15e6593b..8f7de0cc 100755 +--- a/tools/invoke-tests ++++ b/tools/invoke-tests +@@ -52,9 +52,6 @@ fi + export OS_AUTOINST_BUILD_DIRECTORY=$build_directory + export OS_AUTOINST_MAKE_TOOL=$make_path + +-# set TESSDATA_PREFIX for 02-test_ocr.t +-export TESSDATA_PREFIX='/usr/share/tessdata/' +- + args=() + # use unbuffer if it was found so e.g. timestamps on OBS builds will be useful + # note: When executing tests with prove it seems that the output is only flushed after one test has finished unless there's a terminal. +-- +2.40.0 + diff --git a/2096.patch b/2096.patch deleted file mode 100644 index 0373aaf..0000000 --- a/2096.patch +++ /dev/null @@ -1,118 +0,0 @@ -From 9a861cb3e5e7bd58dc0d4aa549c6d3df25f8b24d Mon Sep 17 00:00:00 2001 -From: Marius Kittler -Date: Fri, 17 Jun 2022 17:29:20 +0200 -Subject: [PATCH] Fix using little-endian VNC server on big-endian - -* Fix connecting to a little-endian VNC server from a big-endian - system -* Use byte swap functions instead of custom code to swap the - byte order - * The bswap_32()/bswap_16() functions have the same - behavior as our custom code on little-endian systems and - therefore this change should not do anything on - little-endian systems. - * The bswap_32()/bswap_16() functions change the byte order - also on big-endian systems (in contrast to our custom - code). -* The VNC consoles test has been updated to test both cases - (byte order swap necassary and not necassary). Before it - only tested the case of a little-endian VNC server (and was - therefore only failing on bit-endian systems before this - change). -* Tested the behavior on x86_64 and also on a Tumbleweed - ppc64 VM. -* See https://progress.opensuse.org/issues/111608. ---- - ppmclibs/tinycv_impl.cc | 23 +++++++---------------- - t/27-consoles-vnc.t | 14 +++++++++++++- - 2 files changed, 20 insertions(+), 17 deletions(-) - -diff --git a/ppmclibs/tinycv_impl.cc b/ppmclibs/tinycv_impl.cc -index c987127d5d..93f40571e8 100644 ---- a/ppmclibs/tinycv_impl.cc -+++ b/ppmclibs/tinycv_impl.cc -@@ -10,6 +10,7 @@ - #include - #include - #include -+#include - - #include // std::min - #include -@@ -647,13 +648,10 @@ void image_map_raw_data_rgb555(Image* a, const unsigned char* data) - static uint16_t read_u16(const unsigned char* data, size_t& offset, - bool do_endian_conversion) - { -- uint16_t pixel; -+ uint16_t pixel = *(uint16_t*)(data + offset); -+ offset += 2; - if (do_endian_conversion) { -- pixel = data[offset++] * 256; -- pixel += data[offset++]; -- } else { -- pixel = data[offset++]; -- pixel += data[offset++] * 256; -+ pixel = bswap_16(pixel); - } - return pixel; - } -@@ -668,17 +666,10 @@ Vec3b VNCInfo::read_pixel(const unsigned char* data, size_t& offset) - if (bytes_per_pixel == 2) { - pixel = read_u16(data, offset, do_endian_conversion); - } else if (bytes_per_pixel == 4) { -+ pixel = *(uint32_t*)(data + offset); -+ offset += 4; - if (do_endian_conversion) { -- pixel = data[offset++]; -- pixel <<= 8; -- pixel |= data[offset++]; -- pixel <<= 8; -- pixel |= data[offset++]; -- pixel <<= 8; -- pixel |= data[offset++]; -- } else { -- pixel = *(uint32_t*)(data + offset); -- offset += 4; -+ pixel = bswap_32(pixel); - } - } else if (bytes_per_pixel == 1) { - pixel = data[offset++]; -diff --git a/t/27-consoles-vnc.t b/t/27-consoles-vnc.t -index 455afc0646..be0731c9d6 100755 ---- a/t/27-consoles-vnc.t -+++ b/t/27-consoles-vnc.t -@@ -41,7 +41,6 @@ is_deeply \@printed, ['RFB 003.006', pack('C', 1)], 'protocol version and securi - - # ensure endian conversion is setup correctly (despite initially mocking _server_initialization) - my $machine_is_big_endian = unpack('h*', pack('s', 1)) =~ /01/ ? 1 : 0; --$c->_do_endian_conversion($machine_is_big_endian); - - subtest 'send update request' => sub { - $c->width(1024); -@@ -161,6 +160,7 @@ subtest 'update framebuffer' => sub { - ok $logged_in, 'relogin on protocol error'; - - # test with full data (just one pixel, though) and vncinfo present (defines endianness and chroma subsampling) -+ $c->_do_endian_conversion($machine_is_big_endian); # assume server is little-endian - my $vncinfo = tinycv::new_vncinfo($c->_do_endian_conversion, $c->_true_colour, $c->_bpp / 8, 255, 0, 255, 8, 255, 16); - my $gray_pixel = pack(CCCC => 31, 37, 41, 0); # dark prime grey - my $of_type_raw_with_coordinates_43_47_1_1 = pack(nnnnN => 43, 47, 1, 1, 0); -@@ -181,6 +181,18 @@ subtest 'update framebuffer' => sub { - throws_ok { $c->update_framebuffer } qr/unsupported update encoding -225/, 'dies on unsupported encoding'; - is $s->mocked_read, undef, 'no more messages left to read after reading unknown encoding'; - -+ # test with full data again, assuming the server is big-endian -+ $c->_do_endian_conversion(!$machine_is_big_endian); # assume server is big-endian -+ $vncinfo = tinycv::new_vncinfo($c->_do_endian_conversion, $c->_true_colour, $c->_bpp / 8, 255, 0, 255, 8, 255, 16); -+ $gray_pixel = pack(CCCC => 0, 41, 37, 31); # dark prime grey -+ $s->set_series(mocked_read => $update_message, $one_rectangle, $of_type_raw_with_coordinates_43_47_1_1, $gray_pixel); -+ $c->_framebuffer(undef)->width(1024)->height(512)->vncinfo($vncinfo); -+ ok $c->update_framebuffer, 'truthy return value for successful pixel update of big-endian server'; -+ ($blue, $green, $red) = $c->_framebuffer->get_pixel(43, 47); -+ is $blue, 41, 'pixel data updated in framebuffer (blue, big-endian server)'; -+ is $green, 37, 'pixel data updated in framebuffer (green, big-endian server)'; -+ is $red, 31, 'pixel data updated in framebuffer (red, big-endian server)'; -+ - $c->ikvm(1); - my $unsupported_ikvm_encoding = pack(nnnnN => 0, 0, 1, 1, 88); - my $ikvm_specific_data = pack(NN => 0, 9); # some "prefix" and data length diff --git a/os-autoinst.spec b/os-autoinst.spec index e281472..51e6a51 100644 --- a/os-autoinst.spec +++ b/os-autoinst.spec @@ -30,23 +30,28 @@ %global github_owner os-autoinst %global github_name os-autoinst %global github_version 4.6 -%global github_commit 5a76fb8e636ccc4fdf22b7738caae6aa40895920 +%global github_commit 6802f4479120a2954adbfba6dbe2779842c5ac91 # if set, will be a post-release snapshot build, otherwise a 'normal' build -%global github_date 20221122 +%global github_date 20230418 %global shortcommit %(c=%{github_commit}; echo ${c:0:7}) Name: os-autoinst Version: %{github_version}%{?github_date:^%{github_date}git%{shortcommit}} -Release: 3%{?dist} +Release: 1%{?dist} Summary: OS-level test automation License: GPLv2+ URL: https://os-autoinst.github.io/openQA/ Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{github_name}-%{github_commit}.tar.gz +# https://github.com/os-autoinst/os-autoinst/pull/2303 +# Fix tests with Fedora tesseract data location +Patch0: 0001-Drop-setting-of-TESSDATA_PREFIX-in-invoke-tests.patch # on SUSE this is conditional, for us it doesn't have to be but we # still use a macro just to keep build_requires similar for ease of # cross-comparison %define opencv_require pkgconfig(opencv) +# Ditto +%define ocr_requires tesseract tesseract-langpack-eng # The following line is generated from dependencies.yaml (upstream) %define build_base_requires %opencv_require gcc-c++ perl(Pod::Html) pkg-config pkgconfig(fftw3) pkgconfig(libpng) pkgconfig(sndfile) pkgconfig(theoraenc) # diff from SUSE: SUSE has 'ninja', Fedora has 'ninja-build' @@ -76,7 +81,7 @@ Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{gith %define test_version_only_requires perl(Mojo::IOLoop::ReadWriteProcess) >= 0.28 # diff from SUSE: it's python3-pillow-tk, not python3-Pillow-tk # The following line is generated from dependencies.yaml (upstream) -%define test_requires %build_requires %test_base_requires %yamllint_requires perl(Inline::Python) perl(YAML::PP) python3-pillow-tk +%define test_requires %build_requires %ocr_requires %test_base_requires %yamllint_requires perl(Inline::Python) perl(YAML::PP) python3-pillow-tk # diff from SUSE: dropped perl(Devel::Cover::Report::Codecov) as it's # not currently packaged for Fedora # The following line is generated from dependencies.yaml (upstream) @@ -142,11 +147,6 @@ rm -f t/99-full-stack.t rm -f t/13-osutils.t %endif # no_osutils -# Tesseract 4.0.0 (in Rawhide as of 2018-11) fails utterly to OCR -# the test needle properly: -# https://github.com/tesseract-ocr/tesseract/issues/2052 -rm -f t/02-test_ocr.t - # exclude unnecessary author tests rm xt/00-tidy.t # Remove test relying on a git working copy @@ -244,6 +244,9 @@ rm tools/lib/perlcritic/Perl/Critic/Policy/*.pm %files devel %changelog +* Wed Apr 19 2023 Adam Williamson - 4.6^20230418git6802f44-1 +- Update to latest git, re-enable OCR tests + * Thu Jan 19 2023 Fedora Release Engineering - 4.6^20221122git5a76fb8-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild diff --git a/sources b/sources index 4dece3d..dd37e0e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (os-autoinst-5a76fb8e636ccc4fdf22b7738caae6aa40895920.tar.gz) = 74adac6f7f1134f8b6db85fb141246f3a40b81cf23d5f5213ad26da507e38c189522b8e576493070c11d589b3a71c8aa4b3e31d1b8b8f2a3cbe604c894d4af29 +SHA512 (os-autoinst-6802f4479120a2954adbfba6dbe2779842c5ac91.tar.gz) = d903cb9e628a58ecc45a52a4c58060c62e6f854e4ef4b72a92836088cc3f5738a61f1d31c371b649de36c4a2075b7b9a78fdf9dc77e5f561d98dd0c20ef7a7ca