Changeset 69449 in vbox for trunk/src/VBox/ValidationKit/testmanager/core
- Timestamp:
- Oct 27, 2017 5:00:31 PM (7 years ago)
- Location:
- trunk/src/VBox/ValidationKit/testmanager/core
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testmanager/core/testbox.pgsql
r69111 r69449 624 624 $$ LANGUAGE plpgsql; 625 625 626 -
trunk/src/VBox/ValidationKit/testmanager/core/testcase.pgsql
r69111 r69449 60 60 END; 61 61 $$ LANGUAGE plpgsql; 62 62 63 63 --- 64 64 -- Check that the test case exists. … … 83 83 -- @internal 84 84 -- 85 CREATE OR REPLACE FUNCTION TestCaseLogic_historizeEntry(a_idTestCase INTEGER, a_tsExpire TIMESTAMP WITH TIME ZONE) 85 CREATE OR REPLACE FUNCTION TestCaseLogic_historizeEntry(a_idTestCase INTEGER, a_tsExpire TIMESTAMP WITH TIME ZONE) 86 86 RETURNS VOID AS $$ 87 87 DECLARE … … 103 103 104 104 105 CREATE OR REPLACE function TestCaseLogic_addEntry(a_uidAuthor INTEGER, a_sName TEXT, a_sDescription TEXT, 106 a_fEnabled BOOL, a_cSecTimeout INTEGER, a_sTestBoxReqExpr TEXT, 105 CREATE OR REPLACE function TestCaseLogic_addEntry(a_uidAuthor INTEGER, a_sName TEXT, a_sDescription TEXT, 106 a_fEnabled BOOL, a_cSecTimeout INTEGER, a_sTestBoxReqExpr TEXT, 107 107 a_sBuildReqExpr TEXT, a_sBaseCmd TEXT, a_sTestSuiteZips TEXT, 108 108 a_sComment TEXT) 109 109 RETURNS INTEGER AS $$ 110 DECLARE 110 DECLARE 111 111 v_idTestCase INTEGER; 112 112 BEGIN 113 113 PERFORM TestCaseLogic_checkUniqueName(a_sName, -1); 114 114 115 INSERT INTO TestCases (uidAuthor, sName, sDescription, fEnabled, cSecTimeout, 115 INSERT INTO TestCases (uidAuthor, sName, sDescription, fEnabled, cSecTimeout, 116 116 sTestBoxReqExpr, sBuildReqExpr, sBaseCmd, sTestSuiteZips, sComment) 117 VALUES (a_uidAuthor, a_sName, a_sDescription, a_fEnabled, a_cSecTimeout, 117 VALUES (a_uidAuthor, a_sName, a_sDescription, a_fEnabled, a_cSecTimeout, 118 118 a_sTestBoxReqExpr, a_sBuildReqExpr, a_sBaseCmd, a_sTestSuiteZips, a_sComment) 119 119 RETURNING idTestcase INTO v_idTestCase; … … 123 123 124 124 125 CREATE OR REPLACE function TestCaseLogic_editEntry(a_uidAuthor INTEGER, a_idTestCase INTEGER, a_sName TEXT, a_sDescription TEXT, 126 a_fEnabled BOOL, a_cSecTimeout INTEGER, a_sTestBoxReqExpr TEXT, 125 CREATE OR REPLACE function TestCaseLogic_editEntry(a_uidAuthor INTEGER, a_idTestCase INTEGER, a_sName TEXT, a_sDescription TEXT, 126 a_fEnabled BOOL, a_cSecTimeout INTEGER, a_sTestBoxReqExpr TEXT, 127 127 a_sBuildReqExpr TEXT, a_sBaseCmd TEXT, a_sTestSuiteZips TEXT, 128 128 a_sComment TEXT) 129 129 RETURNS INTEGER AS $$ 130 DECLARE 130 DECLARE 131 131 v_idGenTestCase INTEGER; 132 132 BEGIN … … 135 135 136 136 PERFORM TestCaseLogic_historizeEntry(a_idTestCase, CURRENT_TIMESTAMP); 137 INSERT INTO TestCases (idTestCase, uidAuthor, sName, sDescription, fEnabled, cSecTimeout, 137 INSERT INTO TestCases (idTestCase, uidAuthor, sName, sDescription, fEnabled, cSecTimeout, 138 138 sTestBoxReqExpr, sBuildReqExpr, sBaseCmd, sTestSuiteZips, sComment) 139 VALUES (a_idTestCase, a_uidAuthor, a_sName, a_sDescription, a_fEnabled, a_cSecTimeout, 139 VALUES (a_idTestCase, a_uidAuthor, a_sName, a_sDescription, a_fEnabled, a_cSecTimeout, 140 140 a_sTestBoxReqExpr, a_sBuildReqExpr, a_sBaseCmd, a_sTestSuiteZips, a_sComment) 141 141 RETURNING idGenTestCase INTO v_idGenTestCase; … … 145 145 146 146 147 CREATE OR REPLACE FUNCTION TestCaseLogic_delEntry(a_uidAuthor INTEGER, a_idTestCase INTEGER, a_fCascade BOOLEAN) 147 CREATE OR REPLACE FUNCTION TestCaseLogic_delEntry(a_uidAuthor INTEGER, a_idTestCase INTEGER, a_fCascade BOOLEAN) 148 148 RETURNS VOID AS $$ 149 149 DECLARE … … 156 156 -- Check preconditions. 157 157 -- 158 IF a_fCascade <> TRUE THEN 158 IF a_fCascade <> TRUE THEN 159 159 IF EXISTS( SELECT * 160 160 FROM TestCaseDeps … … 162 162 AND tsExpire = 'infinity'::TIMESTAMP ) THEN 163 163 v_sErrors := ''; 164 FOR v_Rec IN 165 SELECT TestCases.idTestCase AS idTestCase, 164 FOR v_Rec IN 165 SELECT TestCases.idTestCase AS idTestCase, 166 166 TestCases.sName AS sName 167 167 FROM TestCaseDeps, TestCases … … 178 178 RAISE EXCEPTION 'Other test cases depends on test case with ID %: % ', a_idTestCase, v_sErrors; 179 179 END IF; 180 180 181 181 IF EXISTS( SELECT * 182 182 FROM TestGroupMembers … … 184 184 AND tsExpire = 'infinity'::TIMESTAMP ) THEN 185 185 v_sErrors := ''; 186 FOR v_Rec IN 187 SELECT TestGroups.idTestGroup AS idTestGroup, 186 FOR v_Rec IN 187 SELECT TestGroups.idTestGroup AS idTestGroup, 188 188 TestGroups.sName AS sName 189 189 FROM TestGroupMembers, TestGroups … … 204 204 -- 205 205 -- To preserve the information about who deleted the record, we try to 206 -- add a dummy record which expires immediately. I say try because of 206 -- add a dummy record which expires immediately. I say try because of 207 207 -- the primary key, we must let the new record be valid for 1 us. :-( 208 208 -- … … 226 226 -- 227 227 -- Delete arguments, test case dependencies and resource dependencies. 228 -- (We don't bother recording who deleted the records here since it's 228 -- (We don't bother recording who deleted the records here since it's 229 229 -- a lot of work and sufficiently covered in the TestCases table.) 230 230 -- … … 249 249 WHERE idTestCasePreReq = a_idTestCase 250 250 AND tsExpire = 'infinity'::TIMESTAMP; 251 251 252 252 UPDATE TestGroupMembers 253 253 SET tsExpire = CURRENT_TIMESTAMP -
trunk/src/VBox/ValidationKit/testmanager/core/useraccount.pgsql
r69111 r69449 60 60 END; 61 61 $$ LANGUAGE plpgsql; 62 62 63 63 --- 64 64 -- Check that the user account exists. … … 84 84 -- @internal 85 85 -- 86 CREATE OR REPLACE FUNCTION UserAccountLogic_historizeEntry(a_uid INTEGER, a_tsExpire TIMESTAMP WITH TIME ZONE) 86 CREATE OR REPLACE FUNCTION UserAccountLogic_historizeEntry(a_uid INTEGER, a_tsExpire TIMESTAMP WITH TIME ZONE) 87 87 RETURNS VOID AS $$ 88 88 DECLARE … … 107 107 -- Adds a new user. 108 108 -- 109 CREATE OR REPLACE FUNCTION UserAccountLogic_addEntry(a_uidAuthor INTEGER, a_sUsername TEXT, a_sEmail TEXT, a_sFullName TEXT, 109 CREATE OR REPLACE FUNCTION UserAccountLogic_addEntry(a_uidAuthor INTEGER, a_sUsername TEXT, a_sEmail TEXT, a_sFullName TEXT, 110 110 a_sLoginName TEXT, a_fReadOnly BOOLEAN) 111 111 RETURNS VOID AS $$ … … 119 119 $$ LANGUAGE plpgsql; 120 120 121 CREATE OR REPLACE FUNCTION UserAccountLogic_editEntry(a_uidAuthor INTEGER, a_uid INTEGER, a_sUsername TEXT, a_sEmail TEXT, 121 CREATE OR REPLACE FUNCTION UserAccountLogic_editEntry(a_uidAuthor INTEGER, a_uid INTEGER, a_sUsername TEXT, a_sEmail TEXT, 122 122 a_sFullName TEXT, a_sLoginName TEXT, a_fReadOnly BOOLEAN) 123 123 RETURNS VOID AS $$ … … 140 140 -- 141 141 -- To preserve the information about who deleted the record, we try to 142 -- add a dummy record which expires immediately. I say try because of 142 -- add a dummy record which expires immediately. I say try because of 143 143 -- the primary key, we must let the new record be valid for 1 us. :-( 144 144 --
Note:
See TracChangeset
for help on using the changeset viewer.