os-autoinst-distri-rocky/tests/base_update_cli.pm
Adam Williamson 44ec3d84c3 add a base_update_cli test
Summary:
this uses a couple of test repos with fake packages to test the
basic dnf mechanisms are working, then messes around with the
python3-kickstart package a bit to try and test the default repo
configuration is working, keys are in place and so on. We use
python3-kickstart because we should be able to rely on the copy
of that package in the 'stable' repo being installable (or else
the compose would have failed), but it shouldn't be vital to
the operation of the system.

Test Plan: Run the test, see if it works.

Reviewers: jskladan, garretraziel

Reviewed By: garretraziel

Subscribers: tflink

Differential Revision: https://phab.qadevel.cloud.fedoraproject.org/D1006
2016-09-22 10:57:12 -07:00

39 lines
1.4 KiB
Perl

use base "installedtest";
use strict;
use testapi;
use packagetest;
sub run {
my $self = shift;
# wait for boot to complete
$self->boot_to_login_screen("", 30);
# switch to TTY3 for both, graphical and console tests
$self->root_console(tty=>3);
# enable test repos and install test packages
prepare_test_packages;
# check rpm agrees they installed good
verify_installed_packages;
# update the fake python3-kickstart (should come from the real repo)
# this can take a long time if we get unlucky with the metadata refresh
assert_script_run 'dnf -y --disablerepo=openqa-testrepo* --disablerepo=updates-testing update python3-kickstart', 600;
# check we got the updated version
verify_updated_packages;
# now remove python3-kickstart, and see if we can do a straight
# install from the default repos
assert_script_run 'dnf -y remove python3-kickstart';
assert_script_run 'dnf -y --disablerepo=openqa-testrepo* --disablerepo=updates-testing install python3-kickstart', 120;
assert_script_run 'rpm -V python3-kickstart';
}
sub test_flags {
# without anything - rollback to 'lastgood' snapshot if failed
# 'fatal' - whole test suite is in danger if this fails
# 'milestone' - after this test succeeds, update 'lastgood'
# 'important' - if this fails, set the overall state to 'fail'
return { fatal => 1 };
}
1;
# vim: set sw=4 et: