forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
release-21.1: acceptance: run
python
, psql
containers as current uid
Manual cherry-pick from cockroachdb#81460. `postgres`'s permission checking for certificates has gotten more rigorous since [this commit](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=a59c79564bdc209a5bc7b02d706f0d7352eb82fa). This has broken a couple `acceptance` tests which do not pin to any specific `postgres` version (see cockroachdb#81313, cockroachdb#81437). Here we attempt to solve the problem "once and for all" by ensuring that these containers run with a UID that is equal to the one that created the certificates. Release note: None
- Loading branch information
1 parent
dd62bad
commit b065031
Showing
8 changed files
with
46 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,11 @@ set -e | |
|
||
echo psql | kinit [email protected] | ||
|
||
echo "Preparing SQL user ahead of test" | ||
env \ | ||
PGSSLKEY=/certs/client.root.key \ | ||
PGSSLCERT=/certs/client.root.crt \ | ||
psql -U root -c "ALTER USER root WITH PASSWORD rootpw" | ||
|
||
echo "Running test" | ||
./gss.test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,18 @@ | |
|
||
set -e | ||
|
||
echo psql | kinit [email protected] | ||
|
||
export PGSSLKEY=/certs/client.root.key | ||
export PGSSLCERT=/certs/client.root.crt | ||
export PGUSER=root | ||
|
||
psql -c "SET CLUSTER SETTING server.host_based_authentication.configuration = 'host all all all gss include_realm=0'" | ||
psql -c "CREATE USER tester" | ||
|
||
echo psql | kinit [email protected] | ||
unset PGSSLKEY | ||
unset PGSSLCERT | ||
export PGUSER=tester | ||
|
||
# Exit with error unless we find the expected error message. | ||
python manage.py inspectdb 2>&1 | grep 'use of GSS authentication requires an enterprise license' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters