From: Jeff Davis Date: Tue, 5 Mar 2019 00:12:45 +0000 (-0800) Subject: LP#1817645: RemoteAuth pgTAP test X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=dfefabd1649a644ed9972a0227be877ca98908ec;p=evergreen%2Fmasslnc.git LP#1817645: RemoteAuth pgTAP test Signed-off-by: Jeff Davis Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/sql/Pg/live_t/lp1817645-remoteauth.pg b/Open-ILS/src/sql/Pg/live_t/lp1817645-remoteauth.pg new file mode 100644 index 0000000000..2982d0a3db --- /dev/null +++ b/Open-ILS/src/sql/Pg/live_t/lp1817645-remoteauth.pg @@ -0,0 +1,63 @@ +BEGIN; + +SELECT plan(8); + +-- test accounts: +-- 99999393000: not found (user does not exist) +-- 99999393001: expired +-- 99999393002: deleted +-- 99999393003: barred +-- 99999393004: valid +-- 99999393005: inactive +-- 99999393100: external + +SELECT isnt_empty( + 'SELECT * FROM config.remoteauth_profile WHERE enabled IS TRUE AND name = ''Basic''', + 'Basic HTTP authentication is enabled' +); + +SELECT is( + (SELECT * FROM actor.permit_remoteauth('Basic', (SELECT id FROM actor.usr WHERE usrname = '99999393000')), + 'not_found', + 'Confirm remoteauth test for nonexistent patron' +); + +SELECT is( + (SELECT * FROM actor.permit_remoteauth('Basic', (SELECT id FROM actor.usr WHERE usrname = '99999393001')), + 'expired', + 'Confirm remoteauth test for expired patron' +); + +SELECT is( + (SELECT * FROM actor.permit_remoteauth('Basic', (SELECT id FROM actor.usr WHERE usrname = '99999393002')), + 'not_found', + 'Confirm remoteauth test for deleted patron' +); + +SELECT is( + (SELECT * FROM actor.permit_remoteauth('Basic', (SELECT id FROM actor.usr WHERE usrname = '99999393003')), + 'blocked', + 'Confirm remoteauth test for barred patron' +); + +SELECT is( + (SELECT * FROM actor.permit_remoteauth('Basic', (SELECT id FROM actor.usr WHERE usrname = '99999393004')), + 'success', + 'Confirm remoteauth test for valid patron' +); + +SELECT is( + (SELECT * FROM actor.permit_remoteauth('Basic', (SELECT id FROM actor.usr WHERE usrname = '99999393005')), + 'blocked', + 'Confirm remoteauth test for inactive patron' +); + +SELECT is( + (SELECT * FROM actor.permit_remoteauth('Basic', (SELECT id FROM actor.usr WHERE usrname = '99999393100')), + 'not_found', + 'Confirm remoteauth test for external patron' +); + +-- Finish the tests and clean up. +SELECT * FROM finish(); +ROLLBACK;