Skip to content

Commit

Permalink
Document save_storage and 'SAVE_STORAGE_TIMEOUT'
Browse files Browse the repository at this point in the history
  • Loading branch information
mimi1vx committed Jul 19, 2023
1 parent 6d13427 commit 1201cd7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/backend_vars.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ WORKER_CLASS;string;undef;qemu system types
WORKER_HOSTNAME;string;undef;Worker hostname
QEMU_VIDEO_DEVICE;string;virtio-gpu-pci on ARM, VGA otherwise;Video device to use with VM (using -device, not -vga). Can have options appended e.g. "virtio-gpu-gl,edid=on", but it is better to set QEMU_VIDEO_DEVICE_OPTIONS. See qemu docs and https://www.kraxel.org/blog/2019/09/display-devices-in-qemu/ for valid choices
QEMU_VIDEO_DEVICE_OPTIONS;string;none;Additional options for QEMU_VIDEO_DEVICE (comma-separated). Will be appended after automatically-generated resolution setting options on devices that support EDID
SAVE_STORAGE_TIMEOUT;integer;900;Specifies timeout for saving one storage drive in `save_storage` test API function.
|====================

.SVIRT backend
Expand Down
17 changes: 15 additions & 2 deletions doc/memorydumps.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ IMPORTANT: Currently only the QEMU backend is supported.

== How to use

Two methods are available to the test writer, `freeze_vm` and `save_memory_dump`
Three methods are available to the test writer, `freeze_vm`, `save_memory_dump` and `save_storage`

The feature is enabled by calling the aforementioned methods, using
a https://github.com/os-autoinst/openQA/blob/master/docs/WritingTests.asciidoc#how-to-write-tests[post_fail_hook] and setting the test's flags as fatal. The `save_memory_dump` method can be however
a https://github.com/os-autoinst/openQA/blob/master/docs/WritingTests.asciidoc#how-to-write-tests[post_fail_hook] and setting the test's flags as fatal. The `save_memory_dump` and `save_storage` methods can be however
called at any point within the test.

=== save_memory_dump
Expand All @@ -29,6 +29,14 @@ without any risk of data changing.

NOTE: Call this method to ensure memory and disk dump refer to the same machine state.


=== save_storage

If it is supported by the backend `save_storage` will save all storage devices into backup.
This can be called from anywhere within a test. For multiple calls within a test module a filename needs to be specified. By default it uses the test module name.

NOTE: This method is time-consuming and requires a lot of space.

== Examples

A very simple way to use this helpful feature is the following:
Expand All @@ -42,3 +50,8 @@ sub post_fail_hook ($self) {
sub test_flags ($) { { fatal => 1 } }
----------------------------------------

[source,perl]
----------------------------------------
save_storage(filename => 'my-backup');
----------------------------------------

0 comments on commit 1201cd7

Please sign in to comment.