-
Notifications
You must be signed in to change notification settings - Fork 283
/
Copy pathinstallation_user_settings.pm
55 lines (46 loc) · 1.38 KB
/
installation_user_settings.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# SUSE's openQA tests
#
# Copyright 2016-2020 SUSE LLC
# SPDX-License-Identifier: FSFAP
# Summary: Check for password security
# Maintainer: Oliver Kurz <[email protected]>
package installation_user_settings;
use parent Exporter;
use strict;
use warnings;
use testapi;
use Utils::Architectures;
use Utils::Backends;
use version_utils 'is_sle';
use utils 'type_string_slow';
our @EXPORT = qw(type_password_and_verification await_password_check enter_userinfo enter_rootinfo);
sub type_password_and_verification {
for (1 .. 2) {
wait_screen_change { type_string "$password\t" };
}
}
sub await_password_check {
# PW too easy (cracklib)
# bsc#937012 is resolved in > SLE 12, skip if VERSION=12
return if (is_sle('=12') && is_s390x);
assert_screen('inst-userpasswdtoosimple', (is_pvm_hmc) ? 60 : 30);
send_key 'ret';
}
sub enter_userinfo {
my (%args) = @_;
$args{username} //= $realname;
$args{max_interval} //= undef;
send_key 'alt-f'; # Select full name text field
wait_screen_change { type_string($args{username}, max_interval => $args{max_interval}); };
send_key 'tab'; # Select password field
send_key 'tab';
type_password_and_verification;
}
sub enter_rootinfo {
assert_screen "inst-rootpassword";
type_password_and_verification;
assert_screen "rootpassword-typed";
send_key $cmd{next};
await_password_check;
}
1;