mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-08 13:35:33 +00:00
migrate test: fix some more grave indentation/whitespace errors
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
73ed64967e
commit
cd1db1b3e0
@ -133,8 +133,8 @@ $MigrationTest::Shared::qemu_server_module->mock(
|
|||||||
my ($vmid, $drive, $dst_volid, $vmiddst, $is_zero_initialized, $jobs, $completion, $qga, $bwlimit, $src_bitmap) = @_;
|
my ($vmid, $drive, $dst_volid, $vmiddst, $is_zero_initialized, $jobs, $completion, $qga, $bwlimit, $src_bitmap) = @_;
|
||||||
|
|
||||||
die "drive_mirror with wrong vmid: '$vmid'\n" if $vmid ne $test_vmid;
|
die "drive_mirror with wrong vmid: '$vmid'\n" if $vmid ne $test_vmid;
|
||||||
die "qemu_drive_mirror '$drive' error\n" if $fail_config->{qemu_drive_mirror}
|
die "qemu_drive_mirror '$drive' error\n"
|
||||||
&& $fail_config->{qemu_drive_mirror} eq $drive;
|
if $fail_config->{qemu_drive_mirror} && $fail_config->{qemu_drive_mirror} eq $drive;
|
||||||
|
|
||||||
my $nbd_info = decode_json(file_get_contents("${RUN_DIR_PATH}/nbd_info"));
|
my $nbd_info = decode_json(file_get_contents("${RUN_DIR_PATH}/nbd_info"));
|
||||||
die "target does not expect drive mirror for '$drive'\n"
|
die "target does not expect drive mirror for '$drive'\n"
|
||||||
@ -145,8 +145,9 @@ $MigrationTest::Shared::qemu_server_module->mock(
|
|||||||
qemu_drive_mirror_monitor => sub {
|
qemu_drive_mirror_monitor => sub {
|
||||||
my ($vmid, $vmiddst, $jobs, $completion, $qga) = @_;
|
my ($vmid, $vmiddst, $jobs, $completion, $qga) = @_;
|
||||||
|
|
||||||
if ($fail_config->{qemu_drive_mirror_monitor} &&
|
if ($fail_config->{qemu_drive_mirror_monitor}
|
||||||
$fail_config->{qemu_drive_mirror_monitor} eq $completion) {
|
&& $fail_config->{qemu_drive_mirror_monitor} eq $completion
|
||||||
|
) {
|
||||||
die "qemu_drive_mirror_monitor '$completion' error\n";
|
die "qemu_drive_mirror_monitor '$completion' error\n";
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -202,8 +203,8 @@ $MigrationTest::Shared::storage_module->mock(
|
|||||||
storage_migrate => sub {
|
storage_migrate => sub {
|
||||||
my ($cfg, $volid, $target_sshinfo, $target_storeid, $opts, $logfunc) = @_;
|
my ($cfg, $volid, $target_sshinfo, $target_storeid, $opts, $logfunc) = @_;
|
||||||
|
|
||||||
die "storage_migrate '$volid' error\n" if $fail_config->{storage_migrate}
|
die "storage_migrate '$volid' error\n"
|
||||||
&& $fail_config->{storage_migrate} eq $volid;
|
if $fail_config->{storage_migrate} && $fail_config->{storage_migrate} eq $volid;
|
||||||
|
|
||||||
my ($storeid, $volname) = PVE::Storage::parse_volume_id($volid);
|
my ($storeid, $volname) = PVE::Storage::parse_volume_id($volid);
|
||||||
|
|
||||||
@ -234,8 +235,8 @@ $MigrationTest::Shared::storage_module->mock(
|
|||||||
|
|
||||||
PVE::Storage::parse_volume_id($volid);
|
PVE::Storage::parse_volume_id($volid);
|
||||||
|
|
||||||
die "vdisk_free '$volid' error\n" if defined($fail_config->{vdisk_free})
|
die "vdisk_free '$volid' error\n"
|
||||||
&& $fail_config->{vdisk_free} eq $volid;
|
if defined($fail_config->{vdisk_free}) && $fail_config->{vdisk_free} eq $volid;
|
||||||
|
|
||||||
delete $source_volids->{$volid};
|
delete $source_volids->{$volid};
|
||||||
},
|
},
|
||||||
@ -255,7 +256,7 @@ $MigrationTest::Shared::tools_module->mock(
|
|||||||
|
|
||||||
my $cmd = shift @{$cmd_tail};
|
my $cmd = shift @{$cmd_tail};
|
||||||
|
|
||||||
if ($cmd eq '/usr/bin/ssh') {
|
if ($cmd =~ m@^(?:/usr/bin/)?ssh$@) {
|
||||||
while (scalar(@{$cmd_tail})) {
|
while (scalar(@{$cmd_tail})) {
|
||||||
$cmd = shift @{$cmd_tail};
|
$cmd = shift @{$cmd_tail};
|
||||||
if ($cmd eq '/bin/true') {
|
if ($cmd eq '/bin/true') {
|
||||||
@ -278,14 +279,17 @@ $MigrationTest::Shared::tools_module->mock(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $MigrationTest::Shared::tools_module->original('run_command')->([
|
return $MigrationTest::Shared::tools_module->original('run_command')->(
|
||||||
'/usr/bin/perl',
|
[
|
||||||
"-I${QM_LIB_PATH}",
|
'/usr/bin/perl',
|
||||||
"-I${QM_LIB_PATH}/test",
|
"-I${QM_LIB_PATH}",
|
||||||
"${QM_LIB_PATH}/test/MigrationTest/QmMock.pm",
|
"-I${QM_LIB_PATH}/test",
|
||||||
'start',
|
"${QM_LIB_PATH}/test/MigrationTest/QmMock.pm",
|
||||||
@{$cmd_tail},
|
'start',
|
||||||
], %param);
|
@{$cmd_tail},
|
||||||
|
],
|
||||||
|
%param,
|
||||||
|
);
|
||||||
|
|
||||||
} elsif ($cmd eq 'nbdstop') {
|
} elsif ($cmd eq 'nbdstop') {
|
||||||
delete $expected_calls->{ssh_nbdstop};
|
delete $expected_calls->{ssh_nbdstop};
|
||||||
@ -306,8 +310,8 @@ $MigrationTest::Shared::tools_module->mock(
|
|||||||
if ($cmd eq 'free') {
|
if ($cmd eq 'free') {
|
||||||
my $volid = shift @{$cmd_tail};
|
my $volid = shift @{$cmd_tail};
|
||||||
PVE::Storage::parse_volume_id($volid);
|
PVE::Storage::parse_volume_id($volid);
|
||||||
return 1 if $fail_config->{ssh_pvesm_free}
|
return 1
|
||||||
&& $fail_config->{ssh_pvesm_free} eq $volid;
|
if $fail_config->{ssh_pvesm_free} && $fail_config->{ssh_pvesm_free} eq $volid;
|
||||||
MigrationTest::Shared::remove_target_volid($volid);
|
MigrationTest::Shared::remove_target_volid($volid);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user