aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2024-10-25 10:26:58 +0100
committerThomas Huth <thuth@redhat.com>2024-11-04 14:16:11 +0100
commitc9daf680d1ea34097f367527046a9229279aa1e9 (patch)
treeb1fd5b4c38d3e598f25985dffc8e55843dcba4b9 /tests
parent9094f7c9340efc238e562420b3eb13c5e508a9af (diff)
tests/functional: make tuxrun disk images writable
The zstd command will preserve the input archive permissions on the output file. So when we decompress the readonly cached image, the resulting per-test run private disk image will also be readonly. We need it to be writable, so make it so. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20241025092659.2312118-2-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/functional/qemu_test/tuxruntest.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/functional/qemu_test/tuxruntest.py b/tests/functional/qemu_test/tuxruntest.py
index 904da6f609..f05aa96ad7 100644
--- a/tests/functional/qemu_test/tuxruntest.py
+++ b/tests/functional/qemu_test/tuxruntest.py
@@ -10,6 +10,7 @@
# SPDX-License-Identifier: GPL-2.0-or-later
import os
+import stat
import time
from qemu_test import QemuSystemTest
@@ -77,12 +78,17 @@ class TuxRunBaselineTest(QemuSystemTest):
kernel_image = kernel_asset.fetch()
disk_image_zst = rootfs_asset.fetch()
+ disk_image = self.workdir + "/rootfs.ext4"
+
run_cmd([self.zstd, "-f", "-d", disk_image_zst,
- "-o", self.workdir + "/rootfs.ext4"])
+ "-o", disk_image])
+ # zstd copies source archive permissions for the output
+ # file, so must make this writable for QEMU
+ os.chmod(disk_image, stat.S_IRUSR | stat.S_IWUSR)
dtb = dtb_asset.fetch() if dtb_asset is not None else None
- return (kernel_image, self.workdir + "/rootfs.ext4", dtb)
+ return (kernel_image, disk_image, dtb)
def prepare_run(self, kernel, disk, drive, dtb=None, console_index=0):
"""