VirtualBox

source: vbox/trunk/src/VBox/ValidationKit/testmanager/db/tmdb-r14-testboxes-2.pgsql

Last change on this file was 106061, checked in by vboxsync, 4 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 9.2 KB
Line 
1-- $Id: tmdb-r14-testboxes-2.pgsql 106061 2024-09-16 14:03:52Z vboxsync $
2--- @file
3-- VBox Test Manager Database - Adds sCpuName, lCpuRevision and sReport to TestBoxes.
4--
5
6--
7-- Copyright (C) 2013-2024 Oracle and/or its affiliates.
8--
9-- This file is part of VirtualBox base platform packages, as
10-- available from https://www.virtualbox.org.
11--
12-- This program is free software; you can redistribute it and/or
13-- modify it under the terms of the GNU General Public License
14-- as published by the Free Software Foundation, in version 3 of the
15-- License.
16--
17-- This program is distributed in the hope that it will be useful, but
18-- WITHOUT ANY WARRANTY; without even the implied warranty of
19-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20-- General Public License for more details.
21--
22-- You should have received a copy of the GNU General Public License
23-- along with this program; if not, see <https://www.gnu.org/licenses>.
24--
25-- The contents of this file may alternatively be used under the terms
26-- of the Common Development and Distribution License Version 1.0
27-- (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
28-- in the VirtualBox distribution, in which case the provisions of the
29-- CDDL are applicable instead of those of the GPL.
30--
31-- You may elect to license modified versions of this file under the
32-- terms and conditions of either the GPL or the CDDL or both.
33--
34-- SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
35--
36
37
38DROP TABLE OldTestBoxes;
39DROP TABLE NewTestBoxes;
40
41\d TestBoxes;
42
43\set ON_ERROR_STOP 1
44\set AUTOCOMMIT 0
45
46LOCK TABLE TestBoxStatuses IN ACCESS EXCLUSIVE MODE;
47LOCK TABLE TestSets IN ACCESS EXCLUSIVE MODE;
48LOCK TABLE TestBoxes IN ACCESS EXCLUSIVE MODE;
49
50DROP INDEX TestBoxesUuidIdx;
51
52--
53-- Rename the original table, drop constrains and foreign key references so we
54-- get the right name automatic when creating the new one.
55--
56ALTER TABLE TestBoxes RENAME TO OldTestBoxes;
57
58ALTER TABLE OldTestBoxes DROP CONSTRAINT testboxes_ccpus_check;
59ALTER TABLE OldTestBoxes DROP CONSTRAINT testboxes_check;
60ALTER TABLE OldTestBoxes DROP CONSTRAINT testboxes_cmbmemory_check;
61ALTER TABLE OldTestBoxes DROP CONSTRAINT testboxes_cmbscratch_check;
62ALTER TABLE OldTestBoxes DROP CONSTRAINT testboxes_pctscaletimeout_check;
63
64ALTER TABLE TestBoxStatuses DROP CONSTRAINT TestBoxStatuses_idGenTestBox_fkey;
65ALTER TABLE TestSets DROP CONSTRAINT TestSets_idGenTestBox_fkey;
66
67ALTER TABLE OldTestBoxes DROP CONSTRAINT testboxes_pkey;
68ALTER TABLE OldTestBoxes DROP CONSTRAINT testboxes_idgentestbox_key;
69
70--
71-- Create the new table, filling it with the current TestBoxes content.
72--
73CREATE TABLE TestBoxes (
74 --- The fixed testbox ID.
75 -- This is assigned when the testbox is created and will never change.
76 idTestBox INTEGER DEFAULT NEXTVAL('TestBoxIdSeq') NOT NULL,
77 --- When this row starts taking effect (inclusive).
78 tsEffective TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp NOT NULL,
79 --- When this row stops being tsEffective (exclusive).
80 tsExpire TIMESTAMP WITH TIME ZONE DEFAULT TIMESTAMP WITH TIME ZONE 'infinity' NOT NULL,
81 --- The user id of the one who created/modified this entry.
82 -- When modified automatically by the testbox, NULL is used.
83 -- Non-unique foreign key: Users(uid)
84 uidAuthor INTEGER DEFAULT NULL,
85 --- Generation ID for this row.
86 -- This is primarily for referencing by TestSets.
87 idGenTestBox INTEGER UNIQUE DEFAULT NEXTVAL('TestBoxGenIdSeq') NOT NULL,
88
89 --- The testbox IP.
90 -- This is from the webserver point of view and automatically updated on
91 -- SIGNON. The test setup doesn't permit for IP addresses to change while
92 -- the testbox is operational, because this will break gang tests.
93 ip inet NOT NULL,
94 --- The system or firmware UUID.
95 -- This uniquely identifies the testbox when talking to the server. After
96 -- SIGNON though, the testbox will also provide idTestBox and ip to
97 -- establish its identity beyond doubt.
98 uuidSystem uuid NOT NULL,
99 --- The testbox name.
100 -- Usually similar to the DNS name.
101 sName text NOT NULL,
102 --- Optional testbox description.
103 -- Intended for describing the box as well as making other relevant notes.
104 sDescription text DEFAULT NULL,
105
106 --- Reference to the scheduling group that this testbox is a member of.
107 -- Non-unique foreign key: SchedGroups(idSchedGroup)
108 -- A testbox is always part of a group, the default one nothing else.
109 idSchedGroup INTEGER DEFAULT 1 NOT NULL,
110
111 --- Indicates whether this testbox is enabled.
112 -- A testbox gets disabled when we're doing maintenance, debugging a issue
113 -- that happens only on that testbox, or some similar stuff. This is an
114 -- alternative to deleting the testbox.
115 fEnabled BOOLEAN DEFAULT NULL,
116
117 --- The kind of lights-out-management.
118 enmLomKind LomKind_T DEFAULT 'none'::LomKind_T NOT NULL,
119 --- The IP adress of the lights-out-management.
120 -- This can be NULL if enmLomKind is 'none', otherwise it must contain a valid address.
121 ipLom inet DEFAULT NULL,
122
123 --- Timeout scale factor, given as a percent.
124 -- This is a crude adjustment of the test case timeout for slower hardware.
125 pctScaleTimeout smallint DEFAULT 100 NOT NULL CHECK (pctScaleTimeout > 10 AND pctScaleTimeout < 20000),
126
127 --- @name Scheduling properties (reported by testbox script).
128 -- @{
129 --- Same abbrieviations as kBuild, see KBUILD_OSES.
130 sOs text DEFAULT NULL,
131 --- Informational, no fixed format.
132 sOsVersion text DEFAULT NULL,
133 --- Same as CPUID reports (GenuineIntel, AuthenticAMD, CentaurHauls, ...).
134 sCpuVendor text DEFAULT NULL,
135 --- Same as kBuild - x86, amd64, ... See KBUILD_ARCHES.
136 sCpuArch text DEFAULT NULL,
137 --- The CPU name if available.
138 sCpuName text DEFAULT NULL,
139 --- Number identifying the CPU family/model/stepping/whatever.
140 -- For x86 and AMD64 type CPUs, this will on the following format:
141 -- (EffFamily << 24) | (EffModel << 8) | Stepping.
142 lCpuRevision bigint DEFAULT NULL,
143 --- Number of CPUs, CPU cores and CPU threads.
144 cCpus smallint DEFAULT NULL CHECK (cCpus IS NULL OR cCpus > 0),
145 --- Set if capable of hardware virtualization.
146 fCpuHwVirt boolean DEFAULT NULL,
147 --- Set if capable of nested paging.
148 fCpuNestedPaging boolean DEFAULT NULL,
149 --- Set if CPU capable of 64-bit (VBox) guests.
150 fCpu64BitGuest boolean DEFAULT NULL,
151 --- Set if chipset with usable IOMMU (VT-d / AMD-Vi).
152 fChipsetIoMmu boolean DEFAULT NULL,
153 --- The (approximate) memory size in megabytes (rounded down to nearest 4 MB).
154 cMbMemory bigint DEFAULT NULL CHECK (cMbMemory IS NULL OR cMbMemory > 0),
155 --- The amount of scratch space in megabytes (rounded down to nearest 64 MB).
156 cMbScratch bigint DEFAULT NULL CHECK (cMbScratch IS NULL OR cMbScratch >= 0),
157 --- Free form hardware and software report field.
158 sReport text DEFAULT NULL,
159 --- @}
160
161 --- The testbox script revision number, serves the purpose of a version number.
162 -- Probably good to have when scheduling upgrades as well for status purposes.
163 iTestBoxScriptRev INTEGER DEFAULT 0 NOT NULL,
164 --- The python sys.hexversion (layed out as of 2.7).
165 -- Good to know which python versions we need to support.
166 iPythonHexVersion INTEGER DEFAULT NULL,
167
168 --- Pending command.
169 -- @note We put it here instead of in TestBoxStatuses to get history.
170 enmPendingCmd TestBoxCmd_T DEFAULT 'none'::TestBoxCmd_T NOT NULL,
171
172 PRIMARY KEY (idTestBox, tsExpire),
173
174 --- Nested paging requires hardware virtualization.
175 CHECK (fCpuNestedPaging IS NULL OR (fCpuNestedPaging <> TRUE OR fCpuHwVirt = TRUE))
176);
177
178INSERT INTO TestBoxes ( idTestBox, tsEffective, tsExpire, uidAuthor, idGenTestBox, ip, uuidSystem, sName, sDescription,
179 idSchedGroup, fEnabled, enmLomKind, ipLom, pctScaleTimeout, sOs, sOsVersion, sCpuVendor, sCpuArch, sCpuName,
180 lCpuRevision, cCpus, fCpuHwVirt, fCpuNestedPaging, fCpu64BitGuest, fChipsetIoMmu, cMbMemory, cMbScratch, sReport,
181 iTestBoxScriptRev, iPythonHexVersion, enmPendingCmd )
182 SELECT idTestBox, tsEffective, tsExpire, uidAuthor, idGenTestBox, ip, uuidSystem, sName, sDescription,
183 idSchedGroup, fEnabled, enmLomKind, ipLom, pctScaleTimeout, sOs, sOsVersion, sCpuVendor, sCpuArch, NULL,
184 NULL, cCpus, fCpuHwVirt, fCpuNestedPaging, fCpu64BitGuest, fChipsetIoMmu, cMbMemory, cMbScratch, NULL,
185 iTestBoxScriptRev, iPythonHexVersion, enmPendingCmd
186 FROM OldTestBoxes;
187
188-- Add index.
189CREATE UNIQUE INDEX TestBoxesUuidIdx ON TestBoxes (uuidSystem, tsExpire);
190
191-- Restore foreign key references to the table.
192ALTER TABLE TestBoxStatuses ADD CONSTRAINT TestBoxStatuses_idGenTestBox_fkey FOREIGN KEY (idGenTestBox) REFERENCES TestBoxes(idGenTestBox);
193ALTER TABLE TestSets ADD CONSTRAINT TestSets_idGenTestBox_fkey FOREIGN KEY (idGenTestBox) REFERENCES TestBoxes(idGenTestBox);
194
195-- Drop the old table.
196DROP TABLE OldTestBoxes;
197
198COMMIT;
199
200\d TestBoxes;
201
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette