2015-03-18 21:28:03 +00:00
|
|
|
package fedoradistribution;
|
2020-02-13 21:31:05 +00:00
|
|
|
|
|
|
|
use strict;
|
|
|
|
|
2015-03-18 21:28:03 +00:00
|
|
|
use base 'distribution';
|
2019-11-06 12:55:27 +00:00
|
|
|
use Cwd;
|
2015-03-18 21:28:03 +00:00
|
|
|
|
|
|
|
# Fedora distribution class
|
|
|
|
|
2015-08-05 06:23:59 +00:00
|
|
|
# Distro-specific functions, that are actually part of the API
|
|
|
|
# (and it's completely up to us to implement them) should be here
|
|
|
|
|
|
|
|
# functions that can be reimplemented:
|
|
|
|
# ensure_installed
|
|
|
|
# x11_start_program
|
|
|
|
# become_root
|
|
|
|
# script_sudo
|
|
|
|
# type_password
|
|
|
|
|
2016-10-20 16:24:48 +00:00
|
|
|
# importing whole testapi creates circular dependency, so import only
|
2016-02-10 08:42:56 +00:00
|
|
|
# necessary functions from testapi
|
2020-01-03 22:20:18 +00:00
|
|
|
use testapi qw(check_var get_var send_key type_string assert_screen);
|
2015-03-18 21:28:03 +00:00
|
|
|
|
|
|
|
sub init() {
|
|
|
|
my ($self) = @_;
|
|
|
|
|
|
|
|
$self->SUPER::init();
|
2019-11-20 16:39:28 +00:00
|
|
|
# Initialize the first virtio serial console as "virtio-console"
|
2019-11-06 12:55:27 +00:00
|
|
|
if (check_var('BACKEND', 'qemu')) {
|
2019-11-20 17:15:20 +00:00
|
|
|
$self->add_console('virtio-console', 'virtio_terminal', {});
|
2019-11-06 12:55:27 +00:00
|
|
|
for (my $num = 1; $num < get_var('VIRTIO_CONSOLE_NUM', 1); $num++) {
|
2019-11-20 16:39:28 +00:00
|
|
|
# initialize second virtio serial console as
|
|
|
|
# "virtio-console1", third as "virtio-console2" etc.
|
2019-11-20 17:15:20 +00:00
|
|
|
$self->add_console('virtio-console' . $num, 'virtio_terminal', {socked_path => cwd() . '/virtio_console' . $num});
|
2019-11-06 12:55:27 +00:00
|
|
|
}
|
|
|
|
}
|
2015-03-18 21:28:03 +00:00
|
|
|
}
|
|
|
|
|
2016-02-10 08:42:56 +00:00
|
|
|
sub x11_start_program {
|
2015-03-18 21:28:03 +00:00
|
|
|
my ($self, $program, $timeout, $options) = @_;
|
|
|
|
send_key "alt-f2";
|
2015-09-17 07:49:55 +00:00
|
|
|
assert_screen "desktop_runner";
|
2016-09-12 17:24:30 +00:00
|
|
|
type_string $program, 20;
|
2020-01-03 01:44:45 +00:00
|
|
|
sleep 5; # because of KDE dialog - SUSE guys are doing the same!
|
2015-03-18 21:28:03 +00:00
|
|
|
send_key "ret", 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
1;
|
|
|
|
# vim: set sw=4 et:
|