[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 04/13] tests/avocado: add cdrom permission related tests
From: |
Cleber Rosa |
Subject: |
[PATCH 04/13] tests/avocado: add cdrom permission related tests |
Date: |
Fri, 26 Jul 2024 09:44:29 -0400 |
Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
tests/avocado/cdrom.py | 41 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
create mode 100644 tests/avocado/cdrom.py
diff --git a/tests/avocado/cdrom.py b/tests/avocado/cdrom.py
new file mode 100644
index 0000000000..c9aa5d69cb
--- /dev/null
+++ b/tests/avocado/cdrom.py
@@ -0,0 +1,41 @@
+# Simple functional tests for cdrom devices
+#
+# Copyright (c) 2023 Red Hat, Inc.
+#
+# Author:
+# Cleber Rosa <crosa@redhat.com>
+#
+# This work is licensed under the terms of the GNU GPL, version 2 or
+# later. See the COPYING file in the top-level directory.
+
+import os
+
+from avocado.utils.iso9660 import iso9660
+from avocado_qemu import QemuSystemTest
+
+
+class Cdrom(QemuSystemTest):
+ """
+ :avocado: tags=block,cdrom,quick
+ :avocado: tags=machine:none
+ """
+ def setUp(self):
+ super().setUp()
+ self.iso_path = os.path.join(self.workdir, "cdrom.iso")
+ iso = iso9660(self.iso_path)
+ iso.create()
+ iso.close()
+
+ def test_plain_iso_rw(self):
+ self.vm.add_args('-drive', f'file={self.iso_path}')
+ self.vm.launch()
+ query_block_result = self.vm.qmp('query-block')['return']
+ self.assertEqual(len(query_block_result), 1)
+ self.assertFalse(query_block_result[0]["inserted"]["ro"])
+
+ def test_media_cdrom_ro(self):
+ self.vm.add_args('-drive', f'file={self.iso_path},media=cdrom')
+ self.vm.launch()
+ query_block_result = self.vm.qmp('query-block')['return']
+ self.assertEqual(len(query_block_result), 1)
+ self.assertTrue(query_block_result[0]["inserted"]["ro"])
--
2.45.2
- [PATCH 00/13] Bump Avocado to 103.0 LTS and update tests for compatibility and new features, Cleber Rosa, 2024/07/26
- [PATCH 01/13] tests/avocado: mips: fallback to HTTP given certificate expiration, Cleber Rosa, 2024/07/26
- [PATCH 02/13] tests/avocado: mips: add hint for fetchasset plugin, Cleber Rosa, 2024/07/26
- [PATCH 03/13] tests/avocado/intel_iommu.py: increase timeout, Cleber Rosa, 2024/07/26
- [PATCH 04/13] tests/avocado: add cdrom permission related tests,
Cleber Rosa <=
- [PATCH 05/13] tests/avocado: machine aarch64: standardize location and RO access, Cleber Rosa, 2024/07/26
- [PATCH 06/13] tests/avocado: use more distinct names for assets, Cleber Rosa, 2024/07/26
- [PATCH 09/13] tests/avocado/boot_xen.py: fetch kernel during test setUp(), Cleber Rosa, 2024/07/26