-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Capture installed and uninstalled packages during test
- Loading branch information
Showing
20 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ schedule: | |
- installation/bootloader_start | ||
- boot/boot_to_desktop | ||
- console/clamav | ||
- console/zypper_log_packages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ schedule: | |
- boot/boot_to_desktop | ||
- console/dracut | ||
- console/coredump_collect | ||
- console/zypper_log_packages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,4 @@ schedule: | |
- console/journalctlLevels | ||
- console/perf | ||
- '{{tw_tests}}' | ||
- console/zypper_log_packages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,4 @@ schedule: | |
- qemu/qemu | ||
- '{{kvm}}' | ||
- '{{user}}' | ||
- console/zypper_log_packages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -170,3 +170,4 @@ schedule: | |
- '{{tumbleweed_tests}}' | ||
- console/tar | ||
- console/coredump_collect | ||
- console/zypper_log_packages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ schedule: | |
- boot/boot_to_desktop | ||
- console/gdb | ||
- console/coredump_collect | ||
- console/zypper_log_packages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,4 @@ schedule: | |
- x11/toolkits/qt5 | ||
- x11/toolkits/swing | ||
- console/coredump_collect | ||
- console/zypper_log_packages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ schedule: | |
- console/prepare_test_data | ||
- console/django | ||
- console/flask | ||
- console/zypper_log_packages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# SUSE's openQA tests | ||
# | ||
# Copyright 2022 SUSE LLC | ||
# SPDX-License-Identifier: FSFAP | ||
|
||
# Package: zypper | ||
# Summary: gather info about installed/removed packages during the test | ||
# Maintainer: Dominik Heidler <dheidler@suse.de> | ||
|
||
use base "consoletest"; | ||
use strict; | ||
use warnings; | ||
use testapi; | ||
use utils; | ||
|
||
use Mojo::UserAgent; | ||
use Mojo::JSON qw(to_json); | ||
|
||
sub run { | ||
my $self = shift; | ||
$self->select_serial_terminal; | ||
my $zypper_packages = {}; | ||
$zypper_packages->{commands} = $testapi::distri->{zypper_packages} // []; | ||
my $individual_pkgs = script_output('grep "|\(Installing:\|Removing\) .*} END" /var/log/zypper.log', proceed_on_failure => 1); | ||
# this looks like this: | ||
# 2022-08-05 12:18:55 <1> athene(13626) [Progress++] progressdata.cc(report):89 {#24|Installing: xosview-1.22-1.10.x86_64} END | ||
# 2022-08-05 12:19:48 <1> athene(13993) [Progress++] progressdata.cc(report):89 {#21|Removing xosview-1.22-1.10.x86_64} END | ||
while ($individual_pkgs =~ m/\|([A-Z][a-z]*):? ([^}]*)}/g) { | ||
my $action; | ||
if ($1 eq "Installing") { $action = "install"; } | ||
elsif ($1 eq "Removing") { $action = "remove"; } | ||
$2 =~ m/(.+)-([^-]+)-([^-]+)\.([^.]+)/; | ||
push(@{$zypper_packages->{individual_pkgs}}, { | ||
action => $action, | ||
package => $1, | ||
version => $2, | ||
release => $3, | ||
arch => $4, | ||
}); | ||
} | ||
|
||
my $ua = Mojo::UserAgent->new; | ||
my $res = $ua->post(autoinst_url("/uploadlog/zypper_packages.json") => form => { | ||
upload => {content => to_json($zypper_packages)}, | ||
uname => "zypper_packages.json" | ||
})->result; | ||
record_info('zypper_packages.json', 'zypper_packages.json was uploaded via worker', result => ($res->is_success) ? 'ok' : 'fail'); | ||
} | ||
|
||
1; |