vault
vault copied to clipboard
Add integration test for multihost connection strings in Postgres using replication manager
Postgres supports multiple hosts in a connection string like so:
connection_url="postgresql://{{username}}:{{password}}@hostone:5432,hosttwo:5432/postgres"
With pgx, Vault now supports this too. To have test coverage of this feature, we can use postgres containers with replication manager set up in a cluster and then test generating credentials on it.
Only the leader can perform writes and the secondary instance is read-only. By performing a shutdown on the leader, we can test that after a failover event occurs the secrets engine still works as expected.