1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-11-23 14:33:08 +00:00

Compare commits

...

3 Commits

Author SHA1 Message Date
Adam Williamson
15c344f00c Add several more tests to the desktop update test set
There's no obvious reason we're not also running these tests on
updates, so let's do it. We have to skip the advisory and UEFI
post checks for desktop_login as the last step of that test is
shutting down the system.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-09-26 09:00:49 -07:00
Adam Williamson
b870ec9bf3 Factor DM login process out of _graphical_wait_login
There are several other tests doing the same thing (but not as
safely, in some cases). To improve reliability and reduce
duplication, let's factor this out into utils.pm and reuse it
where appropriate.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-09-26 08:57:27 -07:00
sumantro93
7657b8bb16 Rename Dockerfile to Containerfile 2024-09-26 14:22:01 +02:00
9 changed files with 74 additions and 41 deletions

View File

@ -7,7 +7,7 @@ use Exporter;
use lockapi;
use testapi qw(is_serial_terminal :DEFAULT);
our @EXPORT = qw/run_with_error_check type_safely type_very_safely desktop_vt boot_to_login_screen console_login console_switch_layout desktop_switch_layout console_loadkeys_us do_bootloader boot_decrypt check_release menu_launch_type setup_repos repo_setup get_workarounds disable_updates_repos cleanup_workaround_repo console_initial_setup handle_welcome_screen gnome_initial_setup anaconda_create_user check_desktop quit_firefox advisory_get_installed_packages acnp_handle_output advisory_check_nonmatching_packages start_with_launcher quit_with_shortcut disable_firefox_studies select_rescue_mode copy_devcdrom_as_isofile get_release_number check_left_bar check_top_bar check_prerelease check_version spell_version_number _assert_and_click is_branched rec_log repos_mirrorlist register_application get_registered_applications solidify_wallpaper check_and_install_git download_testdata make_serial_writable set_update_notification_timestamp kde_doublek_workaround/;
our @EXPORT = qw/run_with_error_check type_safely type_very_safely desktop_vt boot_to_login_screen console_login console_switch_layout desktop_switch_layout console_loadkeys_us do_bootloader boot_decrypt check_release menu_launch_type setup_repos repo_setup get_workarounds disable_updates_repos cleanup_workaround_repo console_initial_setup handle_welcome_screen gnome_initial_setup anaconda_create_user check_desktop quit_firefox advisory_get_installed_packages acnp_handle_output advisory_check_nonmatching_packages start_with_launcher quit_with_shortcut disable_firefox_studies select_rescue_mode copy_devcdrom_as_isofile get_release_number check_left_bar check_top_bar check_prerelease check_version spell_version_number _assert_and_click is_branched rec_log repos_mirrorlist register_application get_registered_applications solidify_wallpaper check_and_install_git download_testdata make_serial_writable set_update_notification_timestamp kde_doublek_workaround dm_perform_login/;
# We introduce this global variable to hold the list of applications that have
@ -1777,4 +1777,36 @@ sub kde_doublek_workaround {
wait_still_screen 3;
}
# handle login at a graphical DM once we have reached the initial
# DM screen. Factored out of _graphical_wait_login for reuse by
# tests that reboot and need to login afterwards
sub dm_perform_login {
my ($desktop, $password) = @_;
# GDM 3.24.1 dumps a cursor in the middle of the screen here...
mouse_hide;
if ($desktop eq 'gnome') {
# we have to hit enter to get the password dialog, and it
# doesn't always work for some reason so just try it three
# times
send_key_until_needlematch("graphical_login_input", "ret", 3, 5);
}
assert_screen "graphical_login_input";
# seems like we often double-type on aarch64 if we start right
# away
wait_still_screen(stilltime => 5, similarity_level => 38);
if (get_var("SWITCHED_LAYOUT")) {
# see _do_install_and_reboot; when layout is switched
# user password is doubled to contain both US and native
# chars
desktop_switch_layout 'ascii';
type_very_safely $password;
desktop_switch_layout 'native';
type_very_safely $password;
}
else {
type_very_safely $password;
}
send_key "ret";
}
1;

View File

@ -352,11 +352,8 @@ sub load_postinstall_tests() {
}
# load the ADVISORY / KOJITASK post-install test - this records which
# update or task packages were actually installed during the test. Don't
# do this for netinst tests; as these just use the default install repo,
# they will not get the packages from the update. But installs from live
# image and ostree installer image should get them.
if (get_var("ADVISORY_OR_TASK") && get_var("TEST") ne "install_default_update_netinst") {
# update or task packages were actually installed during the test.
if (get_var("ADVISORY_OR_TASK") && !get_var("NO_ADVISORY_POST")) {
# don't do this for support server unless the update is for the same
# release as the support server disk image, as we don't install the
# updates on support server when they differ

View File

@ -351,12 +351,30 @@
"fedora-updates-workstation-x86_64-*-64bit": 5
}
},
"desktop_keyring": {
"profiles": {
"fedora-updates-kde-x86_64-*-64bit": 5,
"fedora-updates-workstation-x86_64-*-64bit": 5
}
},
"desktop_login": {
"profiles": {
"fedora-updates-kde-x86_64-*-64bit": 5,
"fedora-updates-workstation-x86_64-*-64bit": 5
}
},
"desktop_printing": {
"profiles": {
"fedora-updates-kde-x86_64-*-64bit": 5,
"fedora-updates-workstation-x86_64-*-64bit": 5
}
},
"desktop_printing_builtin": {
"profiles": {
"fedora-updates-kde-x86_64-*-64bit": 5,
"fedora-updates-workstation-x86_64-*-64bit": 5
}
},
"desktop_terminal": {
"profiles": {
"fedora-updates-kde-x86_64-*-64bit": 5,
@ -395,6 +413,7 @@
"INSTALL_UNLOCK": "support_ready",
"ISO": "%ADVISORY_OR_TASK%-netinst-%ARCH%.iso",
"NICTYPE": "tap",
"NO_ADVISORY_POST": "1",
"PACKAGE_SET": "default",
"PARALLEL_WITH": "support_server@%ARCH_BASE_MACHINE%",
"WORKER_CLASS": "tap"
@ -601,6 +620,11 @@
"fedora-updates-everything-boot-iso-x86_64-*-64bit": 5
}
},
"toolbox": {
"profiles": {
"fedora-updates-workstation-x86_64-*-64bit": 5
}
},
"upgrade_desktop_encrypted_64bit": {
"profiles": {
"fedora-updates-workstation-upgrade-x86_64-*-64bit": 5

View File

@ -932,6 +932,8 @@
"settings": {
"BOOTFROM": "c",
"HDD_1": "disk_%FLAVOR%_%MACHINE%.qcow2",
"NO_ADVISORY_POST": "1",
"NO_UEFI_POST": "1",
"POSTINSTALL": "desktop_login",
"START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%"
}

View File

@ -126,13 +126,6 @@ sub check_stored {
}
}
sub perform_login {
my $password = shift;
send_key("ret") if ($desktop eq "gnome");
type_very_safely("$password\n");
check_desktop;
}
sub run {
my $self = shift;
@ -142,7 +135,8 @@ sub run {
desktop_vt();
if (check_screen("login_screen", timeout => 30)) {
perform_login($pass);
dm_perform_login($desktop, $pass);
check_desktop;
}
# Lets connect to localhost via SSH. This should result in
@ -159,7 +153,8 @@ sub run {
# Boot to login screen and type in the password.
boot_to_login_screen();
perform_login($pass);
dm_perform_login($desktop, $pass);
check_desktop;
# Repeat the connection procedure, but skip the password
# handling process as this will be done by the keyring.

View File

@ -76,13 +76,6 @@ sub connect_localhost {
enter_cmd("exit");
}
sub perform_login {
my $password = shift;
send_key("ret") if ($desktop eq "gnome");
type_very_safely("$password\n");
check_desktop;
}
sub run {
my $self = shift;
@ -99,7 +92,8 @@ sub run {
# If we arrive to a login screen, perform login
if (check_screen("login_screen", timeout => 30)) {
perform_login($pass);
dm_perform_login($desktop, $pass);
check_desktop;
}
# Use SSH to connect to the localhost.
@ -110,7 +104,8 @@ sub run {
enter_cmd("reboot");
# Log in.
boot_to_login_screen();
perform_login($pass);
dm_perform_login($desktop, $pass);
check_desktop;
# Reconnect without using password. We still should be
# able to log in.

View File

@ -20,10 +20,7 @@ sub run {
# "Login with a reader, but no enrolled prints"
type_string "reboot\n";
assert_screen "graphical_login", 180;
mouse_hide;
send_key_until_needlematch("graphical_login_input", "ret", 3, 5);
type_very_safely "weakpassword";
send_key "ret";
dm_perform_login('gnome', 'weakpassword');
check_desktop(timeout => 60);
wait_still_screen 10;
$self->root_console(tty => 5);

View File

@ -77,19 +77,10 @@ sub run {
type_string "systemctl start graphical.target\n";
# we trust systemd to switch us to the right tty here
if (get_var("BOOTFROM")) {
my $password = get_var("USER_PASSWORD", "weakpassword");
assert_screen 'graphical_login', 60;
wait_still_screen 10, 30;
# GDM 3.24.1 dumps a cursor in the middle of the screen here...
mouse_hide;
if ($desktop eq 'gnome') {
# we have to hit enter to get the password dialog, and it
# doesn't always work for some reason so just try it three
# times
send_key_until_needlematch("graphical_login_input", "ret", 3, 5);
}
assert_screen "graphical_login_input";
type_very_safely get_var("USER_PASSWORD", "weakpassword");
send_key 'ret';
dm_perform_login($desktop, $password);
}
check_desktop(timeout => 90);
# now, WE WAIT. this is just an unconditional wait - rather than

View File

@ -27,8 +27,8 @@ sub run {
assert_script_run "podman pull registry.fedoraproject.org/fedora:latest", 300;
# run hello-world to test
validate_script_output "podman run -it registry.fedoraproject.org/fedora:latest echo Hello-World", sub { m/Hello-World/ };
# create a Dockerfile
assert_script_run 'printf \'FROM registry.fedoraproject.org/fedora:latest\nRUN /usr/bin/dnf install -y httpd\nEXPOSE 80\nCMD ["-D", "FOREGROUND"]\nENTRYPOINT ["/usr/sbin/httpd"]\n\' > Dockerfile';
# create a Containerfile
assert_script_run 'printf \'FROM registry.fedoraproject.org/fedora:latest\nRUN /usr/bin/dnf install -y httpd\nEXPOSE 80\nCMD ["-D", "FOREGROUND"]\nENTRYPOINT ["/usr/sbin/httpd"]\n\' > Containerfile';
# Build an image
assert_script_run 'podman build -t fedora-httpd $(pwd)', 180;
# Verify the image