From d94fefb095565cdbda9fdf68bad5d19508ff6cd6 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Mon, 28 Aug 2017 22:56:34 +0100 Subject: Add one more test for emi --- t/emi_finisher.t | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/t/emi_finisher.t b/t/emi_finisher.t index c34ce2a..e710732 100644 --- a/t/emi_finisher.t +++ b/t/emi_finisher.t @@ -68,6 +68,36 @@ my %pkg_tree = ( '@922855:iurt-test-package-1.4.0-2.mga6.src.rpm', ], }, + '20160113183432.nobody.valstar.23516' => { + 'target' => 'cauldron', + 'media' => { + 'core/release' => { + 'uploaded' => 1, + 'done_arch' => { + 'armv5tl' => 1, + 'i586' => 1, + 'x86_64' => 1, + 'src' => 1 + }, + 'rpms' => [ + 'iurt-test-package-debuginfo-1.4.0-2.mga6.armv5tl.rpm', + 'iurt-test-package-1.4.0-2.mga6.armv5tl.rpm', + 'iurt-test-package-doc-1.4.0-2.mga6.noarch.rpm', + '@922855:iurt-test-package-1.4.0-2.mga6.src.rpm', + ], + 'path' => '/cauldron/core/release', + } + }, + 'rpms' => [ + '@922855:iurt-test-package-1.4.0-2.mga6.src.rpm', + 'iurt-test-package-debuginfo-1.4.0-2.mga6.armv5tl.rpm', + 'iurt-test-package-1.4.0-2.mga6.armv5tl.rpm', + 'iurt-test-package-doc-1.4.0-2.mga6.noarch.rpm', + ], + 'srpms' => [ + '@922855:iurt-test-package-1.4.0-2.mga6.src.rpm', + ], + }, ); my %targets = find_prefixes_ready_to_upload($config, %pkg_tree); @@ -77,4 +107,23 @@ is($targets{cauldron}{'core/release'}{arch_finisher}{x86_64}, '20160113183431.no is($targets{cauldron}{'core/release'}{arch_finisher}{armv5tl}, '20160113183432.nobody.valstar.23515'); ok(!$targets{cauldron}{'core/release'}{arch_finisher}{noarch}); +foreach my $target (keys %targets) { + foreach my $media (keys %{$targets{$target}}) { + my %is_finisher; + + foreach (values %{$targets{$target}{$media}{arch_finisher}}) { + $is_finisher{$_} = 1; + } + + foreach my $prefix (@{$targets{$target}{$media}{to_upload}}) { + next if $is_finisher{$prefix}; + is($prefix, '20160113183432.nobody.valstar.23516'); + } + + foreach my $prefix (keys %is_finisher) { + isnt($prefix, '20160113183432.nobody.valstar.23516'); + } + } +} + done_testing(); -- cgit v1.2.1