Skip to content

Commit 85d7e32

Browse files
committed
Read disposable performance tests
For: QubesOS/qubes-issues#1512
1 parent a930d4e commit 85d7e32

6 files changed

Lines changed: 11118 additions & 137 deletions

File tree

qubes/tests/integ/dispvm.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#
44
# Copyright (C) 2016 Marek Marczykowski-Górecki
55
# <marmarek@invisiblethingslab.com>
6+
# Copyright (C) 2025 Benjamin Grande <ben.grande.b@gmail.com>
67
#
78
# This library is free software; you can redistribute it and/or
89
# modify it under the terms of the GNU Lesser General Public

qubes/tests/integ/dispvm_perf.py

Lines changed: 76 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#
22
# The Qubes OS Project, https://www.qubes-os.org/
33
#
4-
# Copyright (C) 2025 Marek Marczykowski-Górecki
5-
# <marmarek@invisiblethingslab.com>
4+
# Copyright (C) 2025 Benjamin Grande <ben.grande.b@gmail.com>
65
#
76
# This program is free software; you can redistribute it and/or modify
87
# it under the terms of the GNU Lesser General Public License as published by
@@ -18,9 +17,7 @@
1817
# with this program; if not, see <http://www.gnu.org/licenses/>.
1918

2019
import asyncio
21-
import os
2220
import sys
23-
import time
2421

2522
import qubes.tests
2623

@@ -53,6 +50,11 @@ def setUp(self: qubes.tests.SystemTestCase):
5350
template=self.app.domains[self.template],
5451
default_dispvm=self.dvm,
5552
)
53+
# Necessary to be done post qube creation because of Whonix Admin Addon:
54+
# https://github.com/QubesOS/qubes-core-admin-addon-whonix/pull/25
55+
for qube in [self.dvm, self.vm1, self.vm2]:
56+
qube.default_dispvm = self.dvm
57+
qube.netvm = None
5658
self.loop.run_until_complete(
5759
asyncio.gather(
5860
self.dvm.create_on_disk(),
@@ -61,7 +63,7 @@ def setUp(self: qubes.tests.SystemTestCase):
6163
)
6264
)
6365
start_tasks = [self.vm1.start()]
64-
if self._testMethodName.startswith("vm"):
66+
if "_vm" in self._testMethodName:
6567
start_tasks.append(self.vm2.start())
6668
self.loop.run_until_complete(asyncio.gather(*start_tasks))
6769

@@ -78,7 +80,7 @@ def run_test(self, name):
7880
dvm = self.dvm.name
7981
vm1 = self.vm1.name
8082
vm2 = ""
81-
if name.startswith("vm"):
83+
if "-vm" in name:
8284
vm2 = self.vm2.name
8385
cmd = [
8486
"/usr/lib/qubes/tests/dispvm_perf.py",
@@ -92,141 +94,141 @@ def run_test(self, name):
9294
if p.returncode:
9395
self.fail(f"'{' '.join(cmd)}' failed: {p.returncode}")
9496

95-
def test_000_dispvm(self):
97+
def test_000_vm_dispvm(self):
9698
"""Latency of vm-dispvm calls"""
97-
self.run_test("dispvm")
99+
self.run_test("vm-dispvm")
98100

99-
def test_001_dispvm_gui(self):
101+
def test_001_vm_dispvm_gui(self):
100102
"""Latency of vm-dispvm GUI calls"""
101-
self.run_test("dispvm-gui")
103+
self.run_test("vm-dispvm-gui")
102104

103-
def test_002_dispvm_concurrent(self):
105+
def test_002_vm_dispvm_concurrent(self):
104106
"""Latency of vm-dispvm concurrent calls"""
105-
self.run_test("dispvm-concurrent")
107+
self.run_test("vm-dispvm-concurrent")
106108

107-
def test_003_dispvm_gui_concurrent(self):
109+
def test_003_vm_dispvm_gui_concurrent(self):
108110
"""Latency of vm-dispvm concurrent GUI calls"""
109-
self.run_test("dispvm-gui-concurrent")
111+
self.run_test("vm-dispvm-gui-concurrent")
110112

111-
def test_006_dispvm_from_dom0(self):
113+
def test_006_dom0_dispvm(self):
112114
"""Latency of dom0-dispvm calls"""
113-
self.run_test("dispvm-dom0")
115+
self.run_test("dom0-dispvm")
114116

115-
def test_007_dispvm_from_dom0_gui(self):
117+
def test_007_dom0_dispvm_gui(self):
116118
"""Latency of dom0-dispvm GUI calls"""
117-
self.run_test("dispvm-dom0-gui")
119+
self.run_test("dom0-dispvm-gui")
118120

119-
def test_008_dispvm_from_dom0_concurrent(self):
121+
def test_008_dom0_dispvm_concurrent(self):
120122
"""Latency of dom0-dispvm concurrent calls"""
121-
self.run_test("dispvm-dom0-concurrent")
123+
self.run_test("dom0-dispvm-concurrent")
122124

123-
def test_009_dispvm_from_dom0_gui_concurrent(self):
125+
def test_009_dom0_dispvm_gui_concurrent(self):
124126
"""Latency of dom0-dispvm concurrent GUI calls"""
125-
self.run_test("dispvm-dom0-gui-concurrent")
127+
self.run_test("dom0-dispvm-gui-concurrent")
126128

127-
def test_020_dispvm_preload(self):
129+
def test_020_vm_dispvm_preload(self):
128130
"""Latency of vm-dispvm (preload) calls"""
129-
self.run_test("dispvm-preload")
131+
self.run_test("vm-dispvm-preload")
130132

131-
def test_021_dispvm_preload_gui(self):
133+
def test_021_vm_dispvm_preload_gui(self):
132134
"""Latency of vm-dispvm (preload) GUI calls"""
133-
self.run_test("dispvm-preload-gui")
135+
self.run_test("vm-dispvm-preload-gui")
134136

135-
def test_022_dispvm_preload_concurrent(self):
137+
def test_022_vm_dispvm_preload_concurrent(self):
136138
"""Latency of vm-dispvm (preload) concurrent calls"""
137-
self.run_test("dispvm-preload-concurrent")
139+
self.run_test("vm-dispvm-preload-concurrent")
138140

139-
def test_023_dispvm_preload_gui_concurrent(self):
141+
def test_023_vm_dispvm_preload_gui_concurrent(self):
140142
"""Latency of vm-dispvm (preload) concurrent GUI calls"""
141-
self.run_test("dispvm-preload-gui-concurrent")
143+
self.run_test("vm-dispvm-preload-gui-concurrent")
142144

143-
def test_026_dispvm_from_dom0_preload(self):
145+
def test_026_dom0_dispvm_preload(self):
144146
"""Latency of dom0-dispvm (preload) calls"""
145-
self.run_test("dispvm-preload-dom0")
147+
self.run_test("dom0-dispvm-preload")
146148

147-
def test_027_dispvm_from_dom0_preload_gui(self):
149+
def test_027_dom0_dispvm_preload_gui(self):
148150
"""Latency of dom0-dispvm (preload) GUI calls"""
149-
self.run_test("dispvm-preload-dom0-gui")
151+
self.run_test("dom0-dispvm-preload-gui")
150152

151-
def test_028_dispvm_from_dom0_preload_concurrent(self):
153+
def test_028_dom0_dispvm_preload_concurrent(self):
152154
"""Latency of dom0-dispvm (preload) concurrent calls"""
153-
self.run_test("dispvm-preload-dom0-concurrent")
155+
self.run_test("dom0-dispvm-preload-concurrent")
154156

155-
def test_029_dispvm_from_dom0_preload_gui_concurrent(self):
157+
def test_029_dom0_dispvm_preload_gui_concurrent(self):
156158
"""Latency of dom0-dispvm (preload) concurrent GUI calls"""
157-
self.run_test("dispvm-preload-dom0-gui-concurrent")
159+
self.run_test("dom0-dispvm-preload-gui-concurrent")
158160

159-
def test_400_dispvm_api(self):
161+
def test_400_dom0_dispvm_api(self):
160162
"""Latency of dom0-dispvm API calls"""
161-
self.run_test("dispvm-api")
163+
self.run_test("dom0-dispvm-api")
162164

163-
def test_401_dispvm_gui_api(self):
165+
def test_401_dom0_dispvm_gui_api(self):
164166
"""Latency of dom0-dispvm GUI API calls"""
165-
self.run_test("dispvm-gui-api")
167+
self.run_test("dom0-dispvm-gui-api")
166168

167-
def test_402_dispvm_concurrent_api(self):
169+
def test_402_dom0_dispvm_concurrent_api(self):
168170
"""Latency of dom0-dispvm concurrent API calls"""
169-
self.run_test("dispvm-concurrent-api")
171+
self.run_test("dom0-dispvm-concurrent-api")
170172

171-
def test_403_dispvm_gui_concurrent_api(self):
173+
def test_403_dom0_dispvm_gui_concurrent_api(self):
172174
"""Latency of dom0-dispvm concurrent GUI API calls"""
173-
self.run_test("dispvm-gui-concurrent-api")
175+
self.run_test("dom0-dispvm-gui-concurrent-api")
174176

175-
def test_404_dispvm_preload_more_api(self):
177+
def test_404_dom0_dispvm_preload_more_api(self):
176178
"""Latency of dom0-dispvm (preload more) API calls"""
177-
self.run_test("dispvm-preload-more-api")
179+
self.run_test("dom0-dispvm-preload-more-api")
178180

179-
def test_404_dispvm_preload_less_api(self):
181+
def test_404_dom0_dispvm_preload_less_api(self):
180182
"""Latency of dom0-dispvm (preload less) API calls"""
181-
self.run_test("dispvm-preload-less-api")
183+
self.run_test("dom0-dispvm-preload-less-api")
182184

183-
def test_404_dispvm_preload_api(self):
185+
def test_404_dom0_dispvm_preload_api(self):
184186
"""Latency of dom0-dispvm (preload) API calls"""
185-
self.run_test("dispvm-preload-api")
187+
self.run_test("dom0-dispvm-preload-api")
186188

187-
def test_405_dispvm_preload_gui_api(self):
189+
def test_405_dom0_dispvm_preload_gui_api(self):
188190
"""Latency of dom0-dispvm (preload) GUI API calls"""
189-
self.run_test("dispvm-preload-gui-api")
191+
self.run_test("dom0-dispvm-preload-gui-api")
190192

191-
def test_406_dispvm_preload_concurrent_api(self):
193+
def test_406_dom0_dispvm_preload_concurrent_api(self):
192194
"""Latency of dom0-dispvm (preload) concurrent GUI API calls"""
193-
self.run_test("dispvm-preload-concurrent-api")
195+
self.run_test("dom0-dispvm-preload-concurrent-api")
194196

195-
def test_407_dispvm_preload_gui_concurrent_api(self):
197+
def test_407_dom0_dispvm_preload_gui_concurrent_api(self):
196198
"""Latency of dom0-dispvm (preload) concurrent GUI API calls"""
197-
self.run_test("dispvm-preload-gui-concurrent-api")
199+
self.run_test("dom0-dispvm-preload-gui-concurrent-api")
198200

199-
def test_900_vm(self):
201+
def test_900_vm_vm(self):
200202
"""Latency of vm-vm calls"""
201-
self.run_test("vm")
203+
self.run_test("vm-vm")
202204

203-
def test_901_vm_gui(self):
205+
def test_901_vm_vm_gui(self):
204206
"""Latency of vm-vm GUI calls"""
205-
self.run_test("vm-gui")
207+
self.run_test("vm-vm-gui")
206208

207-
def test_902_vm_concurrent(self):
209+
def test_902_vm_vm_concurrent(self):
208210
"""Latency of vm-vm concurrent calls"""
209-
self.run_test("vm-concurrent")
211+
self.run_test("vm-vm-concurrent")
210212

211-
def test_903_vm_gui_concurrent(self):
213+
def test_903_vm_vm_gui_concurrent(self):
212214
"""Latency of vm-vm concurrent GUI calls"""
213-
self.run_test("vm-gui-concurrent")
215+
self.run_test("vm-vm-gui-concurrent")
214216

215-
def test_904_vm_api(self):
217+
def test_904_dom0_vm_api(self):
216218
"""Latency of dom0-vm API calls"""
217-
self.run_test("vm-api")
219+
self.run_test("dom0-vm-api")
218220

219-
def test_905_vm_gui_api(self):
221+
def test_905_dom0_vm_gui_api(self):
220222
"""Latency of dom0-vm GUI API calls"""
221-
self.run_test("vm-gui-api")
223+
self.run_test("dom0-vm-gui-api")
222224

223-
def test_906_vm_concurrent_api(self):
225+
def test_906_dom0_vm_concurrent_api(self):
224226
"""Latency of dom0-vm concurrent API calls"""
225-
self.run_test("vm-concurrent-api")
227+
self.run_test("dom0-vm-concurrent-api")
226228

227-
def test_907_vm_gui_concurrent_api(self):
229+
def test_907_dom0_vm_gui_concurrent_api(self):
228230
"""Latency of dom0-vm concurrent GUI API calls"""
229-
self.run_test("vm-gui-concurrent-api")
231+
self.run_test("dom0-vm-gui-concurrent-api")
230232

231233

232234
def create_testcases_for_templates():

rpm_spec/core-dom0.spec.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,7 @@ done
567567
/usr/lib/qubes/fix-dir-perms.sh
568568
/usr/lib/qubes/startup-misc.sh
569569
/usr/lib/qubes/tests/dispvm_perf.py
570+
/usr/lib/qubes/tests/dispvm_perf_reader.py
570571
/usr/lib/qubes/tests/qrexec_perf.py
571572
/usr/lib/qubes/tests/storage_perf.py
572573
%{_unitdir}/lvm2-pvscan@.service.d/30_qubes.conf
@@ -585,6 +586,7 @@ done
585586
/usr/share/qubes/templates/libvirt/devices/pci.xml
586587
/usr/share/qubes/templates/libvirt/devices/net.xml
587588
/usr/share/qubes/tests-data/dispvm-open-thunderbird-attachment
589+
/usr/share/qubes/tests-data/dispvm_perf.json
588590
/usr/share/qubes/tests-data/sysfs
589591
/usr/lib/tmpfiles.d/qubes.conf
590592
%attr(0755,root,root) /usr/lib/qubes/create-snapshot

0 commit comments

Comments
 (0)