1 | #!/usr/bin/env python
|
---|
2 | # -*- coding: utf-8 -*-
|
---|
3 | # $Id: tdExoticOrAncient1.py 76553 2019-01-01 01:45:53Z vboxsync $
|
---|
4 |
|
---|
5 | """
|
---|
6 | VirtualBox Validation Kit - Exotic and/or ancient OSes #1.
|
---|
7 | """
|
---|
8 |
|
---|
9 | __copyright__ = \
|
---|
10 | """
|
---|
11 | Copyright (C) 2010-2019 Oracle Corporation
|
---|
12 |
|
---|
13 | This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
14 | available from http://www.virtualbox.org. This file is free software;
|
---|
15 | you can redistribute it and/or modify it under the terms of the GNU
|
---|
16 | General Public License (GPL) as published by the Free Software
|
---|
17 | Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
18 | VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
19 | hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
20 |
|
---|
21 | The contents of this file may alternatively be used under the terms
|
---|
22 | of the Common Development and Distribution License Version 1.0
|
---|
23 | (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
24 | VirtualBox OSE distribution, in which case the provisions of the
|
---|
25 | CDDL are applicable instead of those of the GPL.
|
---|
26 |
|
---|
27 | You may elect to license modified versions of this file under the
|
---|
28 | terms and conditions of either the GPL or the CDDL or both.
|
---|
29 | """
|
---|
30 | __version__ = "$Revision: 76553 $"
|
---|
31 |
|
---|
32 |
|
---|
33 | # Standard Python imports.
|
---|
34 | import os;
|
---|
35 | import sys;
|
---|
36 |
|
---|
37 | # Only the main script needs to modify the path.
|
---|
38 | try: __file__
|
---|
39 | except: __file__ = sys.argv[0];
|
---|
40 | g_ksValidationKitDir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))));
|
---|
41 | sys.path.append(g_ksValidationKitDir);
|
---|
42 |
|
---|
43 | # Validation Kit imports.
|
---|
44 | from testdriver import reporter;
|
---|
45 | from testdriver import vbox;
|
---|
46 |
|
---|
47 |
|
---|
48 | class tdExoticOrAncient1(vbox.TestDriver):
|
---|
49 | """
|
---|
50 | VBox exotic and/or ancient OSes #1.
|
---|
51 | """
|
---|
52 |
|
---|
53 | def __init__(self):
|
---|
54 | vbox.TestDriver.__init__(self);
|
---|
55 | self.asRsrcs = None;
|
---|
56 | self.oTestVmSet = self.oTestVmManager.selectSet( self.oTestVmManager.kfGrpAncient
|
---|
57 | | self.oTestVmManager.kfGrpExotic);
|
---|
58 |
|
---|
59 | #
|
---|
60 | # Overridden methods.
|
---|
61 | #
|
---|
62 | def showUsage(self):
|
---|
63 | rc = vbox.TestDriver.showUsage(self);
|
---|
64 | return rc;
|
---|
65 |
|
---|
66 | def parseOption(self, asArgs, iArg):
|
---|
67 | return vbox.TestDriver.parseOption(self, asArgs, iArg);
|
---|
68 |
|
---|
69 | def actionVerify(self):
|
---|
70 | if self.sVBoxValidationKitIso is None or not os.path.isfile(self.sVBoxValidationKitIso):
|
---|
71 | reporter.error('Cannot find the VBoxValidationKit.iso! (%s)'
|
---|
72 | 'Please unzip a Validation Kit build in the current directory or in some parent one.'
|
---|
73 | % (self.sVBoxValidationKitIso,) );
|
---|
74 | return False;
|
---|
75 | return vbox.TestDriver.actionVerify(self);
|
---|
76 |
|
---|
77 | def actionConfig(self):
|
---|
78 | # Make sure vboxapi has been imported so we can use the constants.
|
---|
79 | if not self.importVBoxApi():
|
---|
80 | return False;
|
---|
81 |
|
---|
82 | assert self.sVBoxValidationKitIso is not None;
|
---|
83 | return self.oTestVmSet.actionConfig(self, sDvdImage = self.sVBoxValidationKitIso);
|
---|
84 |
|
---|
85 | def actionExecute(self):
|
---|
86 | """
|
---|
87 | Execute the testcase.
|
---|
88 | """
|
---|
89 | return self.oTestVmSet.actionExecute(self, self.testOneVmConfig)
|
---|
90 |
|
---|
91 |
|
---|
92 | #
|
---|
93 | # Test execution helpers.
|
---|
94 | #
|
---|
95 |
|
---|
96 | def testOneVmConfig(self, oVM, oTestVm):
|
---|
97 | """
|
---|
98 | Runs the specified VM thru test #1.
|
---|
99 | """
|
---|
100 |
|
---|
101 | # Simple test.
|
---|
102 | self.logVmInfo(oVM);
|
---|
103 | if oTestVm.fGrouping & self.oTestVmManager.kfGrpNoTxs:
|
---|
104 | sResult = self.runVmAndMonitorComRawFile(oTestVm.sVmName, oTestVm.sCom1RawFile);
|
---|
105 | return sResult == 'PASSED';
|
---|
106 | oSession, _ = self.startVmAndConnectToTxsViaTcp(oTestVm.sVmName, fCdWait = True);
|
---|
107 | if oSession is not None:
|
---|
108 | return self.terminateVmBySession(oSession);
|
---|
109 | return False;
|
---|
110 |
|
---|
111 | if __name__ == '__main__':
|
---|
112 | sys.exit(tdExoticOrAncient1().main(sys.argv));
|
---|
113 |
|
---|