cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- $Id$
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @file
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- VBox Test Manager Database Creation script.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Copyright (C) 2012-2014 Oracle Corporation
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- This file is part of VirtualBox Open Source Edition (OSE), as
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- available from http://www.virtualbox.org. This file is free software;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- you can redistribute it and/or modify it under the terms of the GNU
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- General Public License (GPL) as published by the Free Software
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Foundation, in version 2 as it comes in the "COPYING" file of the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- VirtualBox OSE distribution. VirtualBox OSE is distributed in the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- The contents of this file may alternatively be used under the terms
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- of the Common Development and Distribution License Version 1.0
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- (CDDL) only, as it comes in the "COPYING.CDDL" file of the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- VirtualBox OSE distribution, in which case the provisions of the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- CDDL are applicable instead of those of the GPL.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- You may elect to license modified versions of this file under the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- terms and conditions of either the GPL or the CDDL or both.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Declaimer:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- The guys working on this design are not database experts, web
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- programming experts or similar, rather we are low level guys
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- who's main job is x86 & AMD64 virtualization. So, please don't
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- be too hard on us. :-)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncDROP DATABASE testmanager; -- WARNING!! WE CURRENTLY DROP THE DATABASE!
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync\set ON_ERROR_STOP 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE DATABASE testmanager;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync\connect testmanager;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- S y s t e m
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync---
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Log table for a few important events.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Currently, two events are planned to be logged:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- - Sign on of an unknown testbox, including the IP and System UUID.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- This will be restricted to one entry per 24h or something like that:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- SELECT COUNT(*)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- FROM SystemLog
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- WHERE tsCreated >= (current_timestamp - interval '24 hours')
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- AND sEvent = 'TBoxUnkn'
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- AND sLogText = :sNewLogText;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- - When cleaning up an abandond testcase (scenario #9), log which
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- testbox abandond which testset.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- The Web UI will have some way of displaying the log.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- A batch job should regularly clean out old log messages, like for instance
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- > 64 days.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TABLE SystemLog (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this was logged.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsCreated TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The event type.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- This is a 8 character string identifier so that we don't need to change
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- some enum type everytime we introduce a new event type.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sEvent CHAR(8) NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The log text.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sLogText text NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync PRIMARY KEY (tsCreated, sEvent)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- C o n f i g u r a t i o n
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @table Users
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Test manager users.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- This is mainly for doing simple access checks before permitting access to
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- the test manager. This needs to be coordinated with
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- apache/ldap/Oracle-Single-Sign-On.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- The main purpose, though, is for tracing who changed the test config and
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- analysis data.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- @remarks This table stores history. Never update or delete anything. The
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- equivalent of deleting is done by setting the 'tsExpire' field to
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- current_timestamp.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE SEQUENCE UserIdSeq
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync START 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync INCREMENT BY 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MAXVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MINVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync CACHE 1;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TABLE Users (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The user id.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync uid INTEGER DEFAULT NEXTVAL('UserIdSeq') NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row starts taking effect (inclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsEffective TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row stops being tsEffective (exclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsExpire TIMESTAMP WITH TIME ZONE DEFAULT TIMESTAMP WITH TIME ZONE 'infinity' NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The user id of the one who created/modified this entry.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: Users(uid)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync uidAuthor INTEGER DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- User name.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sUsername text NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The email address of the user.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sEmail text NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The full name.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sFullName text NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The login name used by apache.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sLoginName text NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync PRIMARY KEY (uid, tsExpire)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE INDEX UsersLoginNameIdx ON Users (tsExpire, sLoginName);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @table GlobalResources
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Global resource configuration.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- For example an iSCSI target.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- @remarks This table stores history. Never update or delete anything. The
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- equivalent of deleting is done by setting the 'tsExpire' field to
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- current_timestamp.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE SEQUENCE GlobalResourceIdSeq
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync START 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync INCREMENT BY 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MAXVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MINVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync CACHE 1;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TABLE GlobalResources (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The global resource ID.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- This stays the same thru updates.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idGlobalRsrc INTEGER DEFAULT NEXTVAL('GlobalResourceIdSeq') NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row starts taking effect (inclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsEffective TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row stops being tsEffective (exclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsExpire TIMESTAMP WITH TIME ZONE DEFAULT TIMESTAMP WITH TIME ZONE 'infinity' NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The user id of the one who created/modified this entry.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: Users(uid)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync uidAuthor INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The name of the resource.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sName text NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Optional resource description.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sDescription text,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Indicates whether this resource is currently enabled (online).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fEnabled boolean DEFAULT FALSE NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync PRIMARY KEY (idGlobalRsrc, tsExpire)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @table BuildSources
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Build sources.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- This is used by a scheduling group to select builds and the default
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Validation Kit from the Builds table.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- @remarks This table stores history. Never update or delete anything. The
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- equivalent of deleting is done by setting the 'tsExpire' field to
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- current_timestamp.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- @todo Any better way of representing this so we could more easily
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- join/whatever when searching for builds?
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE SEQUENCE BuildSourceIdSeq
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync START 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync INCREMENT BY 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MAXVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MINVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync CACHE 1;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TABLE BuildSources (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The build source identifier.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- This stays constant over time.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idBuildSrc INTEGER DEFAULT NEXTVAL('BuildSourceIdSeq') NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row starts taking effect (inclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsEffective TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row stops being tsEffective (exclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsExpire TIMESTAMP WITH TIME ZONE DEFAULT TIMESTAMP WITH TIME ZONE 'infinity' NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The user id of the one who created/modified this entry.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: Users(uid)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync uidAuthor INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The name of the build source.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sName TEXT NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Description.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sDescription TEXT DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Which product.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- ASSUME that it is okay to limit a build source to a single product.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sProduct text NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Which branch.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- ASSUME that it is okay to limit a build source to a branch.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sBranch text NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Build types to include, all matches if NULL.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- @todo Weighting the types would be nice in a later version.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync asTypes text ARRAY DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Array of the 'sOs.sCpuArch' to match, all matches if NULL.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- See KBUILD_OSES in kBuild for a list of standard target OSes, and
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- KBUILD_ARCHES for a list of standard architectures.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- @remarks See marks on 'os-agnostic' and 'noarch' in BuildCategories.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync asOsArches text ARRAY DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The first subversion tree revision to match, no lower limit if NULL.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync iFirstRevision INTEGER DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The last subversion tree revision to match, no upper limit if NULL.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync iLastRevision INTEGER DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The maximum age of the builds in seconds, unlimited if NULL.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync cSecMaxAge INTEGER DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync PRIMARY KEY (idBuildSrc, tsExpire)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @table TestCases
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Test case configuration.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- @remarks This table stores history. Never update or delete anything. The
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- equivalent of deleting is done by setting the 'tsExpire' field to
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- current_timestamp.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE SEQUENCE TestCaseIdSeq
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync START 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync INCREMENT BY 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MAXVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MINVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync CACHE 1;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE SEQUENCE TestCaseGenIdSeq
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync START 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync INCREMENT BY 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MAXVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MINVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync CACHE 1;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TABLE TestCases (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The fixed test case ID.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- This is assigned when the test case is created and will never change.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestCase INTEGER DEFAULT NEXTVAL('TestCaseIdSeq') NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row starts taking effect (inclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsEffective TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row stops being tsEffective (exclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsExpire TIMESTAMP WITH TIME ZONE DEFAULT TIMESTAMP WITH TIME ZONE 'infinity' NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The user id of the one who created/modified this entry.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: Users(uid)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync uidAuthor INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Generation ID for this row, a truly unique identifier.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- This is primarily for referencing by TestSets.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idGenTestCase INTEGER UNIQUE DEFAULT NEXTVAL('TestCaseGenIdSeq') NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The name of the test case.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sName TEXT NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Optional test case description.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sDescription TEXT DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Indicates whether this test case is currently enabled.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fEnabled BOOLEAN DEFAULT FALSE NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Default test case timeout given in seconds.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync cSecTimeout INTEGER NOT NULL CHECK (cSecTimeout > 0),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Default TestBox requirement expression (python boolean expression).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- All the scheduler properties are available for use with the same names
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- as in that table.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- If NULL everything matches.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sTestBoxReqExpr TEXT DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Default build requirement expression (python boolean expression).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- The following build properties are available: sProduct, sBranch,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- sType, asOsArches, sVersion, iRevision, uidAuthor and idBuild.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- If NULL everything matches.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sBuildReqExpr TEXT DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The base command.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- String suitable for executing in bourne shell with space as separator
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- (IFS). References to @BUILD_BINARIES@ will be replaced WITH the content
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- of the Builds(sBinaries) field.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sBaseCmd TEXT NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Comma separated list of test suite zips (or tars) that the testbox will
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- need to download and expand prior to testing.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- If NULL the current test suite of the scheduling group will be used (the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- scheduling group will have an optional test suite build queue associated
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- with it). The current test suite can also be referenced by
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- @VALIDATIONKIT_ZIP@ in case more downloads are required. Files may also be
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- uploaded to the test manager download area, in which case the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- @DOWNLOAD_BASE_URL@ prefix can be used to refer to this area.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sTestSuiteZips TEXT DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync PRIMARY KEY (idTestCase, tsExpire)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @table TestCaseArgs
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Test case argument list variations.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- For example, we have a test case that does a set of tests on a virtual
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- machine. To get better code/feature coverage of this testcase we wish to
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- run it with different guest hardware configuration. The test case may do
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- the same stuff, but the guest OS as well as the VMM may react differently to
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- the hardware configurations and uncover issues in the VMM, device emulation
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- or other places.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Typical hardware variations are:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- - guest memory size (RAM),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- - guest video memory size (VRAM),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- - virtual CPUs / cores / threads,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- - virtual chipset
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- - virtual network interface card (NIC)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- - USB 1.1, USB 2.0, no USB
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- The TM web UI will help the user create a reasonable set of permutations
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- of these parameters, the user specifies a maximum and the TM uses certain
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- rules together with random selection to generate the desired number. The
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- UI will also help suggest fitting testbox requirements according to the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- RAM/VRAM sizes and the virtual CPU counts. The user may then make
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- adjustments to the suggestions before commit them.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Alternatively, the user may also enter all the permutations without any
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- help from the UI.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Note! All test cases has at least one entry in this table, even if it is
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- empty, because testbox requirements are specified thru this.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Querying the valid parameter lists for a testase this way:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- SELECT * ... WHERE idTestCase = TestCases.idTestCase
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- AND tsExpire > <when>
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- AND tsEffective <= <when>;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Querying the valid parameter list for the latest generation can be
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- simplified by just checking tsExpire date:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- SELECT * ... WHERE idTestCase = TestCases.idTestCase
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- AND tsExpire == TIMESTAMP WITH TIME ZONE 'infinity';
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- @remarks This table stores history. Never update or delete anything. The
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- equivalent of deleting is done by setting the 'tsExpire' field to
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- current_timestamp.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE SEQUENCE TestCaseArgsIdSeq
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync START 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync INCREMENT BY 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MAXVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MINVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync CACHE 1;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE SEQUENCE TestCaseArgsGenIdSeq
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync START 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync INCREMENT BY 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MAXVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MINVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync CACHE 1;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TABLE TestCaseArgs (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The test case ID.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: TestCases(idTestCase).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestCase INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The testcase argument variation ID (fixed).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- This is primarily for TestGroupMembers.aidTestCaseArgs.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestCaseArgs INTEGER DEFAULT NEXTVAL('TestCaseArgsIdSeq') NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row starts taking effect (inclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsEffective TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row stops being tsEffective (exclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsExpire TIMESTAMP WITH TIME ZONE DEFAULT TIMESTAMP WITH TIME ZONE 'infinity' NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The user id of the one who created/modified this entry.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: Users(uid)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync uidAuthor INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Generation ID for this row.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- This is primarily for efficient referencing by TestSets and SchedQueues.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idGenTestCaseArgs INTEGER UNIQUE DEFAULT NEXTVAL('TestCaseArgsGenIdSeq') NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The additional arguments.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- String suitable for bourne shell style argument parsing with space as
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- separator (IFS). References to @BUILD_BINARIES@ will be replaced with
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- the content of the Builds(sBinaries) field.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sArgs TEXT NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Optional test case timeout given in seconds.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- If NULL, the TestCases.cSecTimeout field is used instead.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync cSecTimeout INTEGER DEFAULT NULL CHECK (cSecTimeout IS NULL OR cSecTimeout > 0),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Additional TestBox requirement expression (python boolean expression).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- All the scheduler properties are available for use with the same names
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- as in that table. This is checked after first checking the requirements
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- in the TestCases.sTestBoxReqExpr field.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sTestBoxReqExpr TEXT DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Additional build requirement expression (python boolean expression).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- The following build properties are available: sProduct, sBranch,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- sType, asOsArches, sVersion, iRevision, uidAuthor and idBuild. This is
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- checked after first checking the requirements in the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- TestCases.sBuildReqExpr field.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sBuildReqExpr TEXT DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Number of testboxes required (gang scheduling).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync cGangMembers SMALLINT DEFAULT 1 NOT NULL CHECK (cGangMembers > 0 AND cGangMembers < 1024),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The arguments are part of the primary key for several reasons.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- No duplicate argument lists (makes no sense - if you want to prioritize
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- argument lists, we add that explicitly). This may hopefully enable us
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- to more easily check coverage later on, even when the test case is
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- reconfigured with more/less permutations.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync PRIMARY KEY (idTestCase, tsExpire, sArgs)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE INDEX TestCaseArgsLookupIdx ON TestCaseArgs (idTestCase, tsExpire, tsEffective);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @table TestCaseDeps
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Test case dependencies (N:M)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- This effect build selection. The build must have passed all runs of the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- given prerequisite testcase (idTestCasePreReq) and executed at a minimum one
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- argument list variation.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- This should also affect scheduling order, if possible at least one
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- prerequisite testcase variation should be place before the specific testcase
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- in the scheduling queue.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- @remarks This table stores history. Never update or delete anything. The
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- equivalent of deleting is done by setting the 'tsExpire' field to
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- current_timestamp. To select the currently valid entries use
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- tsExpire = TIMESTAMP WITH TIME ZONE 'infinity'.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TABLE TestCaseDeps (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The test case that depends on someone.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: TestCases(idTestCase).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestCase INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The prerequisite test case ID.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: TestCases(idTestCase).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestCasePreReq INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row starts taking effect (inclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsEffective TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row stops being tsEffective (exclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsExpire TIMESTAMP WITH TIME ZONE DEFAULT TIMESTAMP WITH TIME ZONE 'infinity' NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The user id of the one who created/modified this entry.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: Users(uid)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync uidAuthor INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync PRIMARY KEY (idTestCase, idTestCasePreReq, tsExpire)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @table TestCaseGlobalRsrcDeps
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Test case dependencies on global resources (N:M)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- @remarks This table stores history. Never update or delete anything. The
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- equivalent of deleting is done by setting the 'tsExpire' field to
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- current_timestamp. To select the currently valid entries use
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- tsExpire = TIMESTAMP WITH TIME ZONE 'infinity'.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TABLE TestCaseGlobalRsrcDeps (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The test case that depends on someone.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: TestCases(idTestCase).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestCase INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The prerequisite resource ID.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: GlobalResources(idGlobalRsrc).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idGlobalRsrc INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row starts taking effect (inclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsEffective TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row stops being tsEffective (exclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsExpire TIMESTAMP WITH TIME ZONE DEFAULT TIMESTAMP WITH TIME ZONE 'infinity' NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The user id of the one who created/modified this entry.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: Users(uid)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync uidAuthor INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync PRIMARY KEY (idTestCase, idGlobalRsrc, tsExpire)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @table TestGroups
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Test Group - A collection of test cases.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- This is for simplifying test configuration by working with a few groups
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- instead of a herd of individual testcases. It may also be used for creating
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- test suites for certain areas (like guest additions) or tasks (like
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- performance measurements).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- A test case can be member of any number of test groups.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- @remarks This table stores history. Never update or delete anything. The
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- equivalent of deleting is done by setting the 'tsExpire' field to
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- current_timestamp. To select the currently valid entries use
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- tsExpire = TIMESTAMP WITH TIME ZONE 'infinity'.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE SEQUENCE TestGroupIdSeq
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync START 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync INCREMENT BY 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MAXVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MINVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync CACHE 1;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TABLE TestGroups (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The fixed scheduling group ID.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- This is assigned when the group is created and will never change.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestGroup INTEGER DEFAULT NEXTVAL('TestGroupIdSeq') NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row starts taking effect (inclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsEffective TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row stops being tsEffective (exclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsExpire TIMESTAMP WITH TIME ZONE DEFAULT TIMESTAMP WITH TIME ZONE 'infinity' NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The user id of the one who created/modified this entry.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: Users(uid)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync uidAuthor INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The name of the scheduling group.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sName text NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Optional group description.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sDescription text,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync PRIMARY KEY (idTestGroup, tsExpire)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE INDEX TestGroups_id_index ON TestGroups (idTestGroup, tsExpire, tsEffective);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @table TestGroupMembers
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- The N:M relation ship between test case configurations and test groups.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- @remarks This table stores history. Never update or delete anything. The
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- equivalent of deleting is done by setting the 'tsExpire' field to
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- current_timestamp. To select the currently valid entries use
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- tsExpire = TIMESTAMP WITH TIME ZONE 'infinity'.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TABLE TestGroupMembers (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The group ID.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: TestGroups(idTestGroup).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestGroup INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The test case ID.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: TestCases(idTestCase).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestCase INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row starts taking effect (inclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsEffective TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row stops being tsEffective (exclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsExpire TIMESTAMP WITH TIME ZONE DEFAULT TIMESTAMP WITH TIME ZONE 'infinity' NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The user id of the one who created/modified this entry.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: Users(uid)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync uidAuthor INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Test case scheduling priority.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Higher number causes the test case to be run more frequently.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- @sa SchedGroupMembers.iSchedPriority
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- @todo Not sure we want to keep this...
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync iSchedPriority INTEGER DEFAULT 16 CHECK (iSchedPriority >= 0 AND iSchedPriority < 32) NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Limit the memberships to the given argument variations.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: TestCaseArgs(idTestCase, idTestCaseArgs).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync aidTestCaseArgs INTEGER ARRAY DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync PRIMARY KEY (idTestGroup, idTestCase, tsExpire)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @table SchedGroups
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Scheduling group (aka. testbox partitioning) configuration.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- A testbox is associated with exactly one scheduling group. This association
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- can be changed, of course. If we (want to) retire a group which still has
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- testboxes associated with it, these will be moved to the 'default' group.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- The TM web UI will make sure that a testbox is always in a group and that
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- the default group cannot be deleted.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- A scheduling group combines several things:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- - A selection of builds to test (via idBuildSrc).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- - A collection of test groups to test with (via SchedGroupMembers).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- - A set of testboxes to test on (via TestBoxes.idSchedGroup).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- In additions there is an optional source of fresh test suite builds (think
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- VBoxTestSuite) as well as scheduling options.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- @remarks This table stores history. Never update or delete anything. The
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- equivalent of deleting is done by setting the 'tsExpire' field to
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- current_timestamp. To select the currently valid entries use
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- tsExpire = TIMESTAMP WITH TIME ZONE 'infinity'.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TYPE Scheduler_T AS ENUM (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'bestEffortContinousItegration',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'reserved'
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE SEQUENCE SchedGroupIdSeq
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync START 2
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync INCREMENT BY 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MAXVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MINVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync CACHE 1;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TABLE SchedGroups (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The fixed scheduling group ID.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- This is assigned when the group is created and will never change.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idSchedGroup INTEGER DEFAULT NEXTVAL('SchedGroupIdSeq') NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row starts taking effect (inclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsEffective TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row stops being tsEffective (exclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsExpire TIMESTAMP WITH TIME ZONE DEFAULT TIMESTAMP WITH TIME ZONE 'infinity' NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The user id of the one who created/modified this entry.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: Users(uid)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- @note This is NULL for the default group.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync uidAuthor INTEGER DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The name of the scheduling group.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sName text NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Optional group description.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sDescription text,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Indicates whether this group is currently enabled.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fEnabled boolean NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The scheduler to use.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- This is for when we later desire different scheduling that the best
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- effort stuff provided by the initial implementation.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync enmScheduler Scheduler_T DEFAULT 'bestEffortContinousItegration'::Scheduler_T NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The build source.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: BuildSources(idBuildSrc)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idBuildSrc INTEGER DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The Validation Kit build source (@VALIDATIONKIT_ZIP@).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: BuildSources(idBuildSrc)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idBuildSrcTestSuite INTEGER DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync PRIMARY KEY (idSchedGroup, tsExpire)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Special default group.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncINSERT INTO SchedGroups (idSchedGroup, tsEffective, tsExpire, sName, sDescription, fEnabled)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync VALUES (1, TIMESTAMP WITH TIME ZONE 'epoch', TIMESTAMP WITH TIME ZONE 'infinity', 'default', 'default group', FALSE);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @table SchedGroupMembers
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- N:M relationship between scheduling groups and test groups.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Several scheduling parameters are associated with this relationship.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- The test group dependency (idTestGroupPreReq) can be used in the same way as
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- TestCaseDeps.idTestCasePreReq, only here on test group level. This means it
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- affects the build selection. The builds needs to have passed all test runs
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- the prerequisite test group and done at least one argument variation of each
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- test case in it.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- @remarks This table stores history. Never update or delete anything. The
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- equivalent of deleting is done by setting the 'tsExpire' field to
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- current_timestamp. To select the currently valid entries use
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- tsExpire = TIMESTAMP WITH TIME ZONE 'infinity'.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TABLE SchedGroupMembers (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Scheduling ID.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: SchedGroups(idSchedGroup).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idSchedGroup INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Testgroup ID.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: TestGroups(idTestGroup).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestGroup INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row starts taking effect (inclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsEffective TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row stops being tsEffective (exclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsExpire TIMESTAMP WITH TIME ZONE DEFAULT TIMESTAMP WITH TIME ZONE 'infinity' NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The user id of the one who created/modified this entry.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: Users(uid)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync uidAuthor INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The scheduling priority if the test group.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Higher number causes the test case to be run more frequently.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- @sa TestGroupMembers.iSchedPriority
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync iSchedPriority INTEGER DEFAULT 16 CHECK (iSchedPriority >= 0 AND iSchedPriority < 32) NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When during the week this group is allowed to start running, NULL means
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- there are no constraints.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Each bit in the bitstring represents one hour, with bit 0 indicating the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- midnight hour on a monday.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync bmHourlySchedule bit(168) DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Optional test group dependency.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: TestGroups(idTestGroup).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- This is for requiring that a build has been subject to smoke tests
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- before bothering to subject it to longer tests.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- @todo Not entirely sure this should be here, but I'm not so keen on yet
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- another table as the only use case is smoketests.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestGroupPreReq INTEGER DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync PRIMARY KEY (idSchedGroup, idTestGroup, tsExpire)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @type TestBoxCmd_T
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Testbox commands.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TYPE TestBoxCmd_T AS ENUM (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'none',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'abort',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'reboot', --< This implies abort. Status changes when reaching 'idle'.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'upgrade', --< This is only handled when asking for work.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'upgrade-and-reboot', --< Ditto.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'special' --< Similar to upgrade, reserved for the future.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @type LomKind_T
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- The kind of lights out management on a testbox.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TYPE LomKind_T AS ENUM (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'none',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'ilom',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'elom',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'apple-xserve-lom'
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @table TestBoxes
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Testbox configurations.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- The testboxes are identified by IP and the system UUID if available. Should
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- the IP change, the testbox will be refused at sign on and the testbox
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- sheriff will have to update it's IP.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- @todo Implement the UUID stuff. Get it from DMI, UEFI or whereever.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Mismatching needs to be logged somewhere...
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- To query the currently valid configuration:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- SELECT ... WHERE id = idTestBox AND tsExpire = TIMESTAMP WITH TIME ZONE 'infinity';
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- @remarks This table stores history. Never update or delete anything. The
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- equivalent of deleting is done by setting the 'tsExpire' field to
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- current_timestamp. To select the currently valid entries use
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- tsExpire = TIMESTAMP WITH TIME ZONE 'infinity'.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE SEQUENCE TestBoxIdSeq
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync START 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync INCREMENT BY 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MAXVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MINVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync CACHE 1;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE SEQUENCE TestBoxGenIdSeq
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync START 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync INCREMENT BY 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MAXVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MINVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync CACHE 1;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TABLE TestBoxes (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The fixed testbox ID.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- This is assigned when the testbox is created and will never change.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestBox INTEGER DEFAULT NEXTVAL('TestBoxIdSeq') NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row starts taking effect (inclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsEffective TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row stops being tsEffective (exclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsExpire TIMESTAMP WITH TIME ZONE DEFAULT TIMESTAMP WITH TIME ZONE 'infinity' NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The user id of the one who created/modified this entry.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- When modified automatically by the testbox, NULL is used.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: Users(uid)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync uidAuthor INTEGER DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Generation ID for this row.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- This is primarily for referencing by TestSets.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idGenTestBox INTEGER UNIQUE DEFAULT NEXTVAL('TestBoxGenIdSeq') NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The testbox IP.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- This is from the webserver point of view and automatically updated on
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- SIGNON. The test setup doesn't permit for IP addresses to change while
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- the testbox is operational, because this will break gang tests.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ip inet NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The system or firmware UUID.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- This uniquely identifies the testbox when talking to the server. After
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- SIGNON though, the testbox will also provide idTestBox and ip to
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- establish its identity beyond doubt.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync uuidSystem uuid NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The testbox name.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Usually similar to the DNS name.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sName text NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Optional testbox description.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Intended for describing the box as well as making other relevant notes.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sDescription text DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Reference to the scheduling group that this testbox is a member of.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: SchedGroups(idSchedGroup)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- A testbox is always part of a group, the default one nothing else.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idSchedGroup INTEGER DEFAULT 1 NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Indicates whether this testbox is enabled.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- A testbox gets disabled when we're doing maintenance, debugging a issue
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- that happens only on that testbox, or some similar stuff. This is an
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- alternative to deleting the testbox.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fEnabled BOOLEAN DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The kind of lights-out-management.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync enmLomKind LomKind_T DEFAULT 'none'::LomKind_T NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The IP adress of the lights-out-management.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- This can be NULL if enmLomKind is 'none', otherwise it must contain a valid address.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ipLom inet DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Timeout scale factor, given as a percent.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- This is a crude adjustment of the test case timeout for slower hardware.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync pctScaleTimeout smallint DEFAULT 100 NOT NULL CHECK (pctScaleTimeout > 10 AND pctScaleTimeout < 20000),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- @name Scheduling properties (reported by testbox script).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- @{
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Same abbrieviations as kBuild, see KBUILD_OSES.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sOs text DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Informational, no fixed format.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sOsVersion text DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Same as CPUID reports (GenuineIntel, AuthenticAMD, CentaurHauls, ...).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sCpuVendor text DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Same as kBuild - x86, amd64, ... See KBUILD_ARCHES.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sCpuArch text DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The CPU name if available.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sCpuName text DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Number identifying the CPU family/model/stepping/whatever.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- For x86 and AMD64 type CPUs, this will on the following format:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- (EffFamily << 24) | (EffModel << 8) | Stepping.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync lCpuRevision bigint DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Number of CPUs, CPU cores and CPU threads.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync cCpus smallint DEFAULT NULL CHECK (cCpus IS NULL OR cCpus > 0),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Set if capable of hardware virtualization.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fCpuHwVirt boolean DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Set if capable of nested paging.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fCpuNestedPaging boolean DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Set if CPU capable of 64-bit (VBox) guests.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fCpu64BitGuest boolean DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Set if chipset with usable IOMMU (VT-d / AMD-Vi).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fChipsetIoMmu boolean DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The (approximate) memory size in megabytes (rounded down to nearest 4 MB).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync cMbMemory bigint DEFAULT NULL CHECK (cMbMemory IS NULL OR cMbMemory > 0),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The amount of scratch space in megabytes (rounded down to nearest 64 MB).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync cMbScratch bigint DEFAULT NULL CHECK (cMbScratch IS NULL OR cMbScratch >= 0),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Free form hardware and software report field.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sReport text DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- @}
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The testbox script revision number, serves the purpose of a version number.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Probably good to have when scheduling upgrades as well for status purposes.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync iTestBoxScriptRev INTEGER DEFAULT 0 NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The python sys.hexversion (layed out as of 2.7).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Good to know which python versions we need to support.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync iPythonHexVersion INTEGER DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Pending command.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- @note We put it here instead of in TestBoxStatuses to get history.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync enmPendingCmd TestBoxCmd_T DEFAULT 'none'::TestBoxCmd_T NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync PRIMARY KEY (idTestBox, tsExpire),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Nested paging requires hardware virtualization.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync CHECK (fCpuNestedPaging IS NULL OR (fCpuNestedPaging <> TRUE OR fCpuHwVirt = TRUE))
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE UNIQUE INDEX TestBoxesUuidIdx ON TestBoxes (uuidSystem, tsExpire);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- F a i l u r e T r a c k i n g
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @table FailureCategories
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Failure categories.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- This is for organizing the failure reasons.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- @remarks This table stores history. Never update or delete anything. The
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- equivalent of deleting is done by setting the 'tsExpire' field to
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- current_timestamp. To select the currently valid entries use
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- tsExpire = TIMESTAMP WITH TIME ZONE 'infinity'.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE SEQUENCE FailureCategoryIdSeq
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync START 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync INCREMENT BY 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MAXVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MINVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync CACHE 1;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TABLE FailureCategories (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The identifier of this failure category (once assigned, it will never change).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idFailureCategory INTEGER DEFAULT NEXTVAL('FailureCategoryIdSeq') NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row starts taking effect (inclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsEffective TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row stops being tsEffective (exclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsExpire TIMESTAMP WITH TIME ZONE DEFAULT TIMESTAMP WITH TIME ZONE 'infinity' NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The user id of the one who created/modified this entry.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: Users(uid)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync uidAuthor INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The short category description.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- For combo boxes and other selection lists.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sShort text NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Full description
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- For cursor-over-poppups for instance.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sFull text NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync PRIMARY KEY (idFailureCategory, tsExpire)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @table FailureReasons
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Failure reasons.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- When analysing a test failure, the testbox sheriff will try assign a fitting
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- reason for the failure. This table is here to help the sheriff in his/hers
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- job as well as developers looking checking if their changes affected the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- test results in any way.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- @remarks This table stores history. Never update or delete anything. The
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- equivalent of deleting is done by setting the 'tsExpire' field to
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- current_timestamp. To select the currently valid entries use
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- tsExpire = TIMESTAMP WITH TIME ZONE 'infinity'.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE SEQUENCE FailureReasonIdSeq
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync START 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync INCREMENT BY 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MAXVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MINVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync CACHE 1;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TABLE FailureReasons (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The identifier of this failure reason (once assigned, it will never change).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idFailureReason INTEGER DEFAULT NEXTVAL('FailureReasonIdSeq') NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row starts taking effect (inclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsEffective TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row stops being tsEffective (exclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsExpire TIMESTAMP WITH TIME ZONE DEFAULT TIMESTAMP WITH TIME ZONE 'infinity' NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The user id of the one who created/modified this entry.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: Users(uid)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync uidAuthor INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The failure category this reason belongs to.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: FailureCategories(idFailureCategory)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idFailureCategory INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The short failure description.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- For combo boxes and other selection lists.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sShort text NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Full failure description.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sFull text NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Ticket number in the primary bugtracker.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync iTicket INTEGER DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Other URLs to reports or discussions of the observed symptoms.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync asUrls text ARRAY DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync PRIMARY KEY (idFailureReason, tsExpire)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE INDEX FailureReasonsCategoryIdx ON FailureReasons (idFailureCategory, idFailureReason);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @table TestResultFailures
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- This is for tracking/discussing test result failures.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- The rational for putting this is a separate table is that we need history on
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- this while TestResults does not.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- @remarks This table stores history. Never update or delete anything. The
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- equivalent of deleting is done by setting the 'tsExpire' field to
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- current_timestamp. To select the currently valid entries use
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- tsExpire = TIMESTAMP WITH TIME ZONE 'infinity'.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TABLE TestResultFailures (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The test result we're disucssing.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- @note The foreign key is declared after TestResults (further down).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestResult INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row starts taking effect (inclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsEffective TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row stops being tsEffective (exclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsExpire TIMESTAMP WITH TIME ZONE DEFAULT TIMESTAMP WITH TIME ZONE 'infinity' NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The user id of the one who created/modified this entry.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: Users(uid)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync uidAuthor INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The suggested failure reason.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: FailureReasons(idFailureReason)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idFailureReason INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Optional comment.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sComment text DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync PRIMARY KEY (idTestResult, tsExpire)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- T e s t I n p u t
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @table BuildBlacklist
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Table used to blacklist sets of builds.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- The best usage example is a VMM developer realizing that a change causes the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- host to panic, hang, or otherwise misbehave. To prevent the testbox sheriff
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- from repeatedly having to reboot testboxes, the builds gets blacklisted
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- until there is a working build again. This may mean adding an open ended
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- blacklist spec and then updating it with the final revision number once the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- fix has been committed.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- @remarks This table stores history. Never update or delete anything. The
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- equivalent of deleting is done by setting the 'tsExpire' field to
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- current_timestamp. To select the currently valid entries use
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- tsExpire = TIMESTAMP WITH TIME ZONE 'infinity'.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- @todo Would be nice if we could replace the text strings below with a set of
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- BuildCategories, or sore it in any other way which would enable us to
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- do a negative join with build category... The way it is specified
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- now, it looks like we have to open a cursor of prospecitve builds and
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- filter then thru this table one by one.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Any better representation is welcome, but this is low prioirty for
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- now, as it's relatively easy to change this later one.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE SEQUENCE BuildBlacklistIdSeq
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync START 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync INCREMENT BY 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MAXVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MINVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync CACHE 1;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TABLE BuildBlacklist (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The blacklist entry id.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- This stays constant over time.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idBlacklisting INTEGER DEFAULT NEXTVAL('BuildBlacklistIdSeq') NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row starts taking effect (inclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsEffective TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row stops being tsEffective (exclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsExpire TIMESTAMP WITH TIME ZONE DEFAULT TIMESTAMP WITH TIME ZONE 'infinity' NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The user id of the one who created/modified this entry.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: Users(uid)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync uidAuthor INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The reason for the blacklisting.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: FailureReasons(idFailureReason)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idFailureReason INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Which product.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- ASSUME that it is okay to limit a blacklisting to a single product.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sProduct text NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Which branch.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- ASSUME that it is okay to limit a blacklisting to a branch.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sBranch text NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Build types to include, all matches if NULL.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync asTypes text ARRAY DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Array of the 'sOs.sCpuArch' to match, all matches if NULL.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- See KBUILD_OSES in kBuild for a list of standard target OSes, and
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- KBUILD_ARCHES for a list of standard architectures.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- @remarks See marks on 'os-agnostic' and 'noarch' in BuildCategories.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync asOsArches text ARRAY DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The first subversion tree revision to blacklist.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync iFirstRevision INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The last subversion tree revision to blacklist, no upper limit if NULL.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync iLastRevision INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync PRIMARY KEY (idBlacklisting, tsExpire)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @table BuildCategories
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Build categories.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- The purpose of this table is saving space in the Builds table and hopefully
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- speed things up when selecting builds as well (compared to selecting on 4
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- text fields in the much larger Builds table).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Insert only table, no update, no delete. History is not needed.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE SEQUENCE BuildCategoryIdSeq
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync START 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync INCREMENT BY 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MAXVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MINVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync CACHE 1;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TABLE BuildCategories (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The build type identifier.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idBuildCategory INTEGER PRIMARY KEY DEFAULT NEXTVAL('BuildCategoryIdSeq') NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Product.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- The product name. For instance 'VBox' or 'VBoxTestSuite'.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sProduct TEXT NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The version control repository name.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sRepository TEXT NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The branch name (in the version control system).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sBranch TEXT NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The build type.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- See KBUILD_BLD_TYPES in kBuild for a list of standard build types.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sType TEXT NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Array of the 'sOs.sCpuArch' supported by the build.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- See KBUILD_OSES in kBuild for a list of standard target OSes, and
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- KBUILD_ARCHES for a list of standard architectures.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- @remarks 'os-agnostic' is used if the build doesn't really target any
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- specific OS or if it targets all applicable OSes.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- 'noarch' is used if the build is architecture independent or if
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- all applicable architectures are handled.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Thus, 'os-agnostic.noarch' will run on all build boxes.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- @note The array shall be sorted ascendingly to prevent unnecessary duplicates!
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync asOsArches TEXT ARRAY NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync UNIQUE (sProduct, sRepository, sBranch, sType, asOsArches)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @table Builds
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- The builds table contains builds from the tinderboxes and oaccasionally from
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- developers.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- The tinderbox side could be fed by a batch job enumerating the build output
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- directories every so often, looking for new builds. Or we could query them
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- from the tinderbox database. Yet another alternative is making the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- tinderbox server or client side software inform us about all new builds.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- The developer builds are entered manually thru the TM web UI. They are used
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- for subjecting new code to some larger scale testing before commiting,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- enabling, or merging a private branch.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- The builds are being selected from this table by the via the build source
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- specification that SchedGroups.idBuildSrc and
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- SchedGroups.idBuildSrcTestSuite links to.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- @remarks This table stores history. Never update or delete anything. The
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- equivalent of deleting is done by setting the 'tsExpire' field to
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- current_timestamp. To select the currently valid entries use
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- tsExpire = TIMESTAMP WITH TIME ZONE 'infinity'.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE SEQUENCE BuildIdSeq
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync START 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync INCREMENT BY 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MAXVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MINVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync CACHE 1;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TABLE Builds (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The build identifier.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- This remains unchanged
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idBuild INTEGER DEFAULT NEXTVAL('BuildIdSeq') NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this build was created or entered into the database.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- This remains unchanged
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsCreated TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row starts taking effect (inclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsEffective TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this row stops being tsEffective (exclusive).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsExpire TIMESTAMP WITH TIME ZONE DEFAULT TIMESTAMP WITH TIME ZONE 'infinity' NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The user id of the one who created/modified this entry.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: Users(uid)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- @note This is NULL if added by a batch job / tinderbox.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync uidAuthor INTEGER DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The build category.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idBuildCategory INTEGER REFERENCES BuildCategories(idBuildCategory) NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The subversion tree revision of the build.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync iRevision INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The product version number (suitable for RTStrVersionCompare).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sVersion TEXT NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The link to the tinderbox log of this build.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sLogUrl TEXT,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Comma separated list of binaries.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- The binaries have paths relative to the TESTBOX_PATH_BUILDS or full URLs.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sBinaries TEXT NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Set when the binaries gets deleted by the build quota script.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync fBinariesDeleted BOOLEAN DEFAULT FALSE NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync UNIQUE (idBuild, tsExpire)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE INDEX BuildsLookupIdx ON Builds (idBuildCategory, iRevision);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @table VcsRevisions
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- This table is for translating build revisions into commit details.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- For graphs and test results, it would be useful to translate revisions into
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- dates and maybe provide commit message and the committer.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Data is entered exclusively thru one or more batch jobs, so no internal
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- authorship needed. Also, since we're mirroring data from external sources
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- here, the batch job is allowed to update/replace existing records.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- @todo We we could collect more info from the version control systems, if we
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- believe it's useful and can be presented in a reasonable manner.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Getting a list of affected files would be simple (requires
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- a separate table with a M:1 relationship to this table), or try
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- associate a commit to a branch.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TABLE VcsRevisions (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The version control tree name.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sRepository TEXT NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The version control tree revision number.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync iRevision INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When the revision was created (committed).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsCreated TIMESTAMP WITH TIME ZONE NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The name of the committer.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- @note Not to be confused with uidAuthor and test manager users.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sAuthor TEXT,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The commit message.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sMessage TEXT,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync UNIQUE (sRepository, iRevision)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- T e s t R e s u l t s
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @table TestResultStrTab
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- String table for the test results.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- This is a string cache for value names, test names and possible more, that
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- is frequently repated in the test results record for each test run. The
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- purpose is not only to save space, but to make datamining queries faster by
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- giving them integer fields to work on instead of text fields. There may
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- possibly be some benefits on INSERT as well as there are only integer
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- indexes.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Nothing is ever deleted from this table.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- @note Should use a stored procedure to query/insert a string.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE SEQUENCE TestResultStrTabIdSeq
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync START 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync INCREMENT BY 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MAXVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MINVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync CACHE 1;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TABLE TestResultStrTab (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The ID of this string.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idStr INTEGER PRIMARY KEY DEFAULT NEXTVAL('TestResultStrTabIdSeq'),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The string value.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sValue text NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Creation time stamp.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsCreated TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp NOT NULL
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE UNIQUE INDEX TestResultStrTabNameIdx ON TestResultStrTab (sValue);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- Empty string with ID 0.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncINSERT INTO TestResultStrTab (idStr, sValue) VALUES (0, '');
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @type TestStatus_T
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- The status of a test (set / result).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TYPE TestStatus_T AS ENUM (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Initial status:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'running',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Final statuses:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'success',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Final status: Test didn't fail as such, it was something else.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'skipped',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'bad-testbox',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'aborted',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Final status: Test failed.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'failure',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'timed-out',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'rebooted'
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @table TestResults
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Test results - a recursive bundle of joy!
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- A test case will be created when the testdriver calls reporter.testStart and
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- concluded with reporter.testDone. The testdriver (or it subordinates) can
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- use these methods to create nested test results. For IPRT based test cases,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- RTTestCreate, RTTestInitAndCreate and RTTestSub will both create new test
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- result records, where as RTTestSubDone, RTTestSummaryAndDestroy and
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- RTTestDestroy will conclude records.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- By concluding is meant updating the status. When the test driver reports
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- success, we check it against reported results. (paranoia strikes again!)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Nothing is ever deleted from this table.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- @note As seen below, several other tables associate data with a
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- test result, and the top most test result is referenced by the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- test set.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE SEQUENCE TestResultIdSeq
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync START 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync INCREMENT BY 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MAXVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MINVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync CACHE 1;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TABLE TestResults (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The ID of this test result.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestResult INTEGER PRIMARY KEY DEFAULT NEXTVAL('TestResultIdSeq'),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The parent test result.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- This is NULL for the top test result.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestResultParent INTEGER REFERENCES TestResults(idTestResult),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The testsest this result is a part of.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Note! This is a foreign key, but we have to add it after TestSets has
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- been created, see further down.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestSet INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Creation time stamp. This may also be the timestamp of when the test started.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsCreated TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The elapsed time for this test.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- This is either reported by the directly (with some sanity checking) or
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- calculated (current_timestamp - created_ts).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- @todo maybe use a nanosecond field here, check with what
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsElapsed interval DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The test name.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idStrName INTEGER REFERENCES TestResultStrTab(idStr) NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The error count.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync cErrors INTEGER DEFAULT 0 NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The test status.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync enmStatus TestStatus_T DEFAULT 'running'::TestStatus_T NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Nesting depth.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync iNestingDepth smallint NOT NULL CHECK (iNestingDepth >= 0 AND iNestingDepth < 16),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Make sure errors and status match up.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync CONSTRAINT CheckStatusMatchesErrors
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync CHECK ( (cErrors > 0 AND enmStatus IN ('running'::TestStatus_T,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'failure'::TestStatus_T, 'timed-out'::TestStatus_T, 'rebooted'::TestStatus_T ))
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync OR (cErrors = 0 AND enmStatus IN ('running'::TestStatus_T, 'success'::TestStatus_T,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'skipped'::TestStatus_T, 'aborted'::TestStatus_T, 'bad-testbox'::TestStatus_T))
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync )
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE INDEX TestResultsSetIdx ON TestResults (idTestSet, idStrName, idTestResult);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE INDEX TestResultsParentIdx ON TestResults (idTestResultParent);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- The TestResultsNameIdx is for speeding up the result graph & reporting code.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE INDEX TestResultsNameIdx ON TestResults (idStrName, idTestResult, tsCreated);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncALTER TABLE TestResultFailures
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ADD CONSTRAINT idTestResultFk FOREIGN KEY (idTestResult) REFERENCES TestResults(idTestResult) MATCH FULL;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @table TestResultValues
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Test result values.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- A testdriver or subordinate may report a test value via
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- reporter.testValue(), while IPRT based test will use RTTestValue and
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- associates.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- This is an insert only table, no deletes, no updates.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE SEQUENCE TestResultValueIdSeq
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync START 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync INCREMENT BY 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MAXVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MINVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync CACHE 1;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TABLE TestResultValues (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The ID of this value.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestResultValue INTEGER PRIMARY KEY DEFAULT NEXTVAL('TestResultValueIdSeq'),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The test result it was reported within.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestResult INTEGER REFERENCES TestResults(idTestResult) NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The test result it was reported within.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Note! This is a foreign key, but we have to add it after TestSets has
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- been created, see further down.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestSet INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Creation time stamp.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsCreated TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The name.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idStrName INTEGER REFERENCES TestResultStrTab(idStr) NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The value.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync lValue bigint NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The unit.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- @todo This is currently not defined properly. Will fix/correlate this
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- with the other places we use unit (IPRT/testdriver/VMMDev).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync iUnit smallint NOT NULL CHECK (iUnit >= 0 AND iUnit < 1024)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE INDEX TestResultValuesIdx ON TestResultValues(idTestResult);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- The TestResultValuesGraphIdx is for speeding up the result graph & reporting code.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE INDEX TestResultValuesGraphIdx ON TestResultValues(idStrName, tsCreated);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @table TestResultFiles
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Test result files.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- A testdriver or subordinate may report a file by using
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- reporter.addFile() or reporter.addLogFile().
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- The files stored here as well as the primary log file will be processed by a
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- batch job and compressed if considered compressable. Thus, TM will look for
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- files with a .gz/.bz2 suffix first and then without a suffix.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- This is an insert only table, no deletes, no updates.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE SEQUENCE TestResultFileId
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync START 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync INCREMENT BY 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MAXVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MINVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync CACHE 1;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TABLE TestResultFiles (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The ID of this file.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestResultFile INTEGER PRIMARY KEY DEFAULT NEXTVAL('TestResultFileId'),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The test result it was reported within.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestResult INTEGER REFERENCES TestResults(idTestResult) NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Creation time stamp.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsCreated TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The filename relative to TestSets(sBaseFilename) + '-'.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- The set of valid filename characters should be very limited so that no
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- file system issues can occure either on the TM side or the user when
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- loading the files. Tests trying to use other characters will fail.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Valid character regular expession: '^[a-zA-Z0-9_-(){}#@+,.=]*$'
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idStrFile INTEGER REFERENCES TestResultStrTab(idStr) NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The description.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idStrDescription INTEGER REFERENCES TestResultStrTab(idStr) NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The kind of file.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- For instance: 'log/release/vm',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- 'screenshot/failure',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- 'screencapture/failure',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- 'xmllog/somestuff'
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idStrKind INTEGER REFERENCES TestResultStrTab(idStr) NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The mime type for the file.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- For instance: 'text/plain',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- 'image/png',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- 'video/webm',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- 'text/xml'
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idStrMime INTEGER REFERENCES TestResultStrTab(idStr) NOT NULL
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE INDEX TestResultFilesIdx ON TestResultFiles(idTestResult);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @table TestResultMsgs
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Test result message.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- A testdriver or subordinate may report a message via the sDetails parameter
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- of the reporter.testFailure() method, while IPRT test cases will use
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- RTTestFailed, RTTestPrintf and their friends. For RTTestPrintf, we will
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- ignore the more verbose message levels since these can also be found in one
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- of the logs.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- This is an insert only table, no deletes, no updates.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TYPE TestResultMsgLevel_T AS ENUM (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'failure',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'info'
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE SEQUENCE TestResultMsgIdSeq
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync START 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync INCREMENT BY 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MAXVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MINVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync CACHE 1;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TABLE TestResultMsgs (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The ID of this file.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestResultMsg INTEGER PRIMARY KEY DEFAULT NEXTVAL('TestResultMsgIdSeq'),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The test result it was reported within.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestResult INTEGER REFERENCES TestResults(idTestResult) NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Creation time stamp.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsCreated TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The message string.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idStrMsg INTEGER REFERENCES TestResultStrTab(idStr) NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The message level.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync enmLevel TestResultMsgLevel_T NOT NULL
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE INDEX TestResultMsgsIdx ON TestResultMsgs(idTestResult);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @table TestSets
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Test sets / Test case runs.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- This is where we collect data about test runs.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- @todo Not entirely sure where the 'test set' term came from. Consider
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- finding something more appropriate.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE SEQUENCE TestSetIdSeq
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync START 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync INCREMENT BY 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MAXVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MINVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync CACHE 1;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TABLE TestSets (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The ID of this test set.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestSet INTEGER PRIMARY KEY DEFAULT NEXTVAL('TestSetIdSeq') NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The test config timestamp, used when reading test config.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsConfig TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this test set was scheduled.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- idGenTestBox is valid at this point.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsCreated TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this test completed, i.e. testing stopped. This should only be set once.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsDone TIMESTAMP WITH TIME ZONE DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The current status.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync enmStatus TestStatus_T DEFAULT 'running'::TestStatus_T NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The build we're testing.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: Builds(idBuild)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idBuild INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The build category of idBuild when the test started.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- This is for speeding up graph data collection, i.e. avoid idBuild
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- the WHERE part of the selection.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idBuildCategory INTEGER REFERENCES BuildCategories(idBuildCategory) NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The test suite build we're using to do the testing.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- This is NULL if the test suite zip wasn't referred or if a test suite
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- build source wasn't configured.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: Builds(idBuild)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idBuildTestSuite INTEGER DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The exact testbox configuration.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idGenTestBox INTEGER REFERENCES TestBoxes(idGenTestBox) NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The testbox ID for joining with (valid: tsStarted).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: TestBoxes(idTestBox)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestBox INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The testgroup (valid: tsConfig).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: TestBoxes(idTestGroup)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Note! This also gives the member ship entry, since a testcase can only
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- have one membership per test group.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestGroup INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The exact test case config we executed in this test run.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idGenTestCase INTEGER REFERENCES TestCases(idGenTestCase) NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The test case ID for joining with (valid: tsConfig).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: TestBoxes(idTestCase)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestCase INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The arguments (and requirements++) we executed this test case with.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idGenTestCaseArgs INTEGER REFERENCES TestCaseArgs(idGenTestCaseArgs) NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The argument variation ID (valid: tsConfig).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: TestCaseArgs(idTestCaseArgs)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestCaseArgs INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The root of the test result tree.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- @note This will only be NULL early in the transaction setting up the testset.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- @note If the test reports more than one top level test result, we'll
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- fail the whole test run and let the test developer fix it.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestResult INTEGER REFERENCES TestResults(idTestResult) DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The base filename used for storing files related to this test set.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- This is a path relative to wherever TM is dumping log files. In order
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- to not become a file system test case, we will try not to put too many
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- hundred thousand files in a directory. A simple first approach would
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- be to just use the current date (tsCreated) like this:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- TM_FILE_DIR/year/month/day/TestSets.idTestSet
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- The primary log file for the test is this name suffixed by '.log'.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- The files in the testresultfile table gets their full names like this:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- TM_FILE_DIR/sBaseFilename-testresultfile.id-TestResultStrTab(testresultfile.idStrFilename)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- @remarks We store this explicitly in case we change the directly layout
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- at some later point.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sBaseFilename text UNIQUE NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The gang member number number, 0 is the leader.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync iGangMemberNo SMALLINT DEFAULT 0 NOT NULL CHECK (iGangMemberNo >= 0 AND iGangMemberNo < 1024),
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The test set of the gang leader, NULL if no gang involved.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- @note This is set by the gang leader as well, so that we can find all
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- gang members by WHERE idTestSetGangLeader = :id.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestSetGangLeader INTEGER REFERENCES TestSets(idTestSet) DEFAULT NULL
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE INDEX TestSetsGangIdx ON TestSets (idTestSetGangLeader);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE INDEX TestSetsBoxIdx ON TestSets (idTestBox, idTestResult);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE INDEX TestSetsBuildIdx ON TestSets (idBuild, idTestResult);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE INDEX TestSetsTestCaseIdx ON TestSets (idTestCase, idTestResult);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE INDEX TestSetsTestVarIdx ON TestSets (idTestCaseArgs, idTestResult);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- The TestSetCreatedDone is for testbox results, graph options and such.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE INDEX TestSetsCreatedDoneIdx ON TestSets (tsCreated, tsDone);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- For graphs.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE INDEX TestSetsGraphBoxIdx ON TestSets (idTestBox, tsCreated, tsDone, idBuildCategory, idTestCase);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncALTER TABLE TestResults ADD FOREIGN KEY (idTestSet) REFERENCES TestSets(idTestSet) MATCH FULL;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncALTER TABLE TestResultValues ADD FOREIGN KEY (idTestSet) REFERENCES TestSets(idTestSet) MATCH FULL;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- T e s t M a n g e r P e r s i s t e n t S t o r a g e
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @type TestBoxState_T
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- TestBox state.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- @todo Consider drawing a state diagram for this.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TYPE TestBoxState_T AS ENUM (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Nothing to do.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Prev: testing, gang-cleanup, rebooting, upgrading,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- upgrading-and-rebooting, doing-special-cmd.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Next: testing, gang-gathering, rebooting, upgrading,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- upgrading-and-rebooting, doing-special-cmd.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'idle',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Executing a test.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Prev: idle
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Next: idle
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'testing',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Gang scheduling statuses:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The gathering of a gang.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Prev: idle
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Next: gang-gathering-timedout, gang-testing
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'gang-gathering',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The gathering timed out, the testbox needs to cleanup and move on.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Prev: gang-gathering
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Next: idle
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- This is set on all gathered members by the testbox who triggers the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- timeout.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'gang-gathering-timedout',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The gang scheduling equivalent of 'testing'.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Prev: gang-gathering
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Next: gang-cleanup
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'gang-testing',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Waiting for the other gang members to stop testing so that cleanups
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- can be performed and members safely rescheduled.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Prev: gang-testing
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Next: idle
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- There are two resource clean up issues being targeted here:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- 1. Global resources will be allocated by the leader when he enters the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- 'gang-gathering' state. If the leader quits and frees the resource
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- while someone is still using it, bad things will happen. Imagine a
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- global resource without any access checks and relies exclusivly on
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- the TM doing its job.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- 2. TestBox resource accessed by other gang members may also be used in
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- other tests. Should a gang member leave early and embark on a
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- testcase using the same resources, bad things will happen. Example:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Live migration. One partner leaves early because it detected some
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- fatal failure, the other one is still trying to connect to him.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- The testbox is scheduled again on the same live migration testcase,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- only with different arguments (VM config), it will try migrate using
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- the same TCP ports. Confusion ensues.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- To figure out whether to remain in this status because someone is
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- still testing:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- SELECT COUNT(*) FROM TestBoxStatuses, TestSets
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- WHERE TestSets.idTestSetGangLeader = :idGangLeader
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- AND TestSets.idTestBox = TestBoxStatuses.idTestBox
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- AND TestSets.idTestSet = TestBoxStatuses.idTestSet
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- AND TestBoxStatuses.enmState = 'gang-testing'::TestBoxState_T;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'gang-cleanup',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Command related statuses (all command status changes comes from 'idle'
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- and goes back to 'idle'):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'rebooting',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'upgrading',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'upgrading-and-rebooting',
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'doing-special-cmd'
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @table TestBoxStatuses
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Testbox status table.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- History is not planned on this table.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TABLE TestBoxStatuses (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The testbox.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestBox INTEGER PRIMARY KEY NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The testbox generation ID.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idGenTestBox INTEGER REFERENCES TestBoxes(idGenTestBox) NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this status was last updated.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- This is updated everytime the testbox talks to the test manager, thus it
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- can easily be used to find testboxes which has stopped responding.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- This is used for timeout calculation during gang-gathering, so in that
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- scenario it won't be updated until the gang is gathered or we time out.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsUpdated TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The current state.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync enmState TestBoxState_T DEFAULT 'idle'::TestBoxState_T NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Reference to the test set
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestSet INTEGER REFERENCES TestSets(idTestSet)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @table GlobalResourceStatuses
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Global resource status, tracks which test set resources are allocated by.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- History is not planned on this table.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TABLE GlobalResourceStatuses (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The resource ID.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: GlobalResources(idGlobalRsrc).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idGlobalRsrc INTEGER PRIMARY KEY NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The resource owner.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- @note This is going thru testboxstatus to be able to use the testbox ID
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- as a foreign key.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestBox INTEGER REFERENCES TestBoxStatuses(idTestBox) NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When the allocation took place.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsAllocated TIMESTAMP WITH TIME ZONE DEFAULT current_timestamp NOT NULL
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--- @table SchedQueues
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Scheduler queue.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- The queues are currently associated with a scheduling group, it could
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- alternative be changed to hook on to a testbox instead. It depends on what
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- kind of scheduling method we prefer. The former method aims at test case
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- thruput, making sacrifices in the hardware distribution area. The latter is
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- more like the old buildbox style testing, making sure that each test case is
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- executed on each testbox.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- When there are configuration changes, TM will regenerate the scheduling
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- queue for the affected scheduling groups. We do not concern ourselves with
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- trying to continue at the approximately same queue position, we simply take
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- it from the top.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- When a testbox ask for work, we will open a cursor on the queue and take the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- first test in the queue that can be executed on that testbox. The test will
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- be moved to the end of the queue (getting a new item_id).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- If a test is manually changed to the head of the queue, the item will get a
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- item_id which is 1 lower than the head of the queue. Unless someone does
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- this a couple of billion times, we shouldn't have any trouble running out of
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- number space. :-)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- Manually moving a test to the end of the queue is easy, just get a new
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- 'item_id'.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync-- History is not planned on this table.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync--
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE SEQUENCE SchedQueueItemIdSeq
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync START 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync INCREMENT BY 1
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MAXVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync NO MINVALUE
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync CACHE 1;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCREATE TABLE SchedQueues (
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The scheduling queue (one queue per scheduling group).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: SchedGroups(idSchedGroup)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idSchedGroup INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The scheduler queue entry ID.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Lower numbers means early queue position.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idItem INTEGER DEFAULT NEXTVAL('SchedQueueItemIdSeq') NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The queue offset.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- This is used for repositining the queue when recreating it. It can also
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- be used to figure out how jumbled the queue gets after real life has had
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- it's effect on it.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync offQueue INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The test case argument variation to execute.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idGenTestCaseArgs INTEGER REFERENCES TestCaseArgs(idGenTestCaseArgs) NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The relevant testgroup.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: TestGroups(idTestGroup).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestGroup INTEGER NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- Aggregated test group dependencies (NULL if none).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- Non-unique foreign key: TestGroups(idTestGroup).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- See also comments on SchedGroupMembers.idTestGroupPreReq.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync aidTestGroupPreReqs INTEGER ARRAY DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The scheduling time constraints (see SchedGroupMembers.bmHourlySchedule).
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync bmHourlySchedule bit(168) DEFAULT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When the queue entry was created and for which config is valid.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- This is the timestamp that should be used when reading config info.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsConfig TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- When this status was last scheduled.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- This is set to current_timestamp when moving the entry to the end of the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- queue. It's initial value is unix-epoch. Not entirely sure if it's
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- useful beyond introspection and non-unique foreign key hacking.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync tsLastScheduled TIMESTAMP WITH TIME ZONE DEFAULT TIMESTAMP WITH TIME ZONE 'epoch' NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- This is used in gang scheduling.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync idTestSetGangLeader INTEGER REFERENCES TestSets(idTestSet) DEFAULT NULL UNIQUE,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --- The number of gang members still missing.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- This saves calculating the number of missing members via selects like:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- SELECT COUNT(*) FROM TestSets WHERE idTestSetGangLeader = :idGang;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- and
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- SELECT cGangMembers FROM TestCaseArgs WHERE idGenTestCaseArgs = :idTest;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync -- to figure out whether to remain in 'gather-gang'::TestBoxState_T.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync --
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync cMissingGangMembers smallint DEFAULT 1 NOT NULL,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync PRIMARY KEY (idSchedGroup, idItem)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync