mirror of
https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git
synced 2024-11-23 14:33:08 +00:00
Compare commits
4 Commits
7429b438fd
...
ffab8bce75
Author | SHA1 | Date | |
---|---|---|---|
|
ffab8bce75 | ||
|
6e9213f4b7 | ||
|
ffbb618d03 | ||
|
f915297475 |
@ -158,12 +158,13 @@ sub post_fail_hook {
|
||||
upload_logs "/var/tmp/imgbuild/lorax.log", failok => 1;
|
||||
upload_logs "/var/tmp/imgbuild/program.log", failok => 1;
|
||||
}
|
||||
}
|
||||
|
||||
# For update tests, let's do the update package info log stuff,
|
||||
# it may be useful for diagnosing the cause of the failure
|
||||
advisory_get_installed_packages;
|
||||
advisory_check_nonmatching_packages(fatal => 0);
|
||||
# For update tests, let's do the update package info log stuff,
|
||||
# it may be useful for diagnosing the cause of the failure
|
||||
advisory_get_installed_packages;
|
||||
advisory_check_nonmatching_packages(fatal => 0);
|
||||
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
21
lib/utils.pm
21
lib/utils.pm
@ -553,7 +553,7 @@ sub _repo_setup_compose {
|
||||
sub _repo_setup_updates {
|
||||
# Appropriate repo setup steps for testing a Bodhi update
|
||||
# Check if we already ran, bail if so
|
||||
return if (get_var("_ADVISORY_REPO_DONE"));
|
||||
return unless script_run "test -f /mnt/updatepkgs.txt";
|
||||
my $version = get_var("VERSION");
|
||||
my $currrel = get_var("CURRREL", "0");
|
||||
my $arch = get_var("ARCH");
|
||||
@ -677,9 +677,6 @@ sub _repo_setup_updates {
|
||||
type_string "exit\n";
|
||||
wait_still_screen 5;
|
||||
}
|
||||
# mark via a variable that we've set up the update/task repo and done
|
||||
# all the logging stuff above
|
||||
set_var('_ADVISORY_REPO_DONE', '1');
|
||||
}
|
||||
|
||||
sub repo_setup {
|
||||
@ -1106,12 +1103,14 @@ sub quit_with_shortcut {
|
||||
|
||||
}
|
||||
|
||||
# For update tests (this only works if we've been through
|
||||
# _repo_setup_updates), figure out which packages from the update
|
||||
# are currently installed. This is here so we can do it both in
|
||||
# _advisory_post and post_fail_hook.
|
||||
sub advisory_get_installed_packages {
|
||||
# For update tests (this only works if we've been through
|
||||
# _repo_setup_updates), figure out which packages from the update
|
||||
# are currently installed. This is here so we can do it both in
|
||||
# _advisory_post and post_fail_hook.
|
||||
return unless (get_var("_ADVISORY_REPO_DONE"));
|
||||
# bail out if the file doesn't exist: this is in case we get
|
||||
# here in the post-fail hook but we failed before creating it
|
||||
return if script_run "test -f /mnt/updatepkgs.txt";
|
||||
assert_script_run 'rpm -qa --qf "%{SOURCERPM} %{EPOCH} %{NAME}-%{VERSION}-%{RELEASE}\n" | sort -u > /tmp/allpkgs.txt', timeout => 90;
|
||||
# this finds lines which appear in both files
|
||||
# http://www.unix.com/unix-for-dummies-questions-and-answers/34549-find-matching-lines-between-2-files.html
|
||||
@ -1137,7 +1136,9 @@ sub advisory_check_nonmatching_packages {
|
||||
fatal => 1,
|
||||
@_
|
||||
);
|
||||
return unless (get_var("_ADVISORY_REPO_DONE"));
|
||||
# bail out if the file doesn't exist: this is in case we get
|
||||
# here in the post-fail hook but we failed before creating it
|
||||
return if script_run "test -f /mnt/updatepkgnames.txt";
|
||||
# if this fails in advisory_post, we don't want to do it *again*
|
||||
# unnecessarily in post_fail_hook
|
||||
return if (get_var("_ACNMP_DONE"));
|
||||
|
8
main.pm
8
main.pm
@ -295,9 +295,11 @@ sub load_postinstall_tests() {
|
||||
# install the updates to be tested). Don't do this for UPGRADE tests, as
|
||||
# the update gets installed as part of the upgrade in that case and we
|
||||
# don't need the extra reboot. Don't do this for INSTALL test(s); these
|
||||
# are checking that an installer image built from the update works and do
|
||||
# not install the update themselves in this manner
|
||||
if (get_var("ADVISORY_OR_TASK") && !get_var("UPGRADE") && !get_var("INSTALL")) {
|
||||
# are checking that an installer image built from the update works, and
|
||||
# packages from the update should have been installed as part of the
|
||||
# install process. Don't do this for START_AFTER_TEST tests, as there we
|
||||
# presume the previous test already did this, and it saves a reboot.
|
||||
if (get_var("ADVISORY_OR_TASK") && !get_var("UPGRADE") && !get_var("INSTALL") && !get_var("START_AFTER_TEST")) {
|
||||
autotest::loadtest "tests/_advisory_update.pm";
|
||||
# now load the early boot tests again, as _advisory_update reboots
|
||||
_load_early_postinstall_tests(2);
|
||||
|
@ -87,31 +87,27 @@ sub run {
|
||||
}
|
||||
}
|
||||
|
||||
# For GNOME, handle initial-setup or welcome tour, unless START_AFTER_TEST
|
||||
# is set in which case it will have been done already. Always
|
||||
# do it if ADVISORY_OR_TASK is set, as for the update testing flow,
|
||||
# START_AFTER_TEST is set but a no-op and this hasn't happened
|
||||
if ($desktop eq 'gnome' && (get_var("ADVISORY_OR_TASK") || !get_var("START_AFTER_TEST"))) {
|
||||
# as this test gets loaded twice on the ADVISORY_OR_TASK flow, and
|
||||
# we might be on the INSTALL_NO_USER flow, check whether
|
||||
# this happened already
|
||||
handle_welcome_screen unless (get_var("_WELCOME_DONE"));
|
||||
}
|
||||
if ($desktop eq 'gnome' && get_var("INSTALL_NO_USER")) {
|
||||
# handle welcome screen if we didn't do it above (holy flow
|
||||
# control, Batman!)
|
||||
handle_welcome_screen unless (get_var("_WELCOME_DONE"));
|
||||
# For GNOME, handle initial-setup or welcome tour, unless _WELCOME_DONE
|
||||
# is set (indicating it's been done previously within this test run,
|
||||
# e.g. the second time this module runs on the update flow, or earlier
|
||||
# in the boot process on the INSTALL_NO_USER flow), or START_AFTER_TEST
|
||||
# is set to the same value as DEPLOY_UPLOAD_TEST (in which case it will
|
||||
# have been done by the previous test run)
|
||||
# the point of the default values here is to make the check fail if
|
||||
# neither var is set, without needing an extra condition
|
||||
my $sat = get_var("START_AFTER_TEST", "1");
|
||||
my $dut = get_var("DEPLOY_UPLOAD_TEST", "2");
|
||||
handle_welcome_screen if ($desktop eq 'gnome' && $sat ne $dut && !get_var("_WELCOME_DONE"));
|
||||
if (get_var("IMAGE_DEPLOY")) {
|
||||
# if this was an image deployment, we also need to create
|
||||
# root user now, for subsequent tests to work
|
||||
if (get_var("IMAGE_DEPLOY")) {
|
||||
send_key "ctrl-alt-f3";
|
||||
console_login(user => get_var("USER_LOGIN", "test"), password => get_var("USER_PASSWORD", "weakpassword"));
|
||||
type_string "sudo su\n";
|
||||
type_string "$password\n";
|
||||
my $root_password = get_var("ROOT_PASSWORD") || "weakpassword";
|
||||
assert_script_run "echo 'root:$root_password' | chpasswd";
|
||||
desktop_vt;
|
||||
}
|
||||
send_key "ctrl-alt-f3";
|
||||
console_login(user => get_var("USER_LOGIN", "test"), password => get_var("USER_PASSWORD", "weakpassword"));
|
||||
type_string "sudo su\n";
|
||||
type_string "$password\n";
|
||||
my $root_password = get_var("ROOT_PASSWORD") || "weakpassword";
|
||||
assert_script_run "echo 'root:$root_password' | chpasswd";
|
||||
desktop_vt;
|
||||
}
|
||||
|
||||
# Move the mouse somewhere it won't highlight the match areas
|
||||
|
@ -23,7 +23,9 @@ sub run {
|
||||
unless ($version > $currrel) {
|
||||
$cmd .= " --isfinal --repo=/etc/yum.repos.d/fedora-updates.repo";
|
||||
}
|
||||
$cmd .= " --repo=/etc/yum.repos.d/advisory.repo --repo=/etc/yum.repos.d/workarounds.repo ./results";
|
||||
$cmd .= " --repo=/etc/yum.repos.d/advisory.repo --repo=/etc/yum.repos.d/workarounds.repo";
|
||||
$cmd .= " --repo=/etc/yum.repos.d/koji-rawhide.repo" if ($version eq $rawrel);
|
||||
$cmd .= " ./results";
|
||||
assert_script_run $cmd, 2400;
|
||||
# good to have the log around for checks
|
||||
upload_logs "pylorax.log", failok => 1;
|
||||
|
@ -44,9 +44,15 @@ sub run {
|
||||
assert_script_run 'echo "config_opts[\'plugin_conf\'][\'bind_mount_opts\'][\'dirs\'].append((\'/mnt/workarounds_repo\', \'/mnt/workarounds_repo\'))" >> /etc/mock/openqa.cfg';
|
||||
assert_script_run 'echo "config_opts[\'plugin_conf\'][\'bind_mount_opts\'][\'dirs\'].append((\'/dev/' . $serialdev . '\', \'/dev/' . $serialdev . '\'))" >> /etc/mock/openqa.cfg';
|
||||
# add the side repo and workarounds to the config
|
||||
assert_script_run 'printf "config_opts[\'dnf.conf\'] += \"\"\"\n[advisory]\nname=Advisory repo\nbaseurl=file:///mnt/update_repo\nenabled=1\nmetadata_expire=3600\ngpgcheck=0\n\n[workarounds]\nname=Workarounds repo\nbaseurl=file:///mnt/workarounds_repo\nenabled=1\nmetadata_expire=3600\ngpgcheck=0\n\"\"\"" >> /etc/mock/openqa.cfg';
|
||||
my $repos = 'config_opts[\'dnf.conf\'] += \"\"\"\n[advisory]\nname=Advisory repo\nbaseurl=file:///mnt/update_repo\nenabled=1\nmetadata_expire=3600\ngpgcheck=0\n\n[workarounds]\nname=Workarounds repo\nbaseurl=file:///mnt/workarounds_repo\nenabled=1\nmetadata_expire=3600\ngpgcheck=0\n';
|
||||
# also the buildroot repo, for Rawhide
|
||||
if ($version eq $rawrel) {
|
||||
$repos .= '\n[koji-rawhide]\nname=Buildroot repo\nbaseurl=https://kojipkgs.fedoraproject.org/repos/rawhide/latest/\$basearch/\nenabled=1\nmetadata_expire=3600\ngpgcheck=0\n';
|
||||
}
|
||||
$repos .= '\"\"\"';
|
||||
assert_script_run 'printf "' . $repos . '" >> /etc/mock/openqa.cfg';
|
||||
# replace metalink with mirrorlist so we don't get slow mirrors
|
||||
repos_mirrorlist("/etc/mock/openqa.cfg");
|
||||
repos_mirrorlist("/etc/mock/templates/*.tpl");
|
||||
# upload the config so we can check it's OK
|
||||
upload_logs "/etc/mock/openqa.cfg";
|
||||
# now check out the kickstarts
|
||||
@ -57,6 +63,10 @@ sub run {
|
||||
assert_script_run 'echo "repo --name=advisory --baseurl=file:///mnt/update_repo" >> ' . $repoks;
|
||||
# and the workarounds repo
|
||||
assert_script_run 'echo "repo --name=workarounds --baseurl=file:///mnt/workarounds_repo" >> ' . $repoks;
|
||||
# and the buildroot repo, for Rawhide
|
||||
if ($version eq $rawrel) {
|
||||
assert_script_run 'echo "repo --name=koji-rawhide --baseurl=https://kojipkgs.fedoraproject.org/repos/rawhide/latest/\$basearch/" >> ' . $repoks;
|
||||
}
|
||||
# FIXME: this is a workaround for #2119518, disabling oomd so it
|
||||
# doesn't go crazy killing things
|
||||
my $relnum = get_release_number;
|
||||
|
@ -38,11 +38,14 @@ sub run {
|
||||
assert_script_run 'git clone https://pagure.io/workstation-ostree-config.git';
|
||||
assert_script_run 'pushd workstation-ostree-config';
|
||||
assert_script_run "git checkout ${branch}";
|
||||
# now copy the advisory and workaround repo config files in
|
||||
# now copy the advisory, workaround repo and koji-rawhide config files
|
||||
assert_script_run 'cp /etc/yum.repos.d/advisory.repo .';
|
||||
assert_script_run 'cp /etc/yum.repos.d/workarounds.repo .';
|
||||
assert_script_run 'cp /etc/yum.repos.d/koji-rawhide.repo .' if ($version eq $rawrel);
|
||||
# and add them to the config file
|
||||
assert_script_run 'sed -i -e "s,repos:,repos:\n - advisory\n - workarounds,g" fedora-' . $lcsubv . '.yaml';
|
||||
my $repl = 'repos:\n - advisory\n - workarounds';
|
||||
$repl .= '\n - koji-rawhide' if ($version eq $rawrel);
|
||||
assert_script_run 'sed -i -e "s,repos:,' . $repl . ',g" fedora-' . $lcsubv . '.yaml';
|
||||
# upload the config so we can check it
|
||||
upload_logs "fedora-$lcsubv.yaml";
|
||||
assert_script_run 'popd';
|
||||
|
Loading…
Reference in New Issue
Block a user