[pve-devel] [PATCH v3 qemu-server 07/17] migration tests: mock $rpcenv->check subroutine

Oguz Bektas o.bektas at proxmox.com
Wed Apr 6 13:57:24 CEST 2022


missing mock routine is causes the tests to fail at build time
when $rpcenv->check is called.

previous assumption was returning 'root at pam' to get_user() so we can
do the same here.

Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
---
v2->v3:

* added new, since we need to run $rpcenv->check inside the unit tests for migration


 test/MigrationTest/QmMock.pm | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/test/MigrationTest/QmMock.pm b/test/MigrationTest/QmMock.pm
index 2d5d5c6..eb6ea53 100644
--- a/test/MigrationTest/QmMock.pm
+++ b/test/MigrationTest/QmMock.pm
@@ -40,6 +40,11 @@ sub fork_worker {
     return '123456';
 }
 
+sub check {
+    my ($self, $authuser, $path, $priv, $noerr) = @_;
+    return 1 if $authuser eq 'root at pam';
+}
+
 # mocked modules
 
 my $inotify_module = Test::MockModule->new("PVE::INotify");
-- 
2.30.2






More information about the pve-devel mailing list