VirtualBox

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

Last change on this file since 102969 was 102969, checked in by vboxsync, 16 months ago

ValidationKit/tests/cpu/tdCpuIemInstr1.py: Enable more bootsector testcases, 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: 6.1 KB
Line 
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3# $Id: tdCpuIemInstr1.py 102969 2024-01-19 12:37:53Z 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: 102969 $"
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 # @todo r=aeichner Crashes in ASMAtomicXchgU16, unaligned pointer, see @bugref{10547}.
101 #IemTestVm(self.oTestVmSet, self, 'bs3-cpu-basic-2', asVirtModesSup),
102
103 # @todo r=aeichner Image can not be found (probably it is too large for a floppy weighing in at 16MiB)
104 #IemTestVm(self.oTestVmSet, self, 'bs3-cpu-basic-3', asVirtModesSup),
105
106 # @todo r=aeichner Fails currently in IEM
107 #IemTestVm(self.oTestVmSet, self, 'bs3-cpu-decoding-1', asVirtModesSup),
108
109 # @todo r=aeichner Fails and hangs in 'lm64' / aaa
110 #IemTestVm(self.oTestVmSet, self, 'bs3-cpu-generated-1', asVirtModesSup),
111
112 IemTestVm(self.oTestVmSet, self, 'bs3-cpu-instr-2', asVirtModesSup),
113
114 # @todo r=aeichner Fails with IEM currently.
115 #IemTestVm(self.oTestVmSet, self, 'bs3-cpu-instr-3' asVirtModesSup),
116
117 # @todo r=aeichner Hangs after test.
118 #IemTestVm(self.oTestVmSet, self, 'b3s-cpu-state64-1', asVirtModesSup),
119
120 IemTestVm(self.oTestVmSet, self, 'bs3-cpu-weird-1', asVirtModesSup),
121 IemTestVm(self.oTestVmSet, self, 'bs3-fpustate-1', asVirtModesSup)
122 );
123
124 for oTestVm in kaTestVMs:
125 self.oTestVmSet.aoTestVms.append(oTestVm);
126
127 #
128 # Overridden methods.
129 #
130
131
132 def actionConfig(self):
133 self._detectValidationKit();
134 return self.oTestVmSet.actionConfig(self);
135
136 def actionExecute(self):
137 return self.oTestVmSet.actionExecute(self, self.testOneCfg);
138
139
140
141 #
142 # Test execution helpers.
143 #
144
145 def testOneCfg(self, oVM, oTestVm):
146 """
147 Runs the specified VM thru the tests.
148
149 Returns a success indicator on the general test execution. This is not
150 the actual test result.
151 """
152
153 fRc = False
154
155 # Set up the result file
156 sXmlFile = self.prepareResultFile();
157 asEnv = [ 'IPRT_TEST_FILE=' + sXmlFile, ];
158
159 # Do the test:
160 self.logVmInfo(oVM);
161 oSession = self.startVm(oVM, sName = oTestVm.sVmName, asEnv = asEnv);
162 if oSession is not None:
163 cMsTimeout = 30 * 60000;
164 if not reporter.isLocal(): ## @todo need to figure a better way of handling timeouts on the testboxes ...
165 cMsTimeout = self.adjustTimeoutMs(180 * 60000);
166
167 oRc = self.waitForTasks(cMsTimeout);
168 if oRc == oSession:
169 fRc = oSession.assertPoweredOff();
170 else:
171 reporter.error('oRc=%s, expected %s' % (oRc, oSession));
172
173 reporter.addSubXmlFile(sXmlFile);
174 self.terminateVmBySession(oSession);
175
176 return fRc;
177
178
179
180if __name__ == '__main__':
181 sys.exit(tdCpuIemInstr1().main(sys.argv));
182
Note: See TracBrowser for help on using the repository browser.

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