oliver-zehentleitner / maity

deploy: a shared test-lib.sh for the backup and restore test scripts (extract, backup.yaml scripts, fail, re-root)

Sign in to report

tsk-3rmvt8hbwkpt Open

Audit round 3 (tsk-hgnbapyw7hnh), read at 588f911b. Kind: duplication (test harness). Running these tests in CI is a note on tsk-0ssrf55nnvgx.

What is wrong: the new deploy test scripts repeat their harness:

  • deploy/scripts/test-backup-dump.sh:16-23 and test-backup-signing.sh:18-25: the same Python snippet pulls init.sh and dump.sh out of backup.yaml.
  • test-restore-blocks.sh:23-30 and test-backup-signing.sh:124-131: the same extract() awk (the second commented "as in test-restore-blocks.sh").
  • fail() at test-backup-dump.sh:38 and test-backup-signing.sh:47; the sed re-rooting of deploy/postgres-roles.sql at test-restore-blocks.sh:33 and test-backup-signing.sh:135.

Proposal: a sourced deploy/scripts/test-lib.sh with extract, backup_scripts, fail and the re-root.

Effort / risk: S. Low risk (test only).