Skip to content

Commit

Permalink
testapi: Adapt check_screen timeout default to proposal in documentation
Browse files Browse the repository at this point in the history
The doc string of the method check_screen already suggested to use a timeout
of 0 seconds for a long time. This change adjusts the timeout to a default of
0 seconds. This can be considered a breaking change :)
  • Loading branch information
okurz committed May 24, 2018
1 parent 30f9688 commit 76b3ac6
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 61 deletions.
114 changes: 57 additions & 57 deletions doc/backend_vars.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,57 @@ Supported variables per backend
[options="header",cols="^m,^m,^m,v",separator=";"]
|====================
Variable;Values allowed;Default value;Explanation
EXCLUDE_MODULES;string;;comma separated names or fullnames of excluded test modules
_EXIT_AFTER_SCHEDULE;boolean;0;Exit test execution immediately after evaluation of the test schedule, e.g. to check only which test modules would be executed
_SKIP_POST_FAIL_HOOKS;boolean;0;Skip the execution of post_fail_hook methods if set. This can be useful to save test execution time during test development when the post_fail_hook is not expected to provide any value as most likely the test developer already knows what needs to be done as a next step on a test fail.
NOVIDEO;boolean;0;Do not encode video if set
NO_DEBUG_IO;boolean;0;Disable the I/O debug output in case of needle comparison times longer than expected
SCREENSHOTINTERVAL;float;0.5;The interval in seconds at which screenshots are taken internally
VNC_STALL_THRESHOLD;integer;4;Time after which is VNC considered stalled
VNC_TYPING_LIMIT;integer;50;Maximum number of keys per second
_CHKSEL_RATE_WAIT_TIME;integer;30;The ammount of time isotovideo is going to wait for the VNC console to become responsive
_CHKSEL_RATE_HITS;integer;15000;The ammount of times, the select should return the same fileno during the _CHKSEL_RATE_WAIT_TIME seconds, to consider the VNC console unresponsive
TIMEOUT_SCALE;integer;1;This scale parameter can be used based on performance of workers to prevent false positive timeouts based on differing worker performance.
_CHKSEL_RATE_WAIT_TIME;integer;30;The ammount of time isotovideo is going to wait for the VNC console to become responsive
|====================
.IKVM backend
[grid="rows",format="csv"]
[options="header",cols="^m,^m,^m,v",separator=";"]
|====================
Variable;Values allowed;Default value;Explanation
IPMI_HOSTNAME;;;
IPMI_HW;;;
IPMI_PASSWORD;;;
IPMI_USER;;;
|====================
.IPMI backend
[grid="rows",format="csv"]
[options="header",cols="^m,^m,^m,v",separator=";"]
|====================
Variable;Values allowed;Default value;Explanation
IPMI_DO_NOT_POWER_OFF;boolean;undef;Don't power off the machine after test
IPMI_HOSTNAME;string;Hostname/IP for IPMI interface;
IPMI_HW;;;
IPMI_PASSWORD;string;Password for the IPMI interface;
IPMI_USER;string;Username for the IPMI interface;
IPMI_DO_NOT_POWER_OFF;boolean;undef;Don't power off the machine after test
|====================
.PVM backend
[grid="rows",format="csv"]
[options="header",cols="^m,^m,^m,v",separator=";"]
|====================
Variable;Values allowed;Default value;Explanation
ARCH;;;
CPUS;integer;1;Number of CPUS for LPAR
HDDSIZEGB;integer;15;Disk size in GB
HDD_$hdd_num;;;
HDD_$i;;;
ISO;;;
LPAR;string;osauto;LPAR name to be created
LPARID;;;
MEM;integer;2048;amount of RAM
NIC;;;
NICVLAN;integer;1;VLAN to attach to
NUMDISKS;integer;1;Number of disks
VIOISO;;;
VNC;;;
VSWITCH;string;VSWITCH0;A virtula switch to connect to
WORKER_ID;;;
|====================

.QEMU backend
Expand All @@ -37,20 +65,20 @@ IPMI_DO_NOT_POWER_OFF;boolean;undef;Don't power off the machine after test
|====================
Variable;Values allowed;Default value;Explanation
ARCH;x86_64|i686|aarch64|...;depends on tested medium;Architecture of VM.
AUTO_INST;;;
ATACONTROLLER;see qemu -device ?, e. g. for SATA: ich9-ahci;;Controller for ATA devices, needed for connecting disks as SATA.
AUTO_INST;;;
BIOS;;;
BOOT_HDD_IMAGE;boolean;;enables boot from HDD_1 (BOOTFROM has higher priority)
BOOTFROM;chars;undef;Influences order of boot devices. See qemu -boot option
BOOT_HDD_IMAGE;boolean;;enables boot from HDD_1 (BOOTFROM has higher priority)
CDMODEL;see qemu -device ?;undef;Storage device for virtualized CD
DELAYED_START;boolean;;delay vm cpu start until resume_vm() is called
HDDFORMAT;;;
HDDMODEL;see qemu -device ?;virtio-blk;Storage device for virtualized HDD.
HDDMODEL_$i;see qemu -device ?;virtio-blk;Storage device for virtualized HDD. Overrides global HDDMODEL for HDD_$i
HDDSIZEGB;integer;10;Creates HDD with specified size in GiB
HDDSIZEGB_$i;;;
HDD_$i;filename;;Filename of HDD image to be used for VM. Up to 9
ISO;filename;;Filename of ISO file to be attached to VM
ISO_$i;filename;;Aditional ISO to be attached to VM. Up to 9
KEEPHDDS;boolean;;Leave created HDD after test finishes. Useful for debugging tests
LAPTOP;boolean or filename;0;If 1, loads Dell E6330 DMI. If filename, loads specified DMI
MAKETESTSNAPSHOTS;boolean;0;Save snapshot for each test module in qcow image
Expand All @@ -65,8 +93,7 @@ NICVLAN;integer;undef;network (vlan) number to which the NIC should be connected
NUMDISKS;integer;1;Number of disks to be created and attached to VM
OFFLINE_SUT;boolean;0;Disable network for a VM
OFW;;;
QEMU_OVERRIDE_VIDEO_DEVICE_AARCH64;boolean;undef;If set, for aarch64 systems use VGA as video adapter
QEMU_DISABLE_SNAPSHOTS;boolean;undef;If set, disable snapshots in case the worker has slow disks to avoid save_vm calls failing due to timeouts (See https://bugzilla.suse.com/show_bug.cgi?id=1035453[bsc#1035453])
OVS_DEBUG;;;
PATHCNT;integer;2;Number of paths in MULTIPATH scenario
PXEBOOT;boolean;0;Boot VM from network
QEMU;QEMU binary filename;undef;Filename of QEMU binary to use
Expand All @@ -77,80 +104,53 @@ QEMUPORT;integer;20002 + worker instance * 10;Port on which QEMU monitor should
QEMURAM;integer;1024;Size of RAM of VM in MiB
QEMUTHREADS;integer;0;Number of cpu threads used by VM
QEMUVGA;see qemu -device ?;cirrus;VGA device to use with VM
QEMU_COMPRESS_LEVEL;;;
QEMU_COMPRESS_METHOD;;;
QEMU_COMPRESS_QCOW2;boolean;1;compress qcow2 images intended for upload
QEMU_DISABLE_SNAPSHOTS;boolean;undef;If set, disable snapshots in case the worker has slow disks to avoid save_vm calls failing due to timeouts (See https://bugzilla.suse.com/show_bug.cgi?id=1035453[bsc#1035453])
QEMU_MAX_BANDWIDTH;;;
QEMU_NO_FDC_SET;boolean;0;Don't disable the floppy drive.
QEMU_NO_KVM;boolean;0;Don't use KVM acceleration.
QEMU_NO_TABLET;boolean;0;Don't use USB tablet.
QEMU_VIRTIO_RNG;boolean;0;Enable virtio random number generator
QEMU_NUMA;boolean;0;Enable NUMA simulation, requires QEMUCPUS to be greater than one
QEMU_OVERRIDE_VIDEO_DEVICE_AARCH64;boolean;undef;If set, for aarch64 systems use VGA as video adapter
QEMU_SMBIOS;see qemu -smbios ?;undef;pass this value to qemu -smbios
QEMU_VIRTIO_RNG;boolean;0;Enable virtio random number generator
RAIDLEVEL;;;
SCSICONTROLLER;;;
SKIPTO;full name of test module;;Restore VM from snapshot and continue by running specified test module. Needs HDD image with snapshots present
TAPDEV;device name;undef;TAP device name to which virtual NIC should be connected. Usually undef so automatic matching is used
TAPDOWNSCRIPT;;;
TAPSCRIPT;;;
TESTDEBUG;boolean;0;Enable test debugging: override 'milestone' and 'fatal' test flags to 1. Snapshot are created after each successful test module and each fail aborts test run
UEFI;;;
UEFI_PFLASH;boolean;0;Enable the pflash mode to write the UEFI variables directly into the firmware file instead of NVvars in the EFI system partition
UEFI_BIOS;;;
UEFI_PFLASH;boolean;0;Enable the pflash mode to write the UEFI variables directly into the firmware file instead of NVvars in the EFI system partition
USBBOOT;boolean;0;Mount ISO as USB disk and boot VM from it
VDE_PORT;integer;worker instance + 10;number of vde switch port to connect
VDE_SOCKETDIR;string;.;directory where vde_switch control socket is to be found
VDE_USE_SLIRP;integer;1;whether to start slirpvde
VIRTIO_CONSOLE;;;
VNC;integer;worker instance + 90;Display on which VNC server is running. Actual port is 5900 + VNC
VNCKB;;;
WORKER_CLASS;;;
WORKER_HOSTNAME;;;
|====================

.SVIRT backend
[grid="rows",format="csv"]
[options="header",cols="^m,^m,^m,v",separator=";"]
|====================
Variable;Values allowed;Default value;Explanation
HDDSIZEGB;integer;15;Disk size in GB
QEMUCPUS;integer;1;Number of CPUs to assign to VM
QEMURAM;integer;1024;Size of RAM of VM in MiB
VIRSH_HOSTNAME;string;SSH Host with virtsh;
VIRSH_PASSWORD;string;Password for root account on above host;
VIRSH_VMM_FAMILY;string;Host's hypervisor ('kvm', 'xen');
VIRSH_VMM_TYPE;string;Host's hypervisor type ('hvm' for full virtualization on 'kvm' and 'xen' families, 'linux' for paravirtualization on 'xen' family);
VIRSH_GUEST;string;Where to look for VNC server (SUT or VM);
VIRSH_INSTANCE;integer;VM's instance number on VIRSH_HOSTNAME;
VMWARE_USERNAME;string;Administrator's username ('@' is '%40');
VMWARE_PASSWORD;string;Administrator's password;
VMWARE_HOST;string;VCS server for autentication;
VMWARE_DATACENTER;string;VMware datacenter;
VMWARE_SERVER;string;ESX server to start VM on;
VMWARE_DATASTORE;string;VMware datastore;
VMWARE_SERIAL_PORT;string;TCP port where is VM's serial port stream to be expected on the ESX server;
VMWARE_BRIDGE;string;VMware's bridge name (usual default is 'VM Network');
HYPERV_USERNAME;string;Administrator account name;
HYPERV_PASSWORD;string;Password for above account;
HYPERV_SERVER;string;Windows Server (2008 R2, 2012 R2, or 2016) instance IP address;
HYPERV_SERIAL_PORT;integer;TCP port where is VM's serial port stream to be expected on the Hyper-V server;
HYPERV_VIRTUAL_SWITCH;string;ExternalVirtualSwitch;Name of Hyper-V's External Virtual Switch;
NUMDISKS;;;
RAIDLEVEL;;;
|====================

.PVM backend
.VIRT backend
[grid="rows",format="csv"]
[options="header",cols="^m,^m,^m,v",separator=";"]
|====================
Variable;Values allowed;Default value;Explanation
MEM;integer;2048;amount of RAM
LPAR;string;osauto;LPAR name to be created
NUMDISKS;integer;1;Number of disks
HDDSIZEGB;integer;15;Disk size in GB
NICVLAN;integer;1;VLAN to attach to
VSWITCH;string;VSWITCH0;A virtula switch to connect to
CPUS;integer;1;Number of CPUS for LPAR
QEMUCPUS;;;
QEMURAM;;;
|====================

.GENERAL_HW backend
[grid="rows",format="csv"]
[options="header",cols="^m,^m,^m,v",separator=";"]
|====================
Variable;Values allowed;Default value;Explanation
GENERAL_HW_VNC_IP;string;;Hostname of the gadget's network
GENERAL_HW_CMD_DIR;string;;Directory with allowed CMD scripts
GENERAL_HW_SOL_CMD;string;;Shell Script to output serial output (in CMD_DIR)
GENERAL_HW_POWERON_CMD;string;;Shell Command to power on the SUT (in CMD_DIR)
GENERAL_HW_POWEROFF_CMD;string;;Shell Command to power off the SUT (in CMD_DIR)
|====================
2 changes: 1 addition & 1 deletion isotovideo
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ BEGIN {

# this shall be an integer increased by every change of the API
# either to the worker or the tests
our $INTERFACE = 11;
our $INTERFACE = 12;

use bmwqemu;
use needle;
Expand Down
2 changes: 1 addition & 1 deletion t/03-testapi.t
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ subtest 'check_assert_screen' => sub {
stderr_like { assert_screen('foo', 3, timeout => 2) } qr/timeout=2/, 'named over positional';
stderr_like { assert_screen('foo') } qr/timeout=30/, 'default timeout';
stderr_like { assert_screen('foo', no_wait => 1) } qr/no_wait=1/, 'no wait option';
stderr_like { check_screen('foo') } qr/timeout=30/, 'check_screen with same default timeout';
stderr_like { check_screen('foo') } qr/timeout=0/, 'check_screen with timeout of 0';
stderr_like { check_screen('foo', 42) } qr/timeout=42/, 'check_screen with timeout variable';
};

Expand Down
4 changes: 2 additions & 2 deletions testapi.pm
Original file line number Diff line number Diff line change
Expand Up @@ -363,15 +363,15 @@ can be replaced by C<assert_screen> with multiple tags using an C<ARRAYREF> in
combination with C<match_has_tag> or another synchronization call in before,
for example C<wait_screen_change> or C<wait_still_screen>.
Returns matched needle or C<undef> if timeout is hit. Default timeout is 30s.
Returns matched needle or C<undef> if timeout is hit. Default timeout is 0s.
=cut

sub check_screen {
my ($mustmatch) = shift;
my $timeout;
$timeout = shift if (@_ % 2);
my %args = (timeout => $timeout // $bmwqemu::default_timeout, @_);
my %args = (timeout => $timeout // 0, @_);
bmwqemu::log_call(mustmatch => $mustmatch, %args);
return _check_or_assert($mustmatch, 1, %args);
}
Expand Down

0 comments on commit 76b3ac6

Please sign in to comment.