]> git.proxmox.com Git - qemu-server.git/blame - test/snapshot-test.pm
buildsys: use gzip -n to disable timestamps
[qemu-server.git] / test / snapshot-test.pm
CommitLineData
a157d0fd
FG
1package PVE::QemuServer;
2
3use strict;
4use warnings;
5
6use lib qw(..);
7
8use PVE::Storage;
9use PVE::Storage::Plugin;
10use PVE::QemuServer;
ffda963f 11use PVE::QemuConfig;
a157d0fd
FG
12use PVE::Tools;
13
14use Test::MockModule;
15use Test::More;
16
17my $nodename;
18my $snapshot_possible;
19my $vol_snapshot_possible = {};
20my $vol_snapshot_delete_possible = {};
21my $vol_snapshot_rollback_possible = {};
22my $vol_snapshot_rollback_enabled = {};
23my $vol_snapshot = {};
24my $vol_snapshot_delete = {};
25my $vol_snapshot_rollback = {};
26my $running;
27my $freeze_possible;
28my $stop_possible;
29my $save_vmstate_works;
30my $vm_mon = {};
31
32# Mocked methods
33
34sub mocked_volume_snapshot {
35 my ($storecfg, $volid, $snapname) = @_;
36 die "Storage config not mocked! aborting\n"
37 if defined($storecfg);
38 die "volid undefined\n"
39 if !defined($volid);
40 die "snapname undefined\n"
41 if !defined($snapname);
42 if ($vol_snapshot_possible->{$volid}) {
43 if (defined($vol_snapshot->{$volid})) {
44 $vol_snapshot->{$volid} .= ",$snapname";
45 } else {
46 $vol_snapshot->{$volid} = $snapname;
47 }
48 return 1;
49 } else {
50 die "volume snapshot disabled\n";
51 }
52}
53
54sub mocked_volume_snapshot_delete {
55 my ($storecfg, $volid, $snapname) = @_;
56 die "Storage config not mocked! aborting\n"
57 if defined($storecfg);
58 die "volid undefined\n"
59 if !defined($volid);
60 die "snapname undefined\n"
61 if !defined($snapname);
62 if ($vol_snapshot_delete_possible->{$volid}) {
63 if (defined($vol_snapshot_delete->{$volid})) {
64 $vol_snapshot_delete->{$volid} .= ",$snapname";
65 } else {
66 $vol_snapshot_delete->{$volid} = $snapname;
67 }
68 return 1;
69 } else {
70 die "volume snapshot delete disabled\n";
71 }
72}
73
74sub mocked_volume_snapshot_rollback {
75 my ($storecfg, $volid, $snapname) = @_;
76 die "Storage config not mocked! aborting\n"
77 if defined($storecfg);
78 die "volid undefined\n"
79 if !defined($volid);
80 die "snapname undefined\n"
81 if !defined($snapname);
82 if ($vol_snapshot_rollback_enabled->{$volid}) {
83 if (defined($vol_snapshot_rollback->{$volid})) {
84 $vol_snapshot_rollback->{$volid} .= ",$snapname";
85 } else {
86 $vol_snapshot_rollback->{$volid} = $snapname;
87 }
88 return 1;
89 } else {
90 die "volume snapshot rollback disabled\n";
91 }
92}
93
94sub mocked_volume_rollback_is_possible {
95 my ($storecfg, $volid, $snapname) = @_;
96 die "Storage config not mocked! aborting\n"
97 if defined($storecfg);
98 die "volid undefined\n"
99 if !defined($volid);
100 die "snapname undefined\n"
101 if !defined($snapname);
102 return $vol_snapshot_rollback_possible->{$volid}
103 if ($vol_snapshot_rollback_possible->{$volid});
104 die "volume_rollback_is_possible failed\n";
105}
106
107sub mocked_vdisk_free {
108 my ($storecfg, $vmstate) = @_;
109 die "Storage config not mocked! aborting\n"
110 if defined($storecfg);
111 die "wrong vdisk - fake vmstate expected!\n"
112 if ($vmstate ne "somestorage:state-volume");
113 return;
114}
115
116sub mocked_run_command {
117 my ($cmd, %param) = @_;
118 my $cmdstring;
119 if (my $ref = ref($cmd)) {
120 $cmdstring = PVE::Tools::cmd2string($cmd);
121 if ($cmdstring =~ m/.*\/qemu-(un)?freeze.*/) {
122 return 1 if $freeze_possible;
123 die "qemu-[un]freeze disabled\n";
124 }
125 if ($cmdstring =~ m/.*\/qemu-stop.*--kill.*/) {
126 if ($stop_possible) {
127 $running = 0;
128 return 1;
129 } else {
130 return 0;
131 }
132 }
133 }
134 die "unexpected run_command call: '$cmdstring', aborting\n";
135}
136
137# Testing methods
138
139sub test_file {
140 my ($exp_fn, $real_fn) = @_;
141 my $ret;
142 eval {
143 $ret = system("diff -u '$exp_fn' '$real_fn'");
144 };
145 die if $@;
146 return !$ret;
147}
148
149sub testcase_prepare {
150 my ($vmid, $snapname, $save_vmstate, $comment, $exp_err) = @_;
151 subtest "Preparing snapshot '$snapname' for vm '$vmid'" => sub {
152 plan tests => 2;
153 $@ = undef;
154 eval {
b2c9558d 155 PVE::QemuConfig->__snapshot_prepare($vmid, $snapname, $save_vmstate, $comment);
a157d0fd
FG
156 };
157 is($@, $exp_err, "\$@ correct");
158 ok(test_file("snapshot-expected/prepare/qemu-server/$vmid.conf", "snapshot-working/prepare/qemu-server/$vmid.conf"), "config file correct");
159 };
160}
161
162sub testcase_commit {
163 my ($vmid, $snapname, $exp_err) = @_;
164 subtest "Committing snapshot '$snapname' for vm '$vmid'" => sub {
165 plan tests => 2;
166 $@ = undef;
167 eval {
b2c9558d 168 PVE::QemuConfig->__snapshot_commit($vmid, $snapname);
a157d0fd
FG
169 };
170 is($@, $exp_err, "\$@ correct");
171 ok(test_file("snapshot-expected/commit/qemu-server/$vmid.conf", "snapshot-working/commit/qemu-server/$vmid.conf"), "config file correct");
172 }
173}
174
175sub testcase_create {
176 my ($vmid, $snapname, $save_vmstate, $comment, $exp_err, $exp_vol_snap, $exp_vol_snap_delete) = @_;
177 subtest "Creating snapshot '$snapname' for vm '$vmid'" => sub {
178 plan tests => 4;
179 $vol_snapshot = {};
180 $vol_snapshot_delete = {};
181 $exp_vol_snap = {} if !defined($exp_vol_snap);
182 $exp_vol_snap_delete = {} if !defined($exp_vol_snap_delete);
183 $@ = undef;
184 eval {
b2c9558d 185 PVE::QemuConfig->snapshot_create($vmid, $snapname, $save_vmstate, $comment);
a157d0fd
FG
186 };
187 is($@, $exp_err, "\$@ correct");
188 is_deeply($vol_snapshot, $exp_vol_snap, "created correct volume snapshots");
189 is_deeply($vol_snapshot_delete, $exp_vol_snap_delete, "deleted correct volume snapshots");
190 ok(test_file("snapshot-expected/create/qemu-server/$vmid.conf", "snapshot-working/create/qemu-server/$vmid.conf"), "config file correct");
191 };
192}
193
194sub testcase_delete {
195 my ($vmid, $snapname, $force, $exp_err, $exp_vol_snap_delete) = @_;
196 subtest "Deleting snapshot '$snapname' of vm '$vmid'" => sub {
197 plan tests => 3;
198 $vol_snapshot_delete = {};
199 $exp_vol_snap_delete = {} if !defined($exp_vol_snap_delete);
200 $@ = undef;
201 eval {
b2c9558d 202 PVE::QemuConfig->snapshot_delete($vmid, $snapname, $force);
a157d0fd
FG
203 };
204 is($@, $exp_err, "\$@ correct");
205 is_deeply($vol_snapshot_delete, $exp_vol_snap_delete, "deleted correct volume snapshots");
206 ok(test_file("snapshot-expected/delete/qemu-server/$vmid.conf", "snapshot-working/delete/qemu-server/$vmid.conf"), "config file correct");
207 };
208}
209
210sub testcase_rollback {
211 my ($vmid, $snapname, $exp_err, $exp_vol_snap_rollback) = @_;
212 subtest "Rolling back to snapshot '$snapname' of vm '$vmid'" => sub {
213 plan tests => 3;
214 $vol_snapshot_rollback = {};
215 $running = 1;
216 $exp_vol_snap_rollback = {} if !defined($exp_vol_snap_rollback);
217 $@ = undef;
218 eval {
b2c9558d 219 PVE::QemuConfig->snapshot_rollback($vmid, $snapname);
a157d0fd
FG
220 };
221 is($@, $exp_err, "\$@ correct");
222 is_deeply($vol_snapshot_rollback, $exp_vol_snap_rollback, "rolled back to correct volume snapshots");
223 ok(test_file("snapshot-expected/rollback/qemu-server/$vmid.conf", "snapshot-working/rollback/qemu-server/$vmid.conf"), "config file correct");
224 };
225}
226
ffda963f 227# BEGIN mocked PVE::QemuConfig methods
a157d0fd
FG
228sub config_file_lock {
229 return "snapshot-working/pve-test.lock";
230}
231
232sub cfs_config_path {
ffda963f 233 my ($class, $vmid, $node) = @_;
a157d0fd
FG
234
235 $node = $nodename if !$node;
236 return "snapshot-working/$node/qemu-server/$vmid.conf";
237}
238
239sub load_config {
ffda963f 240 my ($class, $vmid, $node) = @_;
a157d0fd 241
ffda963f 242 my $filename = $class->cfs_config_path($vmid, $node);
a157d0fd
FG
243
244 my $raw = PVE::Tools::file_get_contents($filename);
245
246 my $conf = PVE::QemuServer::parse_vm_config($filename, $raw);
247 return $conf;
248}
249
250sub write_config {
ffda963f 251 my ($class, $vmid, $conf) = @_;
a157d0fd 252
ffda963f 253 my $filename = $class->cfs_config_path($vmid);
a157d0fd
FG
254
255 if ($conf->{snapshots}) {
256 foreach my $snapname (keys %{$conf->{snapshots}}) {
257 $conf->{snapshots}->{$snapname}->{snaptime} = "1234567890"
258 if $conf->{snapshots}->{$snapname}->{snaptime};
259 }
260 }
261
262 my $raw = PVE::QemuServer::write_vm_config($filename, $conf);
263
264 PVE::Tools::file_set_contents($filename, $raw);
265}
266
267sub has_feature {
b2c9558d 268 my ($class, $feature, $conf, $storecfg, $snapname, $running, $backup_only) = @_;
a157d0fd
FG
269 return $snapshot_possible;
270}
271
b2c9558d
FG
272sub __snapshot_save_vmstate {
273 my ($class, $vmid, $conf, $snapname, $storecfg) = @_;
a157d0fd
FG
274 die "save_vmstate failed\n"
275 if !$save_vmstate_works;
276
277 my $snap = $conf->{snapshots}->{$snapname};
278 $snap->{vmstate} = "somestorage:state-volume";
279 $snap->{machine} = "somemachine";
280}
b2c9558d
FG
281# END mocked PVE::QemuConfig methods
282
283# BEGIN redefine PVE::QemuServer methods
284
285sub check_running {
286 return $running;
287}
288
a157d0fd
FG
289
290sub do_snapshots_with_qemu {
291 return 0;
292}
293
294sub vm_qmp_command {
295 my ($vmid, $cmd, $nocheck) = @_;
296
297 my $exec = $cmd->{execute};
298 if ($exec eq "delete-drive-snapshot") {
299 return;
300 }
301 if ($exec eq "guest-ping") {
302 die "guest-ping disabled\n"
303 if !$vm_mon->{guest_ping};
304 return;
305 }
306 if ($exec eq "guest-fsfreeze-freeze" || $exec eq "guest-fsfreeze-thaw") {
307 die "freeze disabled\n"
308 if !$freeze_possible;
309 return;
310 }
311 if ($exec eq "savevm-start") {
312 die "savevm-start disabled\n"
313 if !$vm_mon->{savevm_start};
314 return;
315 }
316 if ($exec eq "savevm-end") {
317 die "savevm-end disabled\n"
318 if !$vm_mon->{savevm_end};
319 return;
320 }
321 if ($exec eq "query-savevm") {
322 return { "status" => "completed" };
323 }
324 die "unexpected vm_qmp_command!\n";
325}
326
327sub vm_start {
328 my ($storecfg, $vmid, $statefile, $skiplock, $migratedfrom, $paused, $forcemachine) = @_;
329
330 die "Storage config not mocked! aborting\n"
331 if defined($storecfg);
332
333 die "statefile and forcemachine must be both defined or undefined! aborting\n"
334 if defined($statefile) xor defined($forcemachine);
335
336 return;
337}
338
339sub vm_stop {
340 my ($storecfg, $vmid, $skiplock, $nocheck, $timeout, $shutdown, $force, $keepActive, $migratedfrom) = @_;
341
342 $running = 0
343 if $stop_possible;
344
345 return;
346}
347
348# END redefine PVE::QemuServer methods
349
350PVE::Tools::run_command("rm -rf snapshot-working");
351PVE::Tools::run_command("cp -a snapshot-input snapshot-working");
352
ffda963f
FG
353my $qemu_config_module = new Test::MockModule('PVE::QemuConfig');
354$qemu_config_module->mock('config_file_lock', \&config_file_lock);
355$qemu_config_module->mock('cfs_config_path', \&cfs_config_path);
356$qemu_config_module->mock('load_config', \&load_config);
357$qemu_config_module->mock('write_config', \&write_config);
b2c9558d
FG
358$qemu_config_module->mock('has_feature', \&has_feature);
359$qemu_config_module->mock('__snapshot_save_vmstate', \&__snapshot_save_vmstate);
ffda963f 360
a157d0fd
FG
361$running = 1;
362$freeze_possible = 1;
363$save_vmstate_works = 1;
364
365printf("\n");
366printf("Running prepare tests\n");
367printf("\n");
368$nodename = "prepare";
369
370printf("\n");
371printf("Setting has_feature to return true\n");
372printf("\n");
373$snapshot_possible = 1;
374
375printf("Successful snapshot_prepare with no existing snapshots\n");
376testcase_prepare("101", "test", 0, "test comment", '');
377
378printf("Successful snapshot_prepare with no existing snapshots, including vmstate\n");
379testcase_prepare("102", "test", 1, "test comment", '');
380
381printf("Successful snapshot_prepare with one existing snapshot\n");
382testcase_prepare("103", "test2", 0, "test comment", "");
383
384printf("Successful snapshot_prepare with one existing snapshot, including vmstate\n");
385testcase_prepare("104", "test2", 1, "test comment", "");
386
387printf("Expected error for snapshot_prepare on locked container\n");
388testcase_prepare("200", "test", 0, "test comment", "VM is locked (snapshot)\n");
389
390printf("Expected error for snapshot_prepare with duplicate snapshot name\n");
391testcase_prepare("201", "test", 0, "test comment", "snapshot name 'test' already used\n");
392
393$save_vmstate_works = 0;
394
395printf("Expected error for snapshot_prepare with failing save_vmstate\n");
396testcase_prepare("202", "test", 1, "test comment", "save_vmstate failed\n");
397
398$save_vmstate_works = 1;
399
400printf("\n");
401printf("Setting has_feature to return false\n");
402printf("\n");
403$snapshot_possible = 0;
404
405printf("Expected error for snapshot_prepare if snapshots not possible\n");
406testcase_prepare("300", "test", 0, "test comment", "snapshot feature is not available\n");
407
408printf("\n");
409printf("Running commit tests\n");
410printf("\n");
411$nodename = "commit";
412
413printf("\n");
414printf("Setting has_feature to return true\n");
415printf("\n");
416$snapshot_possible = 1;
417
418printf("Successful snapshot_commit with one prepared snapshot\n");
419testcase_commit("101", "test", "");
420
421printf("Successful snapshot_commit with one committed and one prepared snapshot\n");
422testcase_commit("102", "test2", "");
423
424printf("Expected error for snapshot_commit with no snapshot lock\n");
425testcase_commit("201", "test", "missing snapshot lock\n");
426
427printf("Expected error for snapshot_commit with invalid snapshot name\n");
428testcase_commit("202", "test", "snapshot 'test' does not exist\n");
429
430printf("Expected error for snapshot_commit with invalid snapshot state\n");
431testcase_commit("203", "test", "wrong snapshot state\n");
432
433$vol_snapshot_possible->{"local:snapshotable-disk-1"} = 1;
434$vol_snapshot_possible->{"local:snapshotable-disk-2"} = 1;
435$vol_snapshot_possible->{"local:snapshotable-disk-3"} = 1;
436$vol_snapshot_delete_possible->{"local:snapshotable-disk-1"} = 1;
437$vol_snapshot_delete_possible->{"local:snapshotable-disk-3"} = 1;
438$vol_snapshot_rollback_enabled->{"local:snapshotable-disk-1"} = 1;
439$vol_snapshot_rollback_enabled->{"local:snapshotable-disk-2"} = 1;
440$vol_snapshot_rollback_enabled->{"local:snapshotable-disk-3"} = 1;
441$vol_snapshot_rollback_possible->{"local:snapshotable-disk-1"} = 1;
442$vol_snapshot_rollback_possible->{"local:snapshotable-disk-2"} = 1;
443$vol_snapshot_rollback_possible->{"local:snapshotable-disk-3"} = 1;
444$vol_snapshot_rollback_possible->{"local:snapshotable-disk-4"} = 1;
445$vm_mon->{guest_ping} = 1;
446$vm_mon->{savevm_start} = 1;
447$vm_mon->{savevm_end} = 1;
448
449# possible, but fails
450$vol_snapshot_rollback_possible->{"local:snapshotable-disk-4"} = 1;
451
452printf("\n");
453printf("Setting up Mocking for PVE::Storage\n");
454my $storage_module = new Test::MockModule('PVE::Storage');
455$storage_module->mock('config', sub { return undef; });
456$storage_module->mock('path', sub { return "/some/store/statefile/path"; });
457$storage_module->mock('vdisk_free', \&mocked_vdisk_free);
458$storage_module->mock('volume_snapshot', \&mocked_volume_snapshot);
459$storage_module->mock('volume_snapshot_delete', \&mocked_volume_snapshot_delete);
460$storage_module->mock('volume_snapshot_rollback', \&mocked_volume_snapshot_rollback);
461$storage_module->mock('volume_rollback_is_possible', \&mocked_volume_rollback_is_possible);
462printf("\tconfig(), volume_snapshot(), volume_snapshot_delete(), volume_snapshot_rollback() and volume_rollback_is_possible() mocked\n");
463
464#printf("\n");
465#printf("Setting up Mocking for PVE::Tools\n");
466#my $tools_module = new Test::MockModule('PVE::Tools');
467#$tools_module->mock('run_command' => \&mocked_run_command);
468#printf("\trun_command() mocked\n");
469#
470$nodename = "create";
471printf("\n");
472printf("Running create tests\n");
473printf("\n");
474
475printf("Successful snapshot_create with no existing snapshots\n");
476testcase_create("101", "test", 0, "test comment", "", { "local:snapshotable-disk-1" => "test" });
477
478printf("Successful snapshot_create with no existing snapshots, including vmstate\n");
479testcase_create("102", "test", 1, "test comment", "", { "local:snapshotable-disk-1" => "test" });
480
481printf("Successful snapshot_create with one existing snapshots\n");
482testcase_create("103", "test2", 0, "test comment", "", { "local:snapshotable-disk-1" => "test2" });
483
484printf("Successful snapshot_create with one existing snapshots, including vmstate\n");
485testcase_create("104", "test2", 1, "test comment", "", { "local:snapshotable-disk-1" => "test2" });
486
487printf("Successful snapshot_create with multiple mps\n");
488testcase_create("105", "test", 0, "test comment", "", { "local:snapshotable-disk-1" => "test", "local:snapshotable-disk-2" => "test", "local:snapshotable-disk-3" => "test" });
489
490$freeze_possible = 0;
491printf("Successful snapshot_create with no existing snapshots and broken freeze\n");
492testcase_create("106", "test", 1, "test comment", "", { "local:snapshotable-disk-1" => "test" });
493$freeze_possible = 1;
494
495printf("Expected error for snapshot_create when volume snapshot is not possible\n");
b2c9558d 496testcase_create("201", "test", 0, "test comment", "volume snapshot disabled\n\n");
a157d0fd
FG
497
498printf("Expected error for snapshot_create when volume snapshot is not possible for one drive\n");
b2c9558d 499testcase_create("202", "test", 0, "test comment", "volume snapshot disabled\n\n", { "local:snapshotable-disk-1" => "test" }, { "local:snapshotable-disk-1" => "test" });
a157d0fd
FG
500
501$vm_mon->{savevm_start} = 0;
502printf("Expected error for snapshot_create when Qemu mon command 'savevm-start' fails\n");
b2c9558d 503testcase_create("203", "test", 0, "test comment", "savevm-start disabled\n\n");
a157d0fd
FG
504$vm_mon->{savevm_start} = 1;
505
506
507$nodename = "delete";
508printf("\n");
509printf("Running delete tests\n");
510printf("\n");
511
512printf("Successful snapshot_delete of only existing snapshot\n");
513testcase_delete("101", "test", 0, "", { "local:snapshotable-disk-1" => "test" });
514
515printf("Successful snapshot_delete of leaf snapshot\n");
516testcase_delete("102", "test2", 0, "", { "local:snapshotable-disk-1" => "test2" });
517
518printf("Successful snapshot_delete of root snapshot\n");
519testcase_delete("103", "test", 0, "", { "local:snapshotable-disk-1" => "test" });
520
521printf("Successful snapshot_delete of intermediate snapshot\n");
522testcase_delete("104", "test2", 0, "", { "local:snapshotable-disk-1" => "test2" });
523
524printf("Successful snapshot_delete with broken volume_snapshot_delete and force=1\n");
525testcase_delete("105", "test", 1, "");
526
527printf("Successful snapshot_delete with mp broken volume_snapshot_delete and force=1\n");
528testcase_delete("106", "test", 1, "", { "local:snapshotable-disk-1" => "test", "local:snapshotable-disk-3" => "test" });
529
530printf("Expected error when snapshot_delete fails with broken volume_snapshot_delete and force=0\n");
531testcase_delete("201", "test", 0, "volume snapshot delete disabled\n");
532
533printf("Expected error when snapshot_delete fails with broken mp volume_snapshot_delete and force=0\n");
534testcase_delete("202", "test", 0, "volume snapshot delete disabled\n", { "local:snapshotable-disk-1" => "test" });
535
536printf("Expected error for snapshot_delete with locked config\n");
537testcase_delete("203", "test", 0, "VM is locked (backup)\n");
538
539$nodename = "rollback";
540printf("\n");
541printf("Running rollback tests\n");
542printf("\n");
543
544$stop_possible = 1;
545
546printf("Successful snapshot_rollback to only existing snapshot\n");
547testcase_rollback("101", "test", "", { "local:snapshotable-disk-1" => "test" });
548
549printf("Successful snapshot_rollback to leaf snapshot\n");
550testcase_rollback("102", "test2", "", { "local:snapshotable-disk-1" => "test2" });
551
552printf("Successful snapshot_rollback to root snapshot\n");
553testcase_rollback("103", "test", "", { "local:snapshotable-disk-1" => "test" });
554
555printf("Successful snapshot_rollback to intermediate snapshot\n");
556testcase_rollback("104", "test2", "", { "local:snapshotable-disk-1" => "test2" });
557
558printf("Successful snapshot_rollback with multiple mp\n");
559testcase_rollback("105", "test", "", { "local:snapshotable-disk-1" => "test", "local:snapshotable-disk-2" => "test", "local:snapshotable-disk-3" => "test" });
560
561printf("Successful snapshot_rollback to only existing snapshot, with saved vmstate and machine config\n");
562testcase_rollback("106", "test", "", { "local:snapshotable-disk-1" => "test" });
563
564printf("Expected error for snapshot_rollback with non-existing snapshot\n");
565testcase_rollback("201", "test2", "snapshot 'test2' does not exist\n");
566
567printf("Expected error for snapshot_rollback if volume rollback not possible\n");
568testcase_rollback("202", "test", "volume_rollback_is_possible failed\n");
569
570printf("Expected error for snapshot_rollback with incomplete snapshot\n");
571testcase_rollback("203", "test", "unable to rollback to incomplete snapshot (snapstate = delete)\n");
572
573printf("Expected error for snapshot_rollback with lock\n");
574testcase_rollback("204", "test", "VM is locked (backup)\n");
575
576$stop_possible = 0;
577
578printf("Expected error for snapshot_rollback with unkillable container\n");
579testcase_rollback("205", "test", "unable to rollback vm 205: vm is running\n");
580
581$stop_possible = 1;
582
583printf("Expected error for snapshot_rollback with mp rollback_is_possible failure\n");
584testcase_rollback("206", "test", "volume_rollback_is_possible failed\n");
585
586printf("Expected error for snapshot_rollback with mp rollback failure (results in inconsistent state)\n");
587testcase_rollback("207", "test", "volume snapshot rollback disabled\n", { "local:snapshotable-disk-1" => "test", "local:snapshotable-disk-2" => "test" });
588
589done_testing();