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