testbox.py revision cf22150eaeeb72431bf1cf65c309a431454fb22b
20593760b116c90f3e439552763eef632a3bbb17vboxsync# -*- coding: utf-8 -*-
20593760b116c90f3e439552763eef632a3bbb17vboxsyncTest Manager - TestBox.
20593760b116c90f3e439552763eef632a3bbb17vboxsyncCopyright (C) 2012-2014 Oracle Corporation
20593760b116c90f3e439552763eef632a3bbb17vboxsyncThis file is part of VirtualBox Open Source Edition (OSE), as
20593760b116c90f3e439552763eef632a3bbb17vboxsyncavailable from http://www.virtualbox.org. This file is free software;
20593760b116c90f3e439552763eef632a3bbb17vboxsyncyou can redistribute it and/or modify it under the terms of the GNU
20593760b116c90f3e439552763eef632a3bbb17vboxsyncGeneral Public License (GPL) as published by the Free Software
20593760b116c90f3e439552763eef632a3bbb17vboxsyncFoundation, in version 2 as it comes in the "COPYING" file of the
20593760b116c90f3e439552763eef632a3bbb17vboxsyncVirtualBox OSE distribution. VirtualBox OSE is distributed in the
20593760b116c90f3e439552763eef632a3bbb17vboxsynchope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
20593760b116c90f3e439552763eef632a3bbb17vboxsyncThe contents of this file may alternatively be used under the terms
20593760b116c90f3e439552763eef632a3bbb17vboxsyncof the Common Development and Distribution License Version 1.0
20593760b116c90f3e439552763eef632a3bbb17vboxsync(CDDL) only, as it comes in the "COPYING.CDDL" file of the
20593760b116c90f3e439552763eef632a3bbb17vboxsyncVirtualBox OSE distribution, in which case the provisions of the
20593760b116c90f3e439552763eef632a3bbb17vboxsyncCDDL are applicable instead of those of the GPL.
20593760b116c90f3e439552763eef632a3bbb17vboxsyncYou may elect to license modified versions of this file under the
20593760b116c90f3e439552763eef632a3bbb17vboxsyncterms and conditions of either the GPL or the CDDL or both.
aa4bcf0a4b2db3ac352b56a291d49cb8d4b66d32vboxsync# Standard python imports.
20593760b116c90f3e439552763eef632a3bbb17vboxsync# Validation Kit imports.
20593760b116c90f3e439552763eef632a3bbb17vboxsyncfrom testmanager.core.base import ModelDataBase, ModelDataBaseTestCase, ModelLogicBase, TMExceptionBase, \
20593760b116c90f3e439552763eef632a3bbb17vboxsync# pylint: disable=C0103
ea9fe8748652b3e7b3f1245001f9d7cd8c9eaaccvboxsyncclass TestBoxData(ModelDataBase): # pylint: disable=R0902
20593760b116c90f3e439552763eef632a3bbb17vboxsync TestBox Data.
0c8eec6f5b79d800c3d25b5c0e0d7ad3f867c25cvboxsync ## LomKind_T
20593760b116c90f3e439552763eef632a3bbb17vboxsync kasLomKindValues = [ ksLomKind_None, ksLomKind_ILOM, ksLomKind_ELOM, ksLomKind_AppleXserveLom];
ea9fe8748652b3e7b3f1245001f9d7cd8c9eaaccvboxsync ( ksLomKind_AppleXserveLom, 'Apple Xserve LOM', ''),
20593760b116c90f3e439552763eef632a3bbb17vboxsync ## TestBoxCmd_T
e86538a7bc028e823f16f8982e90f0c7ef5d4ecevboxsync ksTestBoxCmd_UpgradeAndReboot = 'upgrade-and-reboot';
20593760b116c90f3e439552763eef632a3bbb17vboxsync kasTestBoxCmdValues = [ ksTestBoxCmd_None, ksTestBoxCmd_Abort, ksTestBoxCmd_Reboot, ksTestBoxCmd_Upgrade,
20593760b116c90f3e439552763eef632a3bbb17vboxsync ksTestBoxCmd_UpgradeAndReboot, ksTestBoxCmd_Special];
20593760b116c90f3e439552763eef632a3bbb17vboxsync ( ksTestBoxCmd_Upgrade, 'Upgrade TestBox Script', ''),
20593760b116c90f3e439552763eef632a3bbb17vboxsync ( ksTestBoxCmd_UpgradeAndReboot, 'Upgrade TestBox Script and reboot', ''),
e9525bea57dc13d82fd3392913aebb33d2cb79e3vboxsync ksParam_pctScaleTimeout = 'TestBox_pctScaleTimeout';
aa4bcf0a4b2db3ac352b56a291d49cb8d4b66d32vboxsync ksParam_fCpuNestedPaging = 'TestBox_fCpuNestedPaging';
20593760b116c90f3e439552763eef632a3bbb17vboxsync ksParam_iTestBoxScriptRev = 'TestBox_iTestBoxScriptRev';
20593760b116c90f3e439552763eef632a3bbb17vboxsync ksParam_iPythonHexVersion = 'TestBox_iPythonHexVersion';
20593760b116c90f3e439552763eef632a3bbb17vboxsync kasAllowNullAttributes = ['idTestBox', 'tsEffective', 'tsExpire', 'uidAuthor', 'idGenTestBox', 'sDescription',
20593760b116c90f3e439552763eef632a3bbb17vboxsync 'ipLom', 'sOs', 'sOsVersion', 'sCpuVendor', 'sCpuArch', 'sCpuName', 'lCpuRevision', 'cCpus',
20593760b116c90f3e439552763eef632a3bbb17vboxsync 'fCpuHwVirt', 'fCpuNestedPaging', 'fCpu64BitGuest', 'fChipsetIoMmu', 'cMbMemory',
20593760b116c90f3e439552763eef632a3bbb17vboxsync 'cMbScratch', 'sReport', 'iTestBoxScriptRev', 'iPythonHexVersion' ];
20593760b116c90f3e439552763eef632a3bbb17vboxsync kasValidValues_enmPendingCmd = kasTestBoxCmdValues;
a18faae7b59910c9f2da2886ac10d7f31e29cd83vboxsync # Initialize with defaults.
a18faae7b59910c9f2da2886ac10d7f31e29cd83vboxsync # See the database for explanations of each of these fields.
if aoRow is None:
return self;
if aoRow is None:
raise TMExceptionBase('idTestBox=%s not found (tsNow=%s sPeriodBack=%s)' % (idTestBox, tsNow, sPeriodBack,));
, (idGenTestBox, ) );
return dErrors;
(sTestBoxUuid,));
return oData;
if tsNow is None:
aoRows = [];
return aoRows;
if tsNow is None:
aoRows = [];
aoEntries = [];
aoChanges = [];
aoEntries.append(ChangeLogEntry(oNew.uidAuthor, sAuthor, oNew.tsEffective, oNew.tsExpire, oNew, oOld, aoChanges));
aoEntries.append(ChangeLogEntry(oNew.uidAuthor, aoRows[-1][1], oNew.tsEffective, oNew.tsExpire, oNew, None, []));
, (uidAuthor,
, (tsEffective,
if aRow is None:
def updateOnSignOn(self, idTestBox, idGenTestBox, sTestBoxAddr, sOs, sOsVersion, # pylint: disable=R0913,R0914
(idGenTestBox,));
, (idTestBox,
sOs,
return idGenTestBox;
, (idTestBox,
aoRet = []
return aoRet
if tsExpire is None:
return True;
_ = fCascade;
if fRc:
return fRc