-
-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: add simple storage performance tests
Add few simple storage performance tests using fio tool. Tests are checking dom0's root and varlibqubes pools (by default the same thing, but in case of XFS or BTRFS setups, they are different). And VM's root/private/volatile. The last one is tested by creating ext4 filesystem there first. This isn't very representative (normally volatile is used for swap and CoW data), but allows comparing results with other volumes. The tests can be also started outside of the full test run by calling /usr/lib/qubes/tests/storage_perf.py. It requires giving name of a VM to test (which may be dom0). The test scenarios are modeled after what kdiskmark tool uses. QubesOS/qubes-issues#5740
- Loading branch information
Showing
4 changed files
with
402 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,184 @@ | ||
# | ||
# The Qubes OS Project, https://www.qubes-os.org/ | ||
# | ||
# Copyright (C) 2025 Marek Marczykowski-Górecki | ||
# <[email protected]> | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU Lesser General Public License as published by | ||
# the Free Software Foundation; either version 2.1 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public License along | ||
# with this program; if not, see <http://www.gnu.org/licenses/>. | ||
|
||
import asyncio | ||
import os | ||
import subprocess | ||
import sys | ||
import time | ||
|
||
import qubes.tests | ||
|
||
test_script = "/usr/lib/qubes/tests/storage_perf.py" | ||
|
||
|
||
class StoragePerfBase(qubes.tests.SystemTestCase): | ||
def setUp(self): | ||
super().setUp() | ||
self.vm = self.app.domains[0] | ||
|
||
def run_test(self, volume, name): | ||
cmd = [ | ||
test_script, | ||
f"--volume={volume}", | ||
f"--vm={self.vm.name}", | ||
name, | ||
] | ||
p = self.loop.run_until_complete(asyncio.create_subprocess_exec(*cmd)) | ||
self.loop.run_until_complete(p.wait()) | ||
if p.returncode: | ||
self.fail(f"'{' '.join(cmd)}' failed: {p.returncode}") | ||
|
||
|
||
class TC_00_StoragePerfDom0(StoragePerfBase): | ||
def test_000_root_seq1m_q8t1_read(self): | ||
self.run_test("root", "seq1m_q8t1_read") | ||
|
||
def test_001_root_seq1m_q8t1_write(self): | ||
self.run_test("root", "seq1m_q8t1_write") | ||
|
||
def test_003_root_seq1m_q1t1_read(self): | ||
self.run_test("root", "seq1m_q1t1_read") | ||
|
||
def test_004_root_seq1m_q1t1_write(self): | ||
self.run_test("root", "seq1m_q1t1_write") | ||
|
||
def test_005_root_rnd4k_q32t1_read(self): | ||
self.run_test("root", "rnd4k_q32t1_read") | ||
|
||
def test_005_root_rnd4k_q32t1_write(self): | ||
self.run_test("root", "rnd4k_q32t1_write") | ||
|
||
def test_006_root_rnd4k_q1t1_read(self): | ||
self.run_test("root", "rnd4k_q1t1_read") | ||
|
||
def test_007_root_rnd4k_q1t1_write(self): | ||
self.run_test("root", "rnd4k_q1t1_write") | ||
|
||
def test_010_varlibqubes_seq1m_q8t1_read(self): | ||
self.run_test("varlibqubes", "seq1m_q8t1_read") | ||
|
||
def test_011_varlibqubes_seq1m_q8t1_write(self): | ||
self.run_test("varlibqubes", "seq1m_q8t1_write") | ||
|
||
def test_013_varlibqubes_seq1m_q1t1_read(self): | ||
self.run_test("varlibqubes", "seq1m_q1t1_read") | ||
|
||
def test_014_varlibqubes_seq1m_q1t1_write(self): | ||
self.run_test("varlibqubes", "seq1m_q1t1_write") | ||
|
||
def test_015_varlibqubes_rnd4k_q32t1_read(self): | ||
self.run_test("varlibqubes", "rnd4k_q32t1_read") | ||
|
||
def test_015_varlibqubes_rnd4k_q32t1_write(self): | ||
self.run_test("varlibqubes", "rnd4k_q32t1_write") | ||
|
||
def test_016_varlibqubes_rnd4k_q1t1_read(self): | ||
self.run_test("varlibqubes", "rnd4k_q1t1_read") | ||
|
||
def test_017_varlibqubes_rnd4k_q1t1_write(self): | ||
self.run_test("varlibqubes", "rnd4k_q1t1_write") | ||
|
||
|
||
class TC_10_StoragePerfVM(StoragePerfBase): | ||
def setUp(self): | ||
super().setUp() | ||
self.vm = self.app.add_new_vm( | ||
"AppVM", | ||
name=self.make_vm_name("vm1"), | ||
label="red", | ||
) | ||
self.loop.run_until_complete( | ||
self.vm.create_on_disk(), | ||
) | ||
self.loop.run_until_complete( | ||
self.vm.start(), | ||
) | ||
|
||
def test_000_root_seq1m_q8t1_read(self): | ||
self.run_test("root", "seq1m_q8t1_read") | ||
|
||
def test_001_root_seq1m_q8t1_write(self): | ||
self.run_test("root", "seq1m_q8t1_write") | ||
|
||
def test_002_root_seq1m_q1t1_read(self): | ||
self.run_test("root", "seq1m_q1t1_read") | ||
|
||
def test_003_root_seq1m_q1t1_write(self): | ||
self.run_test("root", "seq1m_q1t1_write") | ||
|
||
def test_004_root_rnd4k_q32t1_read(self): | ||
self.run_test("root", "rnd4k_q32t1_read") | ||
|
||
def test_005_root_rnd4k_q32t1_write(self): | ||
self.run_test("root", "rnd4k_q32t1_write") | ||
|
||
def test_006_root_rnd4k_q1t1_read(self): | ||
self.run_test("root", "rnd4k_q1t1_read") | ||
|
||
def test_007_root_rnd4k_q1t1_write(self): | ||
self.run_test("root", "rnd4k_q1t1_write") | ||
|
||
def test_010_private_seq1m_q8t1_read(self): | ||
self.run_test("private", "seq1m_q8t1_read") | ||
|
||
def test_011_private_seq1m_q8t1_write(self): | ||
self.run_test("private", "seq1m_q8t1_write") | ||
|
||
def test_012_private_seq1m_q1t1_read(self): | ||
self.run_test("private", "seq1m_q1t1_read") | ||
|
||
def test_013_private_seq1m_q1t1_write(self): | ||
self.run_test("private", "seq1m_q1t1_write") | ||
|
||
def test_014_private_rnd4k_q32t1_read(self): | ||
self.run_test("private", "rnd4k_q32t1_read") | ||
|
||
def test_015_private_rnd4k_q32t1_write(self): | ||
self.run_test("private", "rnd4k_q32t1_write") | ||
|
||
def test_016_private_rnd4k_q1t1_read(self): | ||
self.run_test("private", "rnd4k_q1t1_read") | ||
|
||
def test_017_private_rnd4k_q1t1_write(self): | ||
self.run_test("private", "rnd4k_q1t1_write") | ||
|
||
def test_020_volatile_seq1m_q8t1_read(self): | ||
self.run_test("volatile", "seq1m_q8t1_read") | ||
|
||
def test_021_volatile_seq1m_q8t1_write(self): | ||
self.run_test("volatile", "seq1m_q8t1_write") | ||
|
||
def test_022_volatile_seq1m_q1t1_read(self): | ||
self.run_test("volatile", "seq1m_q1t1_read") | ||
|
||
def test_023_volatile_seq1m_q1t1_write(self): | ||
self.run_test("volatile", "seq1m_q1t1_write") | ||
|
||
def test_024_volatile_rnd4k_q32t1_read(self): | ||
self.run_test("volatile", "rnd4k_q32t1_read") | ||
|
||
def test_025_volatile_rnd4k_q32t1_write(self): | ||
self.run_test("volatile", "rnd4k_q32t1_write") | ||
|
||
def test_026_volatile_rnd4k_q1t1_read(self): | ||
self.run_test("volatile", "rnd4k_q1t1_read") | ||
|
||
def test_027_volatile_rnd4k_q1t1_write(self): | ||
self.run_test("volatile", "rnd4k_q1t1_write") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -528,6 +528,7 @@ done | |
%{python3_sitelib}/qubes/tests/integ/qrexec.py | ||
%{python3_sitelib}/qubes/tests/integ/qrexec_perf.py | ||
%{python3_sitelib}/qubes/tests/integ/storage.py | ||
%{python3_sitelib}/qubes/tests/integ/storage_perf.py | ||
%{python3_sitelib}/qubes/tests/integ/vm_qrexec_gui.py | ||
|
||
%dir %{python3_sitelib}/qubes/tests/integ/tools | ||
|
@@ -549,6 +550,7 @@ done | |
/usr/lib/qubes/fix-dir-perms.sh | ||
/usr/lib/qubes/startup-misc.sh | ||
/usr/lib/qubes/tests/qrexec_perf.py | ||
/usr/lib/qubes/tests/storage_perf.py | ||
%{_unitdir}/[email protected]/30_qubes.conf | ||
%{_unitdir}/qubes-core.service | ||
%{_unitdir}/qubes-qmemman.service | ||
|
Oops, something went wrong.