diff options
| author | Stefan Hajnoczi <stefanha@redhat.com> | 2024-12-12 18:45:09 -0500 |
|---|---|---|
| committer | Stefan Hajnoczi <stefanha@redhat.com> | 2024-12-12 18:45:09 -0500 |
| commit | bdce9bc9179bd7b6f4e12c759dd3cd6794e26a6b (patch) | |
| tree | ac50a528b74309d205ce97bf770d7e8b1b0fd5c4 /tests/migration-stress/guestperf/report.py | |
| parent | 1eec82cc06cd68b6ffaf13ba8337fac0080c7bce (diff) | |
| parent | de8bc62cc4871fa97d1891ebb96e782b0c75b56a (diff) | |
| download | focaccia-qemu-bdce9bc9179bd7b6f4e12c759dd3cd6794e26a6b.tar.gz focaccia-qemu-bdce9bc9179bd7b6f4e12c759dd3cd6794e26a6b.zip | |
Merge tag 'qtest-20241212-pull-request' of https://gitlab.com/farosas/qemu into staging
Qtest pull request - TIMEOUT_MULTIPLIER setting to allow tests to take longer when asan is enabled - New qtest_system_reset() wrapper to properly wait for a system reset - Split of migration-test.c into multiple files under qtest/migration/ # -----BEGIN PGP SIGNATURE----- # # iQJEBAABCAAuFiEEqhtIsKIjJqWkw2TPx5jcdBvsMZ0FAmda+84QHGZhcm9zYXNA # c3VzZS5kZQAKCRDHmNx0G+wxnXWZEACcxW/P9EiLxIeCf4ke7/qq+8HSOOLdQrEa # hP5ZCzLlY0K8KQ9fhTGvc6UgRBsScXcLuj4eoR8Gke9e4tID39XVdkion/x6OCiv # grC2Ll9/BNrWtR8DiXs3krsU1CXhav6qcT56bMiXV3Qo+KsTmB7RkpXpbkZLZxkn # P2aqZlYFS0zZ3PZQceCasQEzB6Dls7o1wNXvgSJXr2E4IuIEcbyWtQpr5DfctnfN # STbqGTgMXADyjlqh3CWwSLsZQvIVoN9+3twOrZn4j0D+fyEsTjKsZPlUpRtr72ap # FVT+zVIUfxieBlDTsRSwcieD1ePFUUjl7ikQFwypGs33TI9VDTsB88IG7h0/080o # 7dYbSMSG0pGEq9QIB8jkV26OZi3y00L/zmLMNDsN6nxKN4mSySlfVD/B/Jb70Smy # lwbLklnr921kqsF89Bsq8YRyg8bbGXtx2ifGROgqF+JtrxRW0ElF9K/h4HQtPjuD # nZJ4rtrDIv1iMTLJwbNu39fhxvuQowdBYTrbPMgw+xIv++LodqYJSDxbEX+FaDqI # LMf772jiAgesl7qe1d9TJizhvonyi9PIdcUILg0SH0H1KvoSjpS3mlGgvo8zgvh+ # zvhhzkFGDIHmlCvOaIYyCpadJ5SMMS627q/Q13X3DHjUTkpPUhxGgc9oO7T39+iA # 4dOLDRjUcg== # =H6xv # -----END PGP SIGNATURE----- # gpg: Signature made Thu 12 Dec 2024 10:05:50 EST # gpg: using RSA key AA1B48B0A22326A5A4C364CFC798DC741BEC319D # gpg: issuer "farosas@suse.de" # gpg: Good signature from "Fabiano Rosas <farosas@suse.de>" [unknown] # gpg: aka "Fabiano Almeida Rosas <fabiano.rosas@suse.com>" [unknown] # gpg: WARNING: The key's User ID is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: AA1B 48B0 A223 26A5 A4C3 64CF C798 DC74 1BEC 319D * tag 'qtest-20241212-pull-request' of https://gitlab.com/farosas/qemu: (22 commits) tests/qtest/migration: Split validation tests + misc tests/qtest/migration-test: Fix and enable test_ignore_shared tests/qtest/migration: Split CPR tests tests/qtest/migration: Split precopy tests tests/qtest/migration: Split file tests tests/qtest/migration: Split postcopy tests tests/qtest/migration: Split compression tests from migration-test.c tests/qtest/migration: Split TLS tests from migration-test.c tests/qtest/migration: Move common test code tests/qtest/migration: Isolate test initialization tests/qtest/migration: Move kvm_dirty_ring_supported to utils tests/qtest/migration: Move ufd_version_check to utils tests/qtest/migration: Rename migration-helpers.c tests/qtest/migration: Move qmp helpers to a separate file tests/qtest/migration: Move bootfile code to its own file tests/migration: Disambiguate guestperf vs. a-b tests/qtest/migration: Stop calling everything "test" tests/qtest/migration: Standardize hook names tests/qtest: Use qtest_system_reset_nowait() where appropriate tests/qtest: Use qtest_system_reset() instead of open-coded versions ... Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'tests/migration-stress/guestperf/report.py')
| -rw-r--r-- | tests/migration-stress/guestperf/report.py | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/tests/migration-stress/guestperf/report.py b/tests/migration-stress/guestperf/report.py new file mode 100644 index 0000000000..1efd40c868 --- /dev/null +++ b/tests/migration-stress/guestperf/report.py @@ -0,0 +1,98 @@ +# +# Migration test output result reporting +# +# Copyright (c) 2016 Red Hat, Inc. +# +# This library 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 library 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 library; if not, see <http://www.gnu.org/licenses/>. +# + +import json + +from guestperf.hardware import Hardware +from guestperf.scenario import Scenario +from guestperf.progress import Progress +from guestperf.timings import Timings + +class Report(object): + + def __init__(self, + hardware, + scenario, + progress_history, + guest_timings, + qemu_timings, + vcpu_timings, + binary, + dst_host, + kernel, + initrd, + transport, + sleep): + + self._hardware = hardware + self._scenario = scenario + self._progress_history = progress_history + self._guest_timings = guest_timings + self._qemu_timings = qemu_timings + self._vcpu_timings = vcpu_timings + self._binary = binary + self._dst_host = dst_host + self._kernel = kernel + self._initrd = initrd + self._transport = transport + self._sleep = sleep + + def serialize(self): + return { + "hardware": self._hardware.serialize(), + "scenario": self._scenario.serialize(), + "progress_history": [progress.serialize() for progress in self._progress_history], + "guest_timings": self._guest_timings.serialize(), + "qemu_timings": self._qemu_timings.serialize(), + "vcpu_timings": self._vcpu_timings.serialize(), + "binary": self._binary, + "dst_host": self._dst_host, + "kernel": self._kernel, + "initrd": self._initrd, + "transport": self._transport, + "sleep": self._sleep, + } + + @classmethod + def deserialize(cls, data): + return cls( + Hardware.deserialize(data["hardware"]), + Scenario.deserialize(data["scenario"]), + [Progress.deserialize(record) for record in data["progress_history"]], + Timings.deserialize(data["guest_timings"]), + Timings.deserialize(data["qemu_timings"]), + Timings.deserialize(data["vcpu_timings"]), + data["binary"], + data["dst_host"], + data["kernel"], + data["initrd"], + data["transport"], + data["sleep"]) + + def to_json(self): + return json.dumps(self.serialize(), indent=4) + + @classmethod + def from_json(cls, data): + return cls.deserialize(json.loads(data)) + + @classmethod + def from_json_file(cls, filename): + with open(filename, "r") as fh: + return cls.deserialize(json.load(fh)) |