Project

General

Profile

Actions

action #120918

closed

[qe-core][opensuse] test fails in php_mysql: check_version('>=10.4') treats version 10.10 as 'lower'

Added by dimstar over 1 year ago. Updated about 1 year ago.

Status:
Resolved
Priority:
Urgent
Assignee:
Category:
Bugs in existing tests
Target version:
Start date:
2022-11-24
Due date:
% Done:

0%

Estimated time:
Difficulty:
Sprint:
QE-Core: January Sprint (Jan 11 - Feb 08)

Description

Observation

Mariadb was updated to version 10.10. openQA now reports authentication failures in the php_mysql tests.
The issue seems to be that this code returns the wrong outcome:

    my $mysql_version = script_output qq{mysql -sN -u root -e "SELECT VERSION();"};
    if (check_version('>=10.4', $mysql_version)) {
        # MariaDB changed the default authentication method since version 10.4
        # https://mariadb.org/authentication-in-mariadb-10-4/
        # https://bugzilla.suse.com/show_bug.cgi?id=1165151
        my $mysql_root_password = "ALTER USER root\@localhost IDENTIFIED VIA mysql_native_password USING PASSWORD(\'\');";
        assert_script_run qq{mysql -u root -e "$mysql_root_password"};
    }
    record_info($mysql_version);

So, openQA knows that when a version >= 10.4 is in use, we need to set a root password; but check_version treats 10.10 as < 10.4

openQA test in scenario opensuse-Tumbleweed-DVD-x86_64-extra_tests_webserver@64bit fails in
php_mysql

Test suite description

Reproducible

Fails since (at least) Build 20221123

Expected result

Last good: 20221122 (or more recent)

Further details

Always latest result in this scenario: latest

Suggestions

  • Start by adding the test case in the unit tests for check_version
  • Consider depending more on version module to properly parse versions.
Actions #1

Updated by szarate over 1 year ago

  • Sprint set to QE-Core: November Sprint (Nov 09 - Dec 07)
  • Tags set to bugbusters
  • Subject changed from test fails in php_mysql: check_version('>=10.4') treats version 10.10 as 'lower' to [qe-core][opensuse] test fails in php_mysql: check_version('>=10.4') treats version 10.10 as 'lower'
  • Description updated (diff)
  • Status changed from New to Workable
  • Target version set to QE-Core: Ready
Actions #2

Updated by szarate over 1 year ago

  • Tags changed from bugbusters to bugbusters, refactoring
  • Priority changed from Normal to Urgent
Actions #3

Updated by VANASTASIADIS over 1 year ago

  • Status changed from Workable to In Progress
  • Assignee set to VANASTASIADIS
Actions #4

Updated by VANASTASIADIS over 1 year ago

The problem is not that we don't use the Version module, but instead that we use it. Also that the check_version function is bugged and hasn't failed so far by pure luck.

The version module can't parse the form of the provided version (10.10.2-mariadb) from string to version. Instead of aborting or doing something else after the failure to parse (see the if_lax check on the code), check_version proceeds to compare the version strings. And of course, in string comparison 10.10 is smaller than 10.4 (alphabetic precedence).

A solution is to use zypper vcmp, which provides the correct result, if the conversion of string to version fails. Or only use zypper vcmp in the first place.

Actions #6

Updated by szarate about 1 year ago

Created SR#1039112: osc sr devel:languages:perl:CPAN-S perl-SemVer devel:languages:perl
once that's accepted, SemVer needs to go to openSUSE:Factory, and to devel:openQA:Leap

if I got it correctly, the following commands are:

  • osc linkpac openSUSE:Factory perl-SemVer devel:openQA:Leap:15.4
  • osc sr openSUSE:Factory perl-SemVer openSUSE:Leap:15.4
  • osc sr openSUSE:Factory perl-SemVer openSUSE:Leap:15.5

https://suse.slack.com/archives/C02CSAZLAR4/p1669808139461379

Actions #7

Updated by okurz about 1 year ago

sounds good

Actions #8

Updated by szarate about 1 year ago

szarate wrote:

Created SR#1039112: osc sr devel:languages:perl:CPAN-S perl-SemVer devel:languages:perl

Round two (possibly, the right way) to get the package into obs://devel:languages:perl:

# Branch the package to the home project
osc branch devel:languages:perl:CPAN-S perl-SemVer

# check it out, and go to it:
osc co home:szarate:branches:devel:languages:perl:CPAN-S/perl-SemVer
cd home\:szarate\:branches\:devel\:languages\:perl\:CPAN-S/perl-SemVer/ # because tab is magic!

# Edit the package metadata to add, Title, Description and URL nodes to the xml:
osc meta pkg -e # If you make mistakes, obs will be kind enough to let you know it can't accept the file and let you continue editing

# Create a .changes file and add it to the package's repository
osc vc
osc add perl-SemVer.changes

# Submit the package to the desired project:
osc sr devel:languages:perl
Actions #9

Updated by szarate about 1 year ago

osc sr devel:languages:perl perl-SemVer openSUSE:Factory for https://build.opensuse.org/request/show/1039578

Actions #10

Updated by szarate about 1 year ago

Packages are already in the corresponding places:

https://build.opensuse.org/package/show/devel:openQA:Leap:15.4/perl-SemVer

osc linkpac openSUSE:Factory perl-SemVer devel:openQA:Leap:15.4
osc sr openSUSE:Factory perl-SemVer openSUSE:Leap:15.5 # https://build.opensuse.org/request/show/1040208
Actions #11

Updated by szarate about 1 year ago

  • Sprint changed from QE-Core: November Sprint (Nov 09 - Dec 07) to QE-Core: December Sprint (Dec 07 - Jan 04)
Actions #12

Updated by slo-gin about 1 year ago

This ticket was set to Urgent priority but was not updated within the SLO period. Please consider picking up this ticket or just set the ticket to the next lower priority.

Actions #13

Updated by slo-gin about 1 year ago

This ticket was set to Urgent priority but was not updated within the SLO period. Please consider picking up this ticket or just set the ticket to the next lower priority.

Actions #14

Updated by slo-gin about 1 year ago

This ticket was set to Urgent priority but was not updated within the SLO period. Please consider picking up this ticket or just set the ticket to the next lower priority.

Actions #15

Updated by slo-gin about 1 year ago

This ticket was set to Urgent priority but was not updated within the SLO period. Please consider picking up this ticket or just set the ticket to the next lower priority.

Actions #16

Updated by slo-gin about 1 year ago

This ticket was set to Urgent priority but was not updated within the SLO period. Please consider picking up this ticket or just set the ticket to the next lower priority.

Actions #17

Updated by szarate about 1 year ago

  • Sprint changed from QE-Core: December Sprint (Dec 07 - Jan 11) to QE-Core: January Sprint (Jan 11 - Feb 08)
Actions #18

Updated by VANASTASIADIS about 1 year ago

  • Status changed from In Progress to Feedback

pr merged. Keeping it on feedback for a day, then resolving.
https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/16000

Actions #19

Updated by VANASTASIADIS about 1 year ago

  • Status changed from Feedback to Resolved
Actions

Also available in: Atom PDF