| 1 | #!/usr/bin/env python3 |
| 2 | # |
| 3 | # Check for vm-launch-update device. |
| 4 | # |
| 5 | # Copyright (c) 2026 Red Hat, Inc. |
| 6 | # |
| 7 | # Author: |
| 8 | # Ani Sinha <anisinha@redhat.com> |
| 9 | # |
| 10 | # SPDX-License-Identifier: GPL-2.0-or-later |
| 11 | |
| 12 | from qemu_test import QemuSystemTest |
| 13 | |
| 14 | class VmLaunchUpdateDeviceCheck(QemuSystemTest): |
| 15 | |
| 16 | def aarch64_fail_test(self): |
| 17 | """ |
| 18 | Currently the device is only supported for pc platforms. |
| 19 | """ |
| 20 | self.vm.add_args('-machine', 'virt', '-device', |
| 21 | 'vm-launch-update,id=fwupd1') |
| 22 | self.vm.set_qmp_monitor(enabled=False) |
| 23 | self.vm.launch() |
| 24 | self.vm.wait() |
| 25 | self.assertEqual(self.vm.exitcode(), 1, "QEMU exit code should be 1") |
| 26 | self.assertRegex(self.vm.get_log(), |
| 27 | r'This machine does not support vm-launch-update device') |
| 28 | |
| 29 | def test_vm_launch_update(self): |
| 30 | self.aarch64_fail_test() |
| 31 | |
| 32 | if __name__ == '__main__': |
| 33 | QemuSystemTest.main() |