VirtualBox

source: vbox/trunk/src/VBox/ValidationKit/tests/cpu/tdCpuIemInstr1.py@ 103068

Last change on this file since 103068 was 102981, checked in by vboxsync, 12 months ago

ValidationKit/tdCpuIemInstr1.py: Enable two more tests after recent fixes, bugref:10582

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 5.9 KB
Line 
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3# $Id: tdCpuIemInstr1.py 102981 2024-01-20 18:55:11Z vboxsync $
4
5"""
6VirtualBox Validation Kit - Test that runs various benchmarks.
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: 102981 $"
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 reporter;
55from testdriver import vbox;
56from testdriver import vboxcon;
57from testdriver import vboxtestvms;
58
59
60class IemTestVm(vboxtestvms.BootSectorTestVm):
61 """
62 A Boot Sector Test VM which is configured to run in IEM mode only.
63 """
64
65 def __init__(self, oSet, oTestDriver, sVmName, asVirtModesSup = None, f64BitRequired = True):
66 vboxtestvms.BootSectorTestVm.__init__(self,
67 oSet,
68 'tst-' + sVmName,
69 os.path.join(oTestDriver.sVBoxBootSectors, sVmName + '.img'),
70 asVirtModesSup,
71 f64BitRequired);
72
73 def _childVmReconfig(self, oTestDrv, oVM, oSession):
74 _ = oTestDrv;
75
76 fRc = oSession.setExtraData('VBoxInternal/EM/IemExecutesAll', '1');
77 if fRc:
78 if oVM.platform.x86.getHWVirtExProperty(vboxcon.HWVirtExPropertyType_NestedPaging):
79 fRc = oSession.setExtraData('VBoxInternal/EM/IemRecompiled', '1');
80 else:
81 fRc = oSession.setExtraData('VBoxInternal/EM/IemRecompiled', '0');
82
83 return fRc;
84
85class tdCpuIemInstr1(vbox.TestDriver):
86 """
87 CPU IEM instruction testcase #1.
88 """
89
90 def __init__(self):
91 vbox.TestDriver.__init__(self);
92
93 #
94 # There is no official IEM support in the virt modes yet, so hwvirt is interpreted IEM
95 # and hwvirt-np is recompiled IEM for now (gets configured in the IemTestVm class).
96 #
97 asVirtModesSup = [ 'hwvirt', 'hwvirt-np' ];
98
99 kaTestVMs = (
100 IemTestVm(self.oTestVmSet, self, 'bs3-cpu-basic-2', asVirtModesSup),
101
102 # @todo r=aeichner Image can not be found (probably it is too large for a floppy weighing in at 16MiB)
103 #IemTestVm(self.oTestVmSet, self, 'bs3-cpu-basic-3', asVirtModesSup),
104
105 # @todo r=aeichner Fails currently in IEM
106 #IemTestVm(self.oTestVmSet, self, 'bs3-cpu-decoding-1', asVirtModesSup),
107
108 # @todo r=aeichner Fails and hangs in 'lm64' / aaa
109 #IemTestVm(self.oTestVmSet, self, 'bs3-cpu-generated-1', asVirtModesSup),
110
111 IemTestVm(self.oTestVmSet, self, 'bs3-cpu-instr-2', asVirtModesSup),
112
113 # @todo r=aeichner Fails with IEM currently.
114 #IemTestVm(self.oTestVmSet, self, 'bs3-cpu-instr-3' asVirtModesSup),
115
116 IemTestVm(self.oTestVmSet, self, 'bs3-cpu-state64-1', asVirtModesSup),
117 IemTestVm(self.oTestVmSet, self, 'bs3-cpu-weird-1', asVirtModesSup),
118 IemTestVm(self.oTestVmSet, self, 'bs3-fpustate-1', asVirtModesSup)
119 );
120
121 for oTestVm in kaTestVMs:
122 self.oTestVmSet.aoTestVms.append(oTestVm);
123
124 #
125 # Overridden methods.
126 #
127
128
129 def actionConfig(self):
130 self._detectValidationKit();
131 return self.oTestVmSet.actionConfig(self);
132
133 def actionExecute(self):
134 return self.oTestVmSet.actionExecute(self, self.testOneCfg);
135
136
137
138 #
139 # Test execution helpers.
140 #
141
142 def testOneCfg(self, oVM, oTestVm):
143 """
144 Runs the specified VM thru the tests.
145
146 Returns a success indicator on the general test execution. This is not
147 the actual test result.
148 """
149
150 fRc = False
151
152 # Set up the result file
153 sXmlFile = self.prepareResultFile();
154 asEnv = [ 'IPRT_TEST_FILE=' + sXmlFile, ];
155
156 # Do the test:
157 self.logVmInfo(oVM);
158 oSession = self.startVm(oVM, sName = oTestVm.sVmName, asEnv = asEnv);
159 if oSession is not None:
160 cMsTimeout = 30 * 60000;
161 if not reporter.isLocal(): ## @todo need to figure a better way of handling timeouts on the testboxes ...
162 cMsTimeout = self.adjustTimeoutMs(180 * 60000);
163
164 oRc = self.waitForTasks(cMsTimeout);
165 if oRc == oSession:
166 fRc = oSession.assertPoweredOff();
167 else:
168 reporter.error('oRc=%s, expected %s' % (oRc, oSession));
169
170 reporter.addSubXmlFile(sXmlFile);
171 self.terminateVmBySession(oSession);
172
173 return fRc;
174
175
176
177if __name__ == '__main__':
178 sys.exit(tdCpuIemInstr1().main(sys.argv));
179
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