1 | # -*- coding: utf-8 -*-
|
---|
2 | # $Id: config.py 103272 2024-02-08 09:23:55Z vboxsync $
|
---|
3 |
|
---|
4 | """
|
---|
5 | Test Manager Configuration.
|
---|
6 | """
|
---|
7 |
|
---|
8 | __copyright__ = \
|
---|
9 | """
|
---|
10 | Copyright (C) 2012-2023 Oracle and/or its affiliates.
|
---|
11 |
|
---|
12 | This file is part of VirtualBox base platform packages, as
|
---|
13 | available from https://www.virtualbox.org.
|
---|
14 |
|
---|
15 | This program is free software; you can redistribute it and/or
|
---|
16 | modify it under the terms of the GNU General Public License
|
---|
17 | as published by the Free Software Foundation, in version 3 of the
|
---|
18 | License.
|
---|
19 |
|
---|
20 | This program is distributed in the hope that it will be useful, but
|
---|
21 | WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
22 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
23 | General Public License for more details.
|
---|
24 |
|
---|
25 | You should have received a copy of the GNU General Public License
|
---|
26 | along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
27 |
|
---|
28 | The contents of this file may alternatively be used under the terms
|
---|
29 | of the Common Development and Distribution License Version 1.0
|
---|
30 | (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
|
---|
31 | in the VirtualBox distribution, in which case the provisions of the
|
---|
32 | CDDL are applicable instead of those of the GPL.
|
---|
33 |
|
---|
34 | You may elect to license modified versions of this file under the
|
---|
35 | terms and conditions of either the GPL or the CDDL or both.
|
---|
36 |
|
---|
37 | SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
|
---|
38 | """
|
---|
39 | __version__ = "$Revision: 103272 $"
|
---|
40 |
|
---|
41 | import os;
|
---|
42 |
|
---|
43 | ## Test Manager version string.
|
---|
44 | g_ksVersion = 'v0.1.0';
|
---|
45 | ## Test Manager revision string.
|
---|
46 | g_ksRevision = ('$Revision: 103272 $')[11:-2];
|
---|
47 |
|
---|
48 | ## Enable VBox specific stuff.
|
---|
49 | g_kfVBoxSpecific = True;
|
---|
50 |
|
---|
51 |
|
---|
52 | ## @name Used by the TMDatabaseConnection class.
|
---|
53 | # @{
|
---|
54 | g_ksDatabaseName = 'testmanager';
|
---|
55 | g_ksDatabaseAddress = None;
|
---|
56 | g_ksDatabasePort = None;
|
---|
57 | g_ksDatabaseUser = 'postgres';
|
---|
58 | g_ksDatabasePassword = '';
|
---|
59 | ## @}
|
---|
60 |
|
---|
61 |
|
---|
62 | ## @name User handling.
|
---|
63 | ## @{
|
---|
64 |
|
---|
65 | ## Whether login names are case insensitive (True) or case sensitive (False).
|
---|
66 | ## @note Implemented by inserting lower case names into DB and lower case
|
---|
67 | ## bind variables in WHERE clauses.
|
---|
68 | g_kfLoginNameCaseInsensitive = True;
|
---|
69 |
|
---|
70 | ## @}
|
---|
71 |
|
---|
72 |
|
---|
73 | ## @name File locations
|
---|
74 | ## @{
|
---|
75 |
|
---|
76 | ## The TestManager directory.
|
---|
77 | g_ksTestManagerDir = os.path.dirname(os.path.abspath(__file__));
|
---|
78 | ## The Validation Kit directory.
|
---|
79 | g_ksValidationKitDir = os.path.dirname(g_ksTestManagerDir);
|
---|
80 | ## The TestManager htdoc directory.
|
---|
81 | g_ksTmHtDocDir = os.path.join(g_ksTestManagerDir, 'htdocs');
|
---|
82 | ## The TestManager download directory (under htdoc somewhere), for validationkit zips.
|
---|
83 | g_ksTmDownloadDir = os.path.join(g_ksTmHtDocDir, 'download');
|
---|
84 | ## The base URL relative path of the TM download directory (g_ksTmDownloadDir).
|
---|
85 | g_ksTmDownloadBaseUrlRel = 'htdocs/downloads';
|
---|
86 | ## The root of the file area (referred to as TM_FILE_DIR in database docs).
|
---|
87 | g_ksFileAreaRootDir = '/var/tmp/testmanager'
|
---|
88 | ## The root of the file area with the zip files (best put on a big storage server).
|
---|
89 | g_ksZipFileAreaRootDir = '/var/tmp/testmanager2'
|
---|
90 | ## URL prefix for trac log viewer.
|
---|
91 | g_ksTracLogUrlPrefix = 'https://linserv.de.oracle.com/vbox/log/'
|
---|
92 | ## URL prefix for trac log viewer.
|
---|
93 | g_ksTracChangsetUrlFmt = 'https://linserv.de.oracle.com/%(sRepository)s/changeset/%(iRevision)s'
|
---|
94 | ## URL prefix for unprefixed build logs.
|
---|
95 | g_ksBuildLogUrlPrefix = ''
|
---|
96 | ## URL prefix for unprefixed build binaries.
|
---|
97 | g_ksBuildBinUrlPrefix = '/builds/'
|
---|
98 | ## The local path prefix for unprefixed build binaries. (Host file system, not web server.)
|
---|
99 | g_ksBuildBinRootDir = '/mnt/builds/'
|
---|
100 | ## File on the build binary share that can be used to check that it's mounted.
|
---|
101 | g_ksBuildBinRootFile = 'builds.txt'
|
---|
102 | ## Template for paratial database dump output files. One argument: UID
|
---|
103 | g_ksTmDbDumpOutFileTmpl = '/var/tmp/tm-partial-db-dump-for-%u.zip'
|
---|
104 | ## Template for paratial database dump temporary files. One argument: UID
|
---|
105 | g_ksTmDbDumpTmpFileTmpl = '/var/tmp/tm-partial-db-dump-for-%u.pgtxt'
|
---|
106 | ## @}
|
---|
107 |
|
---|
108 |
|
---|
109 | ## @name Scheduling parameters
|
---|
110 | ## @{
|
---|
111 |
|
---|
112 | ## The time to wait for a gang to gather (in seconds).
|
---|
113 | g_kcSecGangGathering = 600;
|
---|
114 | ## The max time allowed to spend looking for a new task (in seconds).
|
---|
115 | g_kcSecMaxNewTask = 60;
|
---|
116 | ## Minimum time since last task started.
|
---|
117 | g_kcSecMinSinceLastTask = 120; # (2 min)
|
---|
118 | ## Minimum time since last failed task.
|
---|
119 | g_kcSecMinSinceLastFailedTask = 180; # (3 min)
|
---|
120 |
|
---|
121 | ## @}
|
---|
122 |
|
---|
123 |
|
---|
124 |
|
---|
125 | ## @name Test result limits.
|
---|
126 | ## In general, we will fail the test when reached and stop accepting further results.
|
---|
127 | ## @{
|
---|
128 |
|
---|
129 | ## The max number of test results per test set.
|
---|
130 | g_kcMaxTestResultsPerTS = 12288;
|
---|
131 | ## The max number of test results (children) per test result.
|
---|
132 | g_kcMaxTestResultsPerTR = 512;
|
---|
133 | ## The max number of test result values per test set.
|
---|
134 | g_kcMaxTestValuesPerTS = 4096;
|
---|
135 | ## The max number of test result values per test result.
|
---|
136 | g_kcMaxTestValuesPerTR = 256;
|
---|
137 | ## The max number of test result message per test result.
|
---|
138 | g_kcMaxTestMsgsPerTR = 4;
|
---|
139 | ## The max test result nesting depth.
|
---|
140 | g_kcMaxTestResultDepth = 10;
|
---|
141 |
|
---|
142 | ## The max length of a test result name.
|
---|
143 | g_kcchMaxTestResultName = 64;
|
---|
144 | ## The max length of a test result value name.
|
---|
145 | g_kcchMaxTestValueName = 56;
|
---|
146 | ## The max length of a test result message.
|
---|
147 | g_kcchMaxTestMsg = 128;
|
---|
148 |
|
---|
149 | ## The max size of the main log file.
|
---|
150 | g_kcMbMaxMainLog = 32;
|
---|
151 | ## The max size of an uploaded file (individual).
|
---|
152 | g_kcMbMaxUploadSingle = 150;
|
---|
153 | ## The max size of all uploaded file.
|
---|
154 | g_kcMbMaxUploadTotal = 200;
|
---|
155 | ## The max number of files that can be uploaded.
|
---|
156 | g_kcMaxUploads = 256;
|
---|
157 | ## @}
|
---|
158 |
|
---|
159 |
|
---|
160 | ## @name Bug Trackers and VCS reference tags.
|
---|
161 | ## @{
|
---|
162 | class BugTrackerConfig(object):
|
---|
163 | """ Bug tracker config """
|
---|
164 | def __init__(self, sDbId, sName, sBugUrl, asCommitTags):
|
---|
165 | assert len(sDbId) == 4;
|
---|
166 | self.sDbId = sDbId;
|
---|
167 | self.sName = sName;
|
---|
168 | self.sBugUrl = sBugUrl;
|
---|
169 | self.asCommitTags = asCommitTags;
|
---|
170 |
|
---|
171 | ## The key is the database table
|
---|
172 | g_kdBugTrackers = {
|
---|
173 | 'xtrk': BugTrackerConfig('xtrk', 'xTracker', 'https://linserv.de.oracle.com/vbox/xTracker/index.php?bug=',
|
---|
174 | ['bugref:', '@bugref{', 'bugef:', 'bugrf:', ], ),
|
---|
175 | 'bgdb': BugTrackerConfig('bgdb', 'BugDB', 'https://bug.oraclecorp.com/pls/bug/webbug_edit.edit_info_top?rptno=',
|
---|
176 | ['bugdbref:', '@bugdbref{', 'bugdb:', ], ),
|
---|
177 | 'vorg': BugTrackerConfig('vorg', 'External Trac', 'https://www.virtualbox.org/ticket/',
|
---|
178 | ['ticketref:', '@ticketref{', 'ticket:', ], ),
|
---|
179 | };
|
---|
180 | ## @}
|
---|
181 |
|
---|
182 |
|
---|
183 |
|
---|
184 | ## @name Virtual Sheriff email alerts
|
---|
185 | ## @{
|
---|
186 |
|
---|
187 | ## SMTP server host name.
|
---|
188 | g_ksSmtpHost = 'internal-mail-router.oracle.com';
|
---|
189 | ## SMTP server port number.
|
---|
190 | g_kcSmtpPort = 25;
|
---|
191 | ## Default email 'From' for email alert.
|
---|
192 | g_ksAlertFrom = '[email protected]';
|
---|
193 | ## Subject for email alert.
|
---|
194 | g_ksAlertSubject = 'Virtual Test Sheriff Alert';
|
---|
195 | ## List of users to send alerts.
|
---|
196 | g_asAlertList = ['alertuser1', 'alertuser2'];
|
---|
197 | ## iLOM password.
|
---|
198 | g_ksLomPassword = 'put_your_ILOM_password_here_if_applicable';
|
---|
199 |
|
---|
200 | ## @}
|
---|
201 |
|
---|
202 |
|
---|
203 | ## @name Partial Database Dump
|
---|
204 | ## @{
|
---|
205 |
|
---|
206 | ## Minimum number of day. Set higher than g_kcTmDbDumpMaxDays to disable.
|
---|
207 | g_kcTmDbDumpMinDays = 1;
|
---|
208 | ## Maximum number of day. Keep low - consider space and runtime.
|
---|
209 | g_kcTmDbDumpMaxDays = 31;
|
---|
210 | ## The default number of days.
|
---|
211 | g_kcTmDbDumpDefaultDays = 14;
|
---|
212 | ## @}
|
---|
213 |
|
---|
214 |
|
---|
215 | ## @name Debug Features
|
---|
216 | ## @{
|
---|
217 |
|
---|
218 | ## Enables extra DB exception information.
|
---|
219 | g_kfDebugDbXcpt = True;
|
---|
220 |
|
---|
221 | ## Where to write the glue debug.
|
---|
222 | # None indicates apache error log, string indicates a file.
|
---|
223 | #g_ksSrvGlueDebugLogDst = '/tmp/testmanager-srv-glue.log';
|
---|
224 | g_ksSrvGlueDebugLogDst = None;
|
---|
225 | ## Whether to enable CGI trace back in the server glue.
|
---|
226 | g_kfSrvGlueCgiTb = False;
|
---|
227 | ## Enables glue debug output.
|
---|
228 | g_kfSrvGlueDebug = False;
|
---|
229 | ## Timestamp and pid prefix the glue debug output.
|
---|
230 | g_kfSrvGlueDebugTS = True;
|
---|
231 | ## Whether to dumping CGI environment variables.
|
---|
232 | g_kfSrvGlueCgiDumpEnv = False;
|
---|
233 | ## Whether to dumping CGI script arguments.
|
---|
234 | g_kfSrvGlueCgiDumpArgs = False;
|
---|
235 | ## Enables task scheduler debug output to g_ksSrvGlueDebugLogDst.
|
---|
236 | g_kfSrvGlueDebugScheduler = False;
|
---|
237 |
|
---|
238 | ## Enables the SQL trace back.
|
---|
239 | g_kfWebUiSqlTrace = False;
|
---|
240 | ## Enables the explain in the SQL trace back.
|
---|
241 | g_kfWebUiSqlTraceExplain = False;
|
---|
242 | ## Whether the postgresql version supports the TIMING option on EXPLAIN (>= 9.2).
|
---|
243 | g_kfWebUiSqlTraceExplainTiming = False;
|
---|
244 | ## Display time spent processing the page.
|
---|
245 | g_kfWebUiProcessedIn = True;
|
---|
246 | ## Enables WebUI debug output.
|
---|
247 | g_kfWebUiDebug = False;
|
---|
248 | ## Enables WebUI SQL debug output print() calls (requires g_kfWebUiDebug).
|
---|
249 | g_kfWebUiSqlDebug = False;
|
---|
250 | ## Enables the debug panel at the bottom of the page.
|
---|
251 | g_kfWebUiDebugPanel = True;
|
---|
252 |
|
---|
253 | ## Profile cgi/admin.py.
|
---|
254 | g_kfProfileAdmin = False;
|
---|
255 | ## Profile cgi/index.py.
|
---|
256 | g_kfProfileIndex = False;
|
---|
257 |
|
---|
258 | ## When not None,
|
---|
259 | g_ksTestBoxDispXpctLog = '/tmp/testmanager-testboxdisp-xcpt.log'
|
---|
260 | ## @}
|
---|
261 |
|
---|