aboutsummaryrefslogtreecommitdiffstats
path: root/t_install_iso/011_check_idx.t
diff options
context:
space:
mode:
authorRomain d'Alverny <rda@mageia.org>2012-02-17 17:55:28 +0000
committerRomain d'Alverny <rda@mageia.org>2012-02-17 17:55:28 +0000
commitdeb9713857f8f47cf392df14b4d7fd6af0bbb395 (patch)
tree63ba06b22f0327c0cba072cea97ff8bcd486d426 /t_install_iso/011_check_idx.t
parent7a5cac718aa056abe96eafe8e910ec256dd3793d (diff)
downloadisocheck-deb9713857f8f47cf392df14b4d7fd6af0bbb395.tar
isocheck-deb9713857f8f47cf392df14b4d7fd6af0bbb395.tar.gz
isocheck-deb9713857f8f47cf392df14b4d7fd6af0bbb395.tar.bz2
isocheck-deb9713857f8f47cf392df14b4d7fd6af0bbb395.tar.xz
isocheck-deb9713857f8f47cf392df14b4d7fd6af0bbb395.zip
Move all image-related tests in a separate place
Diffstat (limited to 't_install_iso/011_check_idx.t')
-rw-r--r--t_install_iso/011_check_idx.t97
1 files changed, 0 insertions, 97 deletions
diff --git a/t_install_iso/011_check_idx.t b/t_install_iso/011_check_idx.t
deleted file mode 100644
index 8863b9b..0000000
--- a/t_install_iso/011_check_idx.t
+++ /dev/null
@@ -1,97 +0,0 @@
-# This file is part of the Mageia project
-# Copyright (C) 2011 Damien Lallement <dams@mageia.org>
-# (C) 2011 Romain D'Alverny <rda@mageia.org>
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public License
-# along with this library; see the file COPYING.LIB. If not, write to
-# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301, USA.
-#
-# TODO
-#
-#
-use Test::Most;
-
-bail_on_fail;
-
-SKIP: {
- skip "TODO", 1 unless 0;
-}
-
-done_testing();
-
-# get the product to verify in idxlist
-sub check_idx {
- my ($log, $distro, $image, $verbo) = @_;
- my $idx;
- my $valid = 1;
- my $col;
- $col = 0 if member($distro, qw(Free FREE));
- $col = 2 if member($distro, qw(PWP Powerpack));
- $col = 3 if member($distro, qw(One ONE one));
- $col = 1 if -r "/media/iso_check/i586/" && -r "/media/iso_check/x86_64/";
- if ($col == 3) {
- substr($image, -3 , 3) = '';
- $idx = $image . "lst";
- $valid &= check_idx_list($idx, $log, $col, $verbo) if -r $idx && -r "idxlist";
- }
- else {
- substr($image, -3 , 3) = '';
- $idx = $image . "idx";
- $valid &= check_idx_list($idx, $log, $col, $verbo) if -r $idx && -r "idxlist";
- }
-
- return $valid;
-}
-
-
-# Verification of the presence of the packages on the iso
-sub check_idx_list {
- my ($idx, $log, $col, $verb) = @_;
- my $pkg;
- my $valid = 1;
- my $file;
- my @media;
-
- print "<Log of check_idx>\n" if $verb;
- print $log "<Log of check_idx>\n";
-
- open(my $list, 'idxlist') or fail('check_idx_list');
- while ($pkg = <$list>) {
- if (substr($pkg, 0, 1) ne '#') {
- chomp($pkg);
- @media = split(/ /, $pkg);
- if ($media[$col] == 1) {
- $file = `cat $idx | cut -d ' ' -f 2 | grep $media[4]` if $col != 3;
- $file = `cat $idx | grep $media[4]` if $col == 3;
- if ($file eq '') {
- print $log "$media[4] NOT FOUND in $idx\n";
- print "$media[4] NOT FOUND in $idx\n" if $verb;
- $valid = 0;
- }
- else {
- print $file if $verb;
- #print $log $file;
- }
- }
- }
- }
- print $log "</Log of check_idx>\n";
- print $log "Comparison between idxlist and .idx OK\n" if $valid != 0;
- print $log "Comparison between idxlist and .idx NOT OK\n" if $valid == 0;
- print "</Log of check_idx>\n" if $verb;
- print "Comparison between idxlist and .idx: OK\n" if $valid != 0 && $verb;
- print "Comparison between idxlist and .idx: NOT OK\n" if $valid == 0 && $verb;
-
- return $valid;
-}