From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server] test: fix restore config test as unprivileged user
Date: Mon, 31 May 2021 16:27:10 +0200 [thread overview]
Message-ID: <20210531142710.31410-1-f.ebner@proxmox.com> (raw)
after upgrading to bullseye, the cfs_read_file call within
restore_update_config_line() results in an error:
Is a directory!
when done as an unprivileged user.
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
Is that the intended behavior?
test/run_qemu_restore_config_tests.pl | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/test/run_qemu_restore_config_tests.pl b/test/run_qemu_restore_config_tests.pl
index e5d9f2a..d8c0f37 100755
--- a/test/run_qemu_restore_config_tests.pl
+++ b/test/run_qemu_restore_config_tests.pl
@@ -5,6 +5,7 @@ use warnings;
use lib qw(..);
+use Test::MockModule;
use Test::More;
use File::Basename;
@@ -15,6 +16,13 @@ use PVE::Tools qw(dir_glob_foreach file_get_contents);
my $INPUT_DIR = './restore-config-input';
my $EXPECTED_DIR = './restore-config-expected';
+my $pve_cluster_module = Test::MockModule->new('PVE::Cluster');
+$pve_cluster_module->mock(
+ cfs_read_file => sub {
+ return {};
+ },
+);
+
# NOTE update when you add/remove tests
plan tests => 4;
--
2.30.2
next reply other threads:[~2021-05-31 14:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-31 14:27 Fabian Ebner [this message]
2021-06-18 15:26 ` [pve-devel] applied: " Thomas Lamprecht
2021-06-18 15:46 ` [pve-devel] " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210531142710.31410-1-f.ebner@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox