LP#1817645: sample data for testing remote patron auth
authorJeff Davis <jeff.davis@bc.libraries.coop>
Mon, 4 Mar 2019 22:53:43 +0000 (14:53 -0800)
committerGalen Charlton <gmc@equinoxinitiative.org>
Fri, 6 Sep 2019 20:26:06 +0000 (16:26 -0400)
Signed-off-by: Jeff Davis <jeff.davis@bc.libraries.coop>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>

Open-ILS/tests/datasets/sql/load_all.sql
Open-ILS/tests/datasets/sql/remoteauth.sql [new file with mode: 0644]
Open-ILS/tests/datasets/sql/users_patrons_100.sql

index f1a20fc..128372e 100644 (file)
@@ -99,6 +99,9 @@ INSERT INTO biblio.record_entry (marc, last_xact_id)
 -- load survey data
 \i surveys.sql
 
+-- load remoteauth data
+\i remoteauth.sql
+
 -- clean up the env
 \i env_destroy.sql
 
diff --git a/Open-ILS/tests/datasets/sql/remoteauth.sql b/Open-ILS/tests/datasets/sql/remoteauth.sql
new file mode 100644 (file)
index 0000000..be0c799
--- /dev/null
@@ -0,0 +1,7 @@
+-- config for Basic HTTP Authentication (SYS1)
+INSERT INTO config.remoteauth_profile
+    (name, description, context_org, enabled, perm,
+        restrict_to_org, allow_inactive, allow_expired, block_list)
+    VALUES ('Basic', 'Basic HTTP Authentication for SYS1', 2, TRUE, 1,
+        TRUE, FALSE, FALSE, NULL);
+
index 5923e87..e3ff258 100644 (file)
@@ -2146,3 +2146,141 @@ UPDATE actor.usr SET
     credit_forward_balance = '0',
     mailing_address = CURRVAL('actor.usr_address_id_seq')
     WHERE id=CURRVAL('actor.usr_id_seq');
+
+
+-- users for auth testing
+-- barcode pattern: 99999393XXX
+
+-- expired
+INSERT INTO actor.usr
+    (profile, ident_type, usrname, home_ou, family_name, passwd, first_given_name, second_given_name, expire_date, dob, suffix)
+    VALUES (2, 3, '99999393001', 4, 'Simpson', 'marges1234',
+        'Marge', '', NOW() + '3 years'::INTERVAL, NULL, '');
+
+INSERT INTO actor.usr_address
+    (country, within_city_limits, post_code, street1, valid, state, city, street2, county, usr)
+    VALUES ('USA', 't', '20521', '742 Evergreen Terrace', 't',
+        'NT', 'Springfield', '', '', CURRVAL('actor.usr_id_seq'));
+
+INSERT INTO actor.card (barcode, usr)
+    VALUES ('99999393001', CURRVAL('actor.usr_id_seq'));
+
+UPDATE actor.usr SET
+    card = CURRVAL('actor.card_id_seq'),
+    billing_address = CURRVAL('actor.usr_address_id_seq'),
+    credit_forward_balance = '0',
+    mailing_address = CURRVAL('actor.usr_address_id_seq')
+    WHERE id=CURRVAL('actor.usr_id_seq');
+
+UPDATE actor.usr SET expire_date = '2010-01-01' WHERE id=CURRVAL('actor.usr_id_seq');
+
+-- deleted
+INSERT INTO actor.usr
+    (profile, ident_type, usrname, home_ou, family_name, passwd, first_given_name, second_given_name, expire_date, dob, suffix)
+    VALUES (2, 3, '99999393002', 4, 'Simpson', 'homers1234',
+        'Homer', '', NOW() + '3 years'::INTERVAL, NULL, '');
+
+INSERT INTO actor.usr_address
+    (country, within_city_limits, post_code, street1, valid, state, city, street2, county, usr)
+    VALUES ('USA', 't', '20521', '742 Evergreen Terrace', 't',
+        'NT', 'Springfield', '', '', CURRVAL('actor.usr_id_seq'));
+
+INSERT INTO actor.card (barcode, usr)
+    VALUES ('99999393002', CURRVAL('actor.usr_id_seq'));
+
+UPDATE actor.usr SET
+    card = CURRVAL('actor.card_id_seq'),
+    billing_address = CURRVAL('actor.usr_address_id_seq'),
+    credit_forward_balance = '0',
+    mailing_address = CURRVAL('actor.usr_address_id_seq')
+    WHERE id=CURRVAL('actor.usr_id_seq');
+
+UPDATE actor.usr SET deleted = TRUE WHERE id=CURRVAL('actor.usr_id_seq');
+
+-- barred
+INSERT INTO actor.usr
+    (profile, ident_type, usrname, home_ou, family_name, passwd, first_given_name, second_given_name, expire_date, dob, suffix)
+    VALUES (2, 3, '99999393003', 4, 'Simpson', 'barts1234',
+        'Bart', '', NOW() + '3 years'::INTERVAL, NULL, '');
+
+INSERT INTO actor.usr_address
+    (country, within_city_limits, post_code, street1, valid, state, city, street2, county, usr)
+    VALUES ('USA', 't', '20521', '742 Evergreen Terrace', 't',
+        'NT', 'Springfield', '', '', CURRVAL('actor.usr_id_seq'));
+
+INSERT INTO actor.card (barcode, usr)
+    VALUES ('99999393003', CURRVAL('actor.usr_id_seq'));
+
+UPDATE actor.usr SET
+    card = CURRVAL('actor.card_id_seq'),
+    billing_address = CURRVAL('actor.usr_address_id_seq'),
+    credit_forward_balance = '0',
+    mailing_address = CURRVAL('actor.usr_address_id_seq')
+    WHERE id=CURRVAL('actor.usr_id_seq');
+
+UPDATE actor.usr SET barred = TRUE WHERE id=CURRVAL('actor.usr_id_seq');
+
+-- valid
+INSERT INTO actor.usr
+    (profile, ident_type, usrname, home_ou, family_name, passwd, first_given_name, second_given_name, expire_date, dob, suffix)
+    VALUES (2, 3, '99999393004', 4, 'Simpson', 'lisas1234',
+        'Lisa', '', NOW() + '3 years'::INTERVAL, NULL, '');
+
+INSERT INTO actor.usr_address
+    (country, within_city_limits, post_code, street1, valid, state, city, street2, county, usr)
+    VALUES ('USA', 't', '20521', '742 Evergreen Terrace', 't',
+        'NT', 'Springfield', '', '', CURRVAL('actor.usr_id_seq'));
+
+INSERT INTO actor.card (barcode, usr)
+    VALUES ('99999393004', CURRVAL('actor.usr_id_seq'));
+
+UPDATE actor.usr SET
+    card = CURRVAL('actor.card_id_seq'),
+    billing_address = CURRVAL('actor.usr_address_id_seq'),
+    credit_forward_balance = '0',
+    mailing_address = CURRVAL('actor.usr_address_id_seq')
+    WHERE id=CURRVAL('actor.usr_id_seq');
+
+-- inactive
+INSERT INTO actor.usr
+    (profile, ident_type, usrname, home_ou, family_name, passwd, first_given_name, second_given_name, expire_date, dob, suffix)
+    VALUES (2, 3, '99999393005', 4, 'Simpson', 'maggies1234',
+        'Maggie', '', NOW() + '3 years'::INTERVAL, NULL, '');
+
+INSERT INTO actor.usr_address
+    (country, within_city_limits, post_code, street1, valid, state, city, street2, county, usr)
+    VALUES ('USA', 't', '20521', '742 Evergreen Terrace', 't',
+        'NT', 'Springfield', '', '', CURRVAL('actor.usr_id_seq'));
+
+INSERT INTO actor.card (barcode, usr)
+    VALUES ('99999393005', CURRVAL('actor.usr_id_seq'));
+
+UPDATE actor.usr SET
+    card = CURRVAL('actor.card_id_seq'),
+    billing_address = CURRVAL('actor.usr_address_id_seq'),
+    credit_forward_balance = '0',
+    mailing_address = CURRVAL('actor.usr_address_id_seq')
+    WHERE id=CURRVAL('actor.usr_id_seq');
+
+UPDATE actor.usr SET active = FALSE WHERE id=CURRVAL('actor.usr_id_seq');
+
+-- external
+INSERT INTO actor.usr
+    (profile, ident_type, usrname, home_ou, family_name, passwd, first_given_name, second_given_name, expire_date, dob, suffix)
+    VALUES (2, 3, '99999393100', 6, 'Manhattan', 'shelbyvillem1234',
+        'Shelbyville', '', NOW() + '3 years'::INTERVAL, NULL, '');
+
+INSERT INTO actor.usr_address
+    (country, within_city_limits, post_code, street1, valid, state, city, street2, county, usr)
+    VALUES ('USA', 't', '20521', '1 Shelbyville Way', 't',
+        'NT', 'Shelbyville', '', '', CURRVAL('actor.usr_id_seq'));
+
+INSERT INTO actor.card (barcode, usr)
+    VALUES ('99999393100', CURRVAL('actor.usr_id_seq'));
+
+UPDATE actor.usr SET
+    card = CURRVAL('actor.card_id_seq'),
+    billing_address = CURRVAL('actor.usr_address_id_seq'),
+    credit_forward_balance = '0',
+    mailing_address = CURRVAL('actor.usr_address_id_seq')
+    WHERE id=CURRVAL('actor.usr_id_seq');