Skip to content

systemtests: fix plugin postgresql testrunner-*, old postgres bc call#1948

Merged
joergsteffens merged 6 commits intobareos:bareos-23from
bruno-at-bareos:backport/bareos-23/systemtest-fix-postgres_postgresql
Sep 25, 2024
Merged

systemtests: fix plugin postgresql testrunner-*, old postgres bc call#1948
joergsteffens merged 6 commits intobareos:bareos-23from
bruno-at-bareos:backport/bareos-23/systemtest-fix-postgres_postgresql

Conversation

@bruno-at-bareos
Copy link
Contributor

@bruno-at-bareos bruno-at-bareos commented Sep 3, 2024

Backport of PR #1947 to bareos-23

Also to fix issue during build and testing the old postgres plugin, we replaced the calls of bc tool by simple sh expressions.

Please check

  • Short description and the purpose of this PR is present above this paragraph
  • Your name is present in the AUTHORS file (optional)

If you have any questions or problems, please give a comment in the PR.

Helpful documentation and best practices

Checklist for the reviewer of the PR (will be processed by the Bareos team)

Make sure you check/merge the PR using devtools/pr-tool to have some simple automated checks run and a proper changelog record added.

General
  • Is the PR title usable as CHANGELOG entry?
  • Purpose of the PR is understood
  • Commit descriptions are understandable and well formatted
  • Original PR systemtests: fix plugin postgresql testrunner-* #1947 is merged
  • Required backport PRs have been created
  • Correct milestone is set
Source code quality
  • Source code changes are understandable
  • Variable and function names are meaningful
  • Code comments are correct (logically and spelling)
  • Required documentation changes are present and part of the PR
Tests
  • Decision taken that a test is required (if not, then remove this paragraph)
  • The choice of the type of test (unit test or systemtest) is reasonable
  • Testname matches exactly what is being tested
  • On a fail, output of the test leads quickly to the origin of the fault

@bruno-at-bareos bruno-at-bareos added this to the 23.1.0 milestone Sep 3, 2024
@bruno-at-bareos bruno-at-bareos changed the title systemtest fix plugin old postgres and newer postgresql systemtests: fix plugin postgresql testrunner-debian, old postgres bc call Sep 4, 2024
@pstorz pstorz assigned joergsteffens and unassigned arogge Sep 10, 2024
@pstorz pstorz requested review from joergsteffens and removed request for arogge September 10, 2024 09:20
@bruno-at-bareos bruno-at-bareos force-pushed the backport/bareos-23/systemtest-fix-postgres_postgresql branch from 77246da to a23a0cc Compare September 11, 2024 16:08
external `bc` command usage replaced by pure sh expression

Signed-off-by: Bruno Friedmann <bruno.friedmann@bareos.com>
(cherry picked from commit 77246da)
- commit 475b131 was needed to extract the correct major version
  it was reworked to use `pg_lsclusters` to detect server version
  instead `psql` tool version.
- if installed postgresql is lower than major 10 the tests is
  marked as skipped.
- the `pg_*cluster` commands need to be run as root user.
  the systemtest will now check that condition and mark the test
  as `skipped` if not.

Signed-off-by: Bruno Friedmann <bruno.friedmann@bareos.com>
(cherry picked from commit 521733c)
fix all testrunner (except debian)

- move redondant code for PG_VERSION to `setup_local_db.sh`
- move redondant check PG_VERSION > 10 to `setup_local_db.sh`
- add --no-psqlrc flag to PGSQL command

Signed-off-by: Bruno Friedmann <bruno.friedmann@bareos.com>
(cherry picked from commit 273d486)
@bruno-at-bareos bruno-at-bareos force-pushed the backport/bareos-23/systemtest-fix-postgres_postgresql branch from a23a0cc to 9744147 Compare September 11, 2024 16:09
@bruno-at-bareos bruno-at-bareos changed the title systemtests: fix plugin postgresql testrunner-debian, old postgres bc call systemtests: fix plugin postgresql testrunner-*, old postgres bc call Sep 11, 2024
Copy link
Member

@joergsteffens joergsteffens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally this looks good, only two minor remarks left.

For testrunner-debian, we want to pick up the highest available
major version pg_lsclusters will handle (mostly main cluster).

(cherry picked from commit 2c5b3cc)
Signed-off-by: Bruno Friedmann <bruno.friedmann@bareos.com>
(cherry picked from commit 328922a)
@joergsteffens joergsteffens merged commit 5db30f2 into bareos:bareos-23 Sep 25, 2024
@bruno-at-bareos bruno-at-bareos deleted the backport/bareos-23/systemtest-fix-postgres_postgresql branch November 25, 2024 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants