Skip to content

test: the boot test asserts the database hooks and the cluster after first boot - #17

Open
marcos-mendez wants to merge 1 commit into
mainfrom
test/cluster-active-after-first-boot
Open

marcos-mendez wants to merge 1 commit into
mainfrom
test/cluster-active-after-first-boot

Conversation

@marcos-mendez

@marcos-mendez marcos-mendez commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

On the step 12 image (2026-10-09), postgresql@17-main started before keel-host-keys made the snakeoil certificate and stopped (FATAL: could not load server certificate file "/etc/ssl/certs/ssl-cert-snakeoil.pem"). 35pgsqlpass and 36pgsqlverify failed. Then 36pgsqlverify started the cluster again, so the cluster was active at the end, and the boot test failed only later, on the declared password.

Reproduced on the published layer in LXC, with keel-host-keys made 10 s slower: the same FATAL, the same two hook failures, the cluster active at the end. The cluster waits only for network.target, so it is a race between the network and keel-host-keys.

Change

After the first boot, tests/boot-test.sh now checks:

  • bt_db_hooks_verdict: 35pgsqlpass and 36pgsqlverify completed, from /var/log/inithooks.log. A cluster that is active at the end is not sufficient (see above).
  • bt_cluster_verdict: there is a cluster unit (systemctl list-units --all postgresql@*.service), and every cluster is active (running).

Seven new tests in tests/boot-test.bats; tests/lib/boot-test-lib.sh stays at 100 percent (173/173). This change is to tests only, so there is no changelog entry and no version bump.

Fix

Keel-Linux/inithooks#45 orders every [email protected] instance after keel-host-keys.service. With that drop-in in the same slow rootfs, both hooks complete and the cluster starts after the certificate exists. The appliance / boot-published-layer check boots the published layer upgraded from trixie-testing. Thus it fails until inithooks 2.3.6+keel26 is in the archive. It fails on main now for the same cause.

…first boot

On the step 12 image of 2026-10-09, postgresql@17-main started before
keel-host-keys made the snakeoil certificate and stopped. 35pgsqlpass and
36pgsqlverify failed, then 36pgsqlverify started the cluster again, so the
cluster was active at the end. The boot test failed only later, on the
declared password. Reproduced on the published layer with keel-host-keys
made 10 s slower.

tests/boot-test.sh now checks, after the first boot:
- bt_db_hooks_verdict: 35pgsqlpass and 36pgsqlverify completed, from
  /var/log/inithooks.log;
- bt_cluster_verdict: there is a cluster unit (systemctl list-units
  postgresql@*.service) and every cluster is active (running).

Seven new tests in tests/boot-test.bats; tests/lib/boot-test-lib.sh stays
at 100 percent.

The fix is Keel-Linux/inithooks#45.
@marcos-mendez
marcos-mendez force-pushed the test/cluster-active-after-first-boot branch from 7d134e0 to df7b21f Compare October 10, 2026 19:26
@marcos-mendez marcos-mendez changed the title test: the boot test asserts every PostgreSQL cluster is active after first boot test: the boot test asserts the database hooks and the cluster after first boot Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant