Skip to content

Instantly share code, notes, and snippets.

@perlpunk
Created October 11, 2022 10:04
Show Gist options
  • Save perlpunk/cf9556cfba0e38420688d0e2067c5366 to your computer and use it in GitHub Desktop.
Save perlpunk/cf9556cfba0e38420688d0e2067c5366 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
# Copyright @ SUSE LLC
# SPDX-License-Identifier: GPL-2.0-or-later
use Test::Most;
use testapi;
use Test::MockModule;
use Test::MockObject;
subtest 'handle_password_prompt' => sub {
set_var('VIRTIO_CONSOLE', '1');
set_var('BACKEND', 'qemu');
my $self = Test::MockModule->new('testapi');
$self->mock('is_serial_terminal' => sub { return 1 });
$self->mock('type_string' => sub { return 'randompass' });
$self->noop('assert_screen');
require susedistribution;
ok susedistribution::handle_password_prompt();
};
done_testing;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment