mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-05-30 03:24:47 +00:00
We need the sample data for tests for the test files to run
This commit is contained in:
parent
d2d36399d3
commit
7459a68b76
22
testing/tests/ischedule/Create-Database.result
Normal file
22
testing/tests/ischedule/Create-Database.result
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
|
||||||
|
|
||||||
|
Supported locales updated.
|
||||||
|
Updated view: dav_principal.sql applied.
|
||||||
|
CalDAV functions updated.
|
||||||
|
RRULE functions updated.
|
||||||
|
Database permissions updated.
|
||||||
|
The database is version XX currently at revision 1.3.5.
|
||||||
|
Applying patch 1.3.6.sql ... succeeded.
|
||||||
|
Successfully applied 1 patches.
|
||||||
|
Supported locales updated.
|
||||||
|
Updated view: dav_principal.sql applied.
|
||||||
|
CalDAV functions updated.
|
||||||
|
RRULE functions updated.
|
||||||
|
Database permissions updated.
|
||||||
|
NOTE
|
||||||
|
====
|
||||||
|
* The password for the 'admin' user has been set to 'nimda'
|
||||||
|
|
||||||
|
Thanks for trying DAViCal! Check the configuration in /etc/davical/config.php.
|
||||||
|
For help, look at our website and wiki, or visit #davical on irc.oftc.net.
|
||||||
|
|
||||||
0
testing/tests/ischedule/Dump-Database.result
Normal file
0
testing/tests/ischedule/Dump-Database.result
Normal file
15
testing/tests/ischedule/Load-Sample-Data.result
Normal file
15
testing/tests/ischedule/Load-Sample-Data.result
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
setval
|
||||||
|
--------
|
||||||
|
1000
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
setval
|
||||||
|
--------
|
||||||
|
1000
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
setval
|
||||||
|
--------
|
||||||
|
10
|
||||||
|
(1 row)
|
||||||
|
|
||||||
7
testing/tests/ischedule/Really-Upgrade-Database.result
Normal file
7
testing/tests/ischedule/Really-Upgrade-Database.result
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
The database is version XX currently at revision 1.3.6.
|
||||||
|
No patches were applied.
|
||||||
|
Supported locales updated.
|
||||||
|
Updated view: dav_principal.sql applied.
|
||||||
|
CalDAV functions updated.
|
||||||
|
RRULE functions updated.
|
||||||
|
Database permissions updated.
|
||||||
@ -1,6 +1,11 @@
|
|||||||
|
set_config
|
||||||
|
------------
|
||||||
|
public
|
||||||
|
(1 row)
|
||||||
|
|
||||||
setval
|
setval
|
||||||
--------
|
--------
|
||||||
1642
|
1013
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
setval
|
setval
|
||||||
@ -8,6 +13,101 @@
|
|||||||
1
|
1
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
|
setval
|
||||||
|
--------
|
||||||
|
1
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
setval
|
||||||
|
--------
|
||||||
|
1
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
setval
|
||||||
|
--------
|
||||||
|
1
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
setval
|
||||||
|
--------
|
||||||
|
1
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
setval
|
||||||
|
--------
|
||||||
|
1
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
setval
|
||||||
|
--------
|
||||||
|
1
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
setval
|
||||||
|
--------
|
||||||
|
1
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
setval
|
||||||
|
--------
|
||||||
|
1
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
setval
|
||||||
|
--------
|
||||||
|
1
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
setval
|
||||||
|
--------
|
||||||
|
1
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
setval
|
||||||
|
--------
|
||||||
|
1
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
setval
|
||||||
|
--------
|
||||||
|
1
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
setval
|
||||||
|
--------
|
||||||
|
1
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
setval
|
||||||
|
--------
|
||||||
|
1
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
setval
|
||||||
|
--------
|
||||||
|
1
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
setval
|
||||||
|
--------
|
||||||
|
1
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
setval
|
||||||
|
--------
|
||||||
|
1
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
setval
|
||||||
|
--------
|
||||||
|
1
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
setval
|
||||||
|
--------
|
||||||
|
4
|
||||||
|
(1 row)
|
||||||
|
|
||||||
setval
|
setval
|
||||||
--------
|
--------
|
||||||
10
|
10
|
||||||
@ -25,12 +125,12 @@
|
|||||||
|
|
||||||
setval
|
setval
|
||||||
--------
|
--------
|
||||||
8
|
1
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
setval
|
setval
|
||||||
--------
|
--------
|
||||||
13
|
1
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
setval
|
setval
|
||||||
|
|||||||
5
testing/tests/ischedule/Upgrade-Database.result
Normal file
5
testing/tests/ischedule/Upgrade-Database.result
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
Supported locales updated.
|
||||||
|
Updated view: dav_principal.sql applied.
|
||||||
|
CalDAV functions updated.
|
||||||
|
RRULE functions updated.
|
||||||
|
Database permissions updated.
|
||||||
126
testing/tests/ischedule/sample-data.sql
Normal file
126
testing/tests/ischedule/sample-data.sql
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
-- Some sample data to prime the database...
|
||||||
|
-- base-data.sql should be processed before this
|
||||||
|
|
||||||
|
INSERT INTO usr ( user_no, active, email_ok, updated, username, password, fullname, email )
|
||||||
|
VALUES( 2, TRUE, current_date, current_date, 'andrew', '**x', 'Andrew McMillan', 'andrew@catalyst.net.nz' );
|
||||||
|
INSERT INTO role_member (user_no, role_no) VALUES( 2, 1);
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO usr ( user_no, active, email_ok, updated, username, password, fullname, email )
|
||||||
|
VALUES( 10, TRUE, current_date, current_date, 'user1', '**user1', 'User 1', 'user1@example.net' );
|
||||||
|
INSERT INTO usr ( user_no, active, email_ok, updated, username, password, fullname, email )
|
||||||
|
VALUES( 11, TRUE, current_date, current_date, 'user2', '**user2', 'User 2', 'user2@example.net' );
|
||||||
|
INSERT INTO usr ( user_no, active, email_ok, updated, username, password, fullname, email )
|
||||||
|
VALUES( 12, TRUE, current_date, current_date, 'user3', '**user3', 'User 3', 'user3@example.net' );
|
||||||
|
INSERT INTO usr ( user_no, active, email_ok, updated, username, password, fullname, email )
|
||||||
|
VALUES( 13, TRUE, current_date, current_date, 'user4', '**user4', 'User 4', 'user4@example.net' );
|
||||||
|
INSERT INTO usr ( user_no, active, email_ok, updated, username, password, fullname, email )
|
||||||
|
VALUES( 14, TRUE, current_date, current_date, 'user5', '**user5', 'User 5', 'user5@example.net' );
|
||||||
|
INSERT INTO usr ( user_no, active, email_ok, updated, username, password, fullname, email )
|
||||||
|
VALUES( 15, TRUE, current_date, current_date, 'User Six', '**user6', 'User 6', 'user6@example.net' );
|
||||||
|
|
||||||
|
INSERT INTO usr ( user_no, active, email_ok, updated, username, password, fullname, email )
|
||||||
|
VALUES( 20, TRUE, current_date, current_date, 'manager1', '**manager1', 'Manager 1', 'manager1@example.net' );
|
||||||
|
|
||||||
|
INSERT INTO usr ( user_no, active, email_ok, updated, username, password, fullname, email )
|
||||||
|
VALUES( 30, TRUE, current_date, current_date, 'assistant1', '**assistant1', 'Assistant 1', 'assistant1@example.net' );
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO usr ( user_no, active, email_ok, updated, username, password, fullname, email )
|
||||||
|
VALUES( 100, TRUE, current_date, current_date, 'resource1', '*salt*unpossible', 'Resource 1', 'resource1@example.net' );
|
||||||
|
INSERT INTO role_member (user_no, role_no) VALUES( 100, 4);
|
||||||
|
INSERT INTO usr ( user_no, active, email_ok, updated, username, password, fullname, email )
|
||||||
|
VALUES( 101, TRUE, current_date, current_date, 'resource2', '*salt*unpossible', 'Resource 2', 'resource2@example.net' );
|
||||||
|
INSERT INTO role_member (user_no, role_no) VALUES( 101, 4);
|
||||||
|
|
||||||
|
INSERT INTO usr ( user_no, active, email_ok, updated, username, password, fullname, email )
|
||||||
|
VALUES( 200, TRUE, current_date, current_date, 'resmgr1', '*salt*unpossible', 'Resource Managers', 'resource-managers@example.net' );
|
||||||
|
INSERT INTO role_member (user_no, role_no) VALUES( 200, 2);
|
||||||
|
|
||||||
|
INSERT INTO usr ( user_no, active, email_ok, updated, username, password, fullname, email )
|
||||||
|
VALUES( 300, TRUE, current_date, current_date, 'teamclient1', '*salt*unpossible', 'Team for Client1', 'team-client1@example.net' );
|
||||||
|
INSERT INTO role_member (user_no, role_no) VALUES( 300, 2);
|
||||||
|
|
||||||
|
SELECT setval('usr_user_no_seq', 1000);
|
||||||
|
SELECT setval('dav_id_seq', 1000);
|
||||||
|
|
||||||
|
UPDATE usr SET joined = '2009-06-01', updated = '2009-06-02';
|
||||||
|
|
||||||
|
INSERT INTO collection (user_no, parent_container, dav_name, dav_etag,
|
||||||
|
dav_displayname, is_calendar, created, modified,
|
||||||
|
public_events_only, publicly_readable, collection_id, resourcetypes )
|
||||||
|
SELECT user_no, '/' || username || '/', '/' || username || '/home/', md5(username),
|
||||||
|
username || ' home', TRUE, '2009-06-03', '2009-06-04',
|
||||||
|
FALSE, FALSE, user_no + 150, '<DAV::collection/><urn:ietf:params:xml:ns:caldav:calendar/>'
|
||||||
|
FROM usr ORDER BY user_no;
|
||||||
|
|
||||||
|
INSERT INTO collection (user_no, parent_container, dav_name, dav_etag,
|
||||||
|
dav_displayname, is_calendar, is_addressbook, created, modified,
|
||||||
|
public_events_only, publicly_readable, collection_id, resourcetypes )
|
||||||
|
SELECT user_no, '/' || username || '/', '/' || username || '/addresses/', md5(username),
|
||||||
|
username || ' addresses', FALSE, TRUE, '1957-07-26', '1998-03-16',
|
||||||
|
FALSE, FALSE, user_no + 450, '<DAV::collection/><urn:ietf:params:xml:ns:carddav:addressbook/>'
|
||||||
|
FROM usr ORDER BY user_no;
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO principal (type_id, user_no, displayname, default_privileges)
|
||||||
|
SELECT 1, user_no, fullname, privilege_to_bits(ARRAY['read-free-busy','schedule-send','schedule-deliver']) FROM usr
|
||||||
|
WHERE NOT EXISTS(SELECT 1 FROM role_member JOIN roles USING(role_no) WHERE role_name = 'Group' AND role_member.user_no = usr.user_no)
|
||||||
|
AND NOT EXISTS(SELECT 1 FROM role_member JOIN roles USING(role_no) WHERE role_name = 'Resource' AND role_member.user_no = usr.user_no)
|
||||||
|
AND NOT EXISTS(SELECT 1 FROM principal WHERE principal.user_no = usr.user_no) ORDER BY user_no;
|
||||||
|
|
||||||
|
INSERT INTO principal (type_id, user_no, displayname, default_privileges)
|
||||||
|
SELECT 2, user_no, fullname, privilege_to_bits(ARRAY['read','schedule-send','schedule-deliver']) FROM usr
|
||||||
|
WHERE EXISTS(SELECT 1 FROM role_member JOIN roles USING(role_no) WHERE role_name = 'Resource' AND role_member.user_no = usr.user_no)
|
||||||
|
AND NOT EXISTS(SELECT 1 FROM principal WHERE principal.user_no = usr.user_no) ORDER BY user_no;
|
||||||
|
|
||||||
|
INSERT INTO principal (type_id, user_no, displayname, default_privileges)
|
||||||
|
SELECT 3, user_no, fullname, privilege_to_bits(ARRAY['read-free-busy','schedule-send','schedule-deliver']) FROM usr
|
||||||
|
WHERE EXISTS(SELECT 1 FROM role_member JOIN roles USING(role_no) WHERE role_name = 'Group' AND role_member.user_no = usr.user_no)
|
||||||
|
AND NOT EXISTS(SELECT 1 FROM principal WHERE principal.user_no = usr.user_no) ORDER BY user_no;
|
||||||
|
|
||||||
|
-- Set the insert sequence to the next number, with a minimum of 1000
|
||||||
|
SELECT setval('relationship_type_rt_id_seq', (SELECT 10 UNION SELECT rt_id FROM relationship_type ORDER BY 1 DESC LIMIT 1) );
|
||||||
|
|
||||||
|
-- The resources for meetings
|
||||||
|
INSERT INTO relationship ( from_user, to_user, rt_id ) VALUES( 200, 100, 1 );
|
||||||
|
INSERT INTO relationship ( from_user, to_user, rt_id ) VALUES( 200, 101, 1 );
|
||||||
|
|
||||||
|
-- The people who administer meetings
|
||||||
|
INSERT INTO relationship ( from_user, to_user, rt_id ) VALUES( 10, 200, 1 );
|
||||||
|
INSERT INTO relationship ( from_user, to_user, rt_id ) VALUES( 11, 200, 1 );
|
||||||
|
INSERT INTO relationship ( from_user, to_user, rt_id ) VALUES( 30, 200, 1 );
|
||||||
|
|
||||||
|
-- Between a PA and their Manager
|
||||||
|
INSERT INTO relationship ( from_user, to_user, rt_id ) VALUES( 30, 20, 2 );
|
||||||
|
INSERT INTO relationship ( from_user, to_user, rt_id ) VALUES( 30, 10, 2 );
|
||||||
|
|
||||||
|
|
||||||
|
-- Between a team
|
||||||
|
INSERT INTO relationship ( from_user, to_user, rt_id ) VALUES( 20, 300, 3 );
|
||||||
|
INSERT INTO relationship ( from_user, to_user, rt_id ) VALUES( 10, 300, 3 );
|
||||||
|
INSERT INTO relationship ( from_user, to_user, rt_id ) VALUES( 30, 300, 3 );
|
||||||
|
INSERT INTO relationship ( from_user, to_user, rt_id ) VALUES( 300, 20, 3 );
|
||||||
|
INSERT INTO relationship ( from_user, to_user, rt_id ) VALUES( 300, 10, 3 );
|
||||||
|
INSERT INTO relationship ( from_user, to_user, rt_id ) VALUES( 300, 30, 3 );
|
||||||
|
|
||||||
|
-- Granting explicit free/busy permission
|
||||||
|
INSERT INTO relationship ( from_user, to_user, rt_id ) VALUES( 11, 10, 4 );
|
||||||
|
INSERT INTO relationship ( from_user, to_user, rt_id ) VALUES( 10, 11, 4 );
|
||||||
|
|
||||||
|
|
||||||
|
UPDATE relationship r SET confers = (SELECT bit_confers FROM relationship_type rt WHERE rt.rt_id=r.rt_id);
|
||||||
|
|
||||||
|
INSERT INTO group_member ( group_id, member_id)
|
||||||
|
SELECT g.principal_id, m.principal_id
|
||||||
|
FROM relationship JOIN principal g ON(to_user=g.user_no AND g.type_id = 3) -- Group
|
||||||
|
JOIN principal m ON(from_user=m.user_no AND m.type_id IN (1,2)) ORDER BY 1, 2; -- Person | Resource
|
||||||
|
|
||||||
|
INSERT INTO grants ( by_principal, to_principal, privileges, is_group )
|
||||||
|
SELECT pby.principal_id AS by_principal, pto.principal_id AS to_principal,
|
||||||
|
confers AS privileges, pto.type_id > 2 AS is_group
|
||||||
|
FROM relationship r JOIN usr f ON(f.user_no=r.from_user)
|
||||||
|
JOIN usr t ON(t.user_no=r.to_user)
|
||||||
|
JOIN principal pby ON(t.user_no=pby.user_no)
|
||||||
|
JOIN principal pto ON(pto.user_no=f.user_no)
|
||||||
|
WHERE rt_id < 4 AND pby.type_id < 3 ORDER BY 1, 2;
|
||||||
Loading…
x
Reference in New Issue
Block a user