VirtualBox

source: vbox/trunk/src/VBox/ValidationKit/tests/api/tdApi1.py@ 103914

Last change on this file since 103914 was 100264, checked in by vboxsync, 18 months ago

ValidationKit/tests/api/{Makefile.kmk,tdSnapshots1.py}: Add two new
tests involving nested online snapshots. The first exercises
IMachine::takeSnapshot(), IMachine::findSnapshot()), and
IMachine::restoreSnapshot() to verify that restoring and booting a
nested snapshot doesn't also delete that snapshot. The second exercises
IMachine::unregister() and IMachine::deleteConfig() to verify that
deleting a VM with multiple snapshots does indeed delete the snapshots
as well. These scenarios were both encountered in the past as
regressions and are described in xTracker #10252. bugref:10252.

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 3.4 KB
Line 
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3# $Id: tdApi1.py 100264 2023-06-23 12:47:37Z vboxsync $
4
5"""
6VirtualBox Validation Kit - API Test wrapper #1 combining all API sub-tests
7"""
8
9__copyright__ = \
10"""
11Copyright (C) 2010-2023 Oracle and/or its affiliates.
12
13This file is part of VirtualBox base platform packages, as
14available from https://www.virtualbox.org.
15
16This program is free software; you can redistribute it and/or
17modify it under the terms of the GNU General Public License
18as published by the Free Software Foundation, in version 3 of the
19License.
20
21This program is distributed in the hope that it will be useful, but
22WITHOUT ANY WARRANTY; without even the implied warranty of
23MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24General Public License for more details.
25
26You should have received a copy of the GNU General Public License
27along with this program; if not, see <https://www.gnu.org/licenses>.
28
29The contents of this file may alternatively be used under the terms
30of the Common Development and Distribution License Version 1.0
31(CDDL), a copy of it is provided in the "COPYING.CDDL" file included
32in the VirtualBox distribution, in which case the provisions of the
33CDDL are applicable instead of those of the GPL.
34
35You may elect to license modified versions of this file under the
36terms and conditions of either the GPL or the CDDL or both.
37
38SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
39"""
40__version__ = "$Revision: 100264 $"
41
42
43# Standard Python imports.
44import os
45import sys
46
47# Only the main script needs to modify the path.
48try: __file__ # pylint: disable=used-before-assignment
49except: __file__ = sys.argv[0]
50g_ksValidationKitDir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
51sys.path.append(g_ksValidationKitDir)
52
53# Validation Kit imports.
54from testdriver import vbox
55
56
57class tdApi1(vbox.TestDriver):
58 """
59 API Test wrapper #1.
60 """
61
62 def __init__(self, aoSubTestDriverClasses = None):
63 vbox.TestDriver.__init__(self)
64 for oSubTestDriverClass in aoSubTestDriverClasses:
65 self.addSubTestDriver(oSubTestDriverClass(self));
66
67 #
68 # Overridden methods.
69 #
70
71 def actionConfig(self):
72 """
73 Import the API.
74 """
75 if not self.importVBoxApi():
76 return False
77 return True
78
79 def actionExecute(self):
80 """
81 Execute the testcase, i.e. all sub-tests.
82 """
83 fRc = True;
84 for oSubTstDrv in self.aoSubTstDrvs:
85 if oSubTstDrv.fEnabled:
86 fRc = oSubTstDrv.testIt() and fRc;
87 return fRc;
88
89
90if __name__ == '__main__':
91 sys.path.append(os.path.dirname(os.path.abspath(__file__)))
92 from tdPython1 import SubTstDrvPython1; # pylint: disable=relative-import
93 from tdAppliance1 import SubTstDrvAppliance1; # pylint: disable=relative-import
94 from tdMoveMedium1 import SubTstDrvMoveMedium1; # pylint: disable=relative-import
95 from tdTreeDepth1 import SubTstDrvTreeDepth1; # pylint: disable=relative-import
96 from tdMoveVm1 import SubTstDrvMoveVm1; # pylint: disable=relative-import
97 from tdCloneMedium1 import SubTstDrvCloneMedium1;# pylint: disable=relative-import
98 from tdSnapshots1 import SubTstDrvNestedSnapshots1;# pylint: disable=relative-import
99 sys.exit(tdApi1([SubTstDrvPython1, SubTstDrvAppliance1, SubTstDrvMoveMedium1,
100 SubTstDrvTreeDepth1, SubTstDrvMoveVm1, SubTstDrvCloneMedium1,
101 SubTstDrvNestedSnapshots1]).main(sys.argv))
Note: See TracBrowser for help on using the repository browser.

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