]> granicus.if.org Git - pgbouncer/commitdiff
Add test for md5 authentication with plain-text password stored
authorPeter Eisentraut <peter@eisentraut.org>
Sun, 11 Aug 2019 16:32:46 +0000 (18:32 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Sun, 11 Aug 2019 16:32:46 +0000 (18:32 +0200)
Now we have tests for all four combinations of plain-text and md5
passwords and plain and md5 authentication.

test/test.sh

index 3a52fefbc6ad14670501e65ae100768b8c4327b7..2fae0de6f1334079e37eed0365e0dbe10c6bb5f7 100755 (executable)
@@ -607,6 +607,8 @@ test_password_server() {
 test_password_client() {
        admin "set auth_type='plain'"
 
+       # test with users that have a plain-text password stored
+
        # good password
        PGPASSWORD=foo psql -X -U puser1 -c "select 1" p1 || return 1
        # bad password
@@ -640,6 +642,15 @@ test_md5_server() {
 test_md5_client() {
        admin "set auth_type='md5'"
 
+       # test with users that have a plain-text password stored
+
+       # good password
+       PGPASSWORD=foo psql -X -U puser1 -c "select 1" p1 || return 1
+       # bad password
+       PGPASSWORD=wrong psql -X -U puser2 -c "select 2" p1 && return 1
+
+       # test with users that have an md5 password stored
+
        # good password
        PGPASSWORD=foo psql -X -U muser1 -c "select 1" p1 || return 1
        # bad password