1 | #!/usr/bin/env python
|
---|
2 | # -*- coding: utf-8 -*-
|
---|
3 | # $Id: tdApi1.py 72732 2018-06-29 06:53:30Z vboxsync $
|
---|
4 |
|
---|
5 | """
|
---|
6 | VirtualBox Validation Kit - API Test wrapper #1 combining all API sub-tests
|
---|
7 | """
|
---|
8 |
|
---|
9 | __copyright__ = \
|
---|
10 | """
|
---|
11 | Copyright (C) 2010-2017 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: 72732 $"
|
---|
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 vbox
|
---|
45 |
|
---|
46 |
|
---|
47 | class tdApi1(vbox.TestDriver):
|
---|
48 | """
|
---|
49 | API Test wrapper #1.
|
---|
50 | """
|
---|
51 |
|
---|
52 | def __init__(self, aSubTestDrivers = None):
|
---|
53 | vbox.TestDriver.__init__(self)
|
---|
54 | self.asRsrcs = None;
|
---|
55 | for oSubTestDriverClass in aSubTestDrivers:
|
---|
56 | self.addSubTestDriver(oSubTestDriverClass(self));
|
---|
57 |
|
---|
58 | #
|
---|
59 | # Overridden methods.
|
---|
60 | #
|
---|
61 |
|
---|
62 | def getResourceSet(self):
|
---|
63 | if self.asRsrcs is None:
|
---|
64 | self.asRsrcs = [];
|
---|
65 | for oSubTstDrv in self.aoSubTstDrvs:
|
---|
66 | self.asRsrcs.extend(oSubTstDrv.asRsrcs);
|
---|
67 | return self.asRsrcs;
|
---|
68 |
|
---|
69 | def actionConfig(self):
|
---|
70 | """
|
---|
71 | Import the API.
|
---|
72 | """
|
---|
73 | if not self.importVBoxApi():
|
---|
74 | return False
|
---|
75 | return True
|
---|
76 |
|
---|
77 | def actionExecute(self):
|
---|
78 | """
|
---|
79 | Execute the testcase, i.e. all sub-tests.
|
---|
80 | """
|
---|
81 | fRc = True
|
---|
82 | for oSubTstDrv in self.aoSubTstDrvs:
|
---|
83 | fRc &= oSubTstDrv.testIt()
|
---|
84 | return fRc
|
---|
85 |
|
---|
86 |
|
---|
87 | if __name__ == '__main__':
|
---|
88 | sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
---|
89 | from tdPython1 import SubTstDrvPython1
|
---|
90 | from tdAppliance1 import SubTstDrvAppliance1
|
---|
91 | from tdMoveMedium1 import SubTstDrvMoveMedium1
|
---|
92 | from tdTreeDepth1 import SubTstDrvTreeDepth1
|
---|
93 | from tdMoveVM1 import SubTstDrvMoveVM1
|
---|
94 | sys.exit(tdApi1([SubTstDrvPython1, SubTstDrvAppliance1, SubTstDrvMoveMedium1,
|
---|
95 | SubTstDrvTreeDepth1, SubTstDrvMoveVM1]).main(sys.argv))
|
---|
96 |
|
---|