support/testing: test_postgresql.py: use assertRunNotOk()

Use the helper to simplify the test.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
Peter Korsgaard
2026-06-18 14:48:14 +02:00
parent a4ef71a592
commit 382146eff4

View File

@@ -180,8 +180,7 @@ class TestPostgreSQL(infra.basetest.BRTest):
self.assertRunOk(cmd)
# Check the server is no longer ready.
_, exit_code = self.emulator.run("pg_isready")
self.assertNotEqual(exit_code, 0)
self.assertRunNotOk("pg_isready")
# Restart the server.
cmd = f"su - {self.db_admin} -c 'pg_ctl start -D {self.pgdata_dir}'"