From 1f2ca24bf78e6355cd76ec078954af99466a24de Mon Sep 17 00:00:00 2001 From: Damien Lallement Date: Tue, 13 Dec 2011 15:24:33 +0000 Subject: - update wiki link - add 'network' detection - update/clean test available files - update 'check badwords' - update 'display info' --- t/000_test_env.t | 29 +++++++++++++++++++++++++---- t/001_check_file.t | 8 -------- 2 files changed, 25 insertions(+), 12 deletions(-) (limited to 't') diff --git a/t/000_test_env.t b/t/000_test_env.t index cf7abc2..2b5b0d1 100644 --- a/t/000_test_env.t +++ b/t/000_test_env.t @@ -1,7 +1,7 @@ -# This file is part of the Mageia project -# Copyright (C) 2011 Damien Lallement -# (C) 2011 Romain D'Alverny -# +# This file is part of the Mageia project +# Copyright (C) 2011 Damien Lallement +# (C) 2011 Romain D'Alverny +# # 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 @@ -27,6 +27,7 @@ bail_on_fail; my ($image_path) = @ARGV; +# root is needed for mount/umount of the ISO is($ENV{USERNAME}, 'root', "Current user is root."); # TODO move this elsewhere maybe? @@ -38,4 +39,24 @@ foreach my $p (@packages) { is(pkg_check($p), 0, sprintf("%s is installed.", $p)); } +# check if all necessary files are available +ok -r $image_path . '.md5', 'MD5 checksum is available.'; +ok -r $image_path . '.sha1', 'SHA1 checkum is available.'; +ok -r $image_path . '.md5.gpg', 'MD5.gpg is available.'; +ok -r $image_path . '.sha1.gpg', 'SHA1.gpg is available.'; +ok -r $image_path . '.idx', 'IDX is available.'; +# TODO check if LiveCD or not, so .idx or .lst +#ok -r $image_path . '.lst', 'LST is available.'; + +# is ISO mount point readable? +ok -r $image_path, 'ISO mount point is readable.' + or diag("$image_path: $!"); + +# is network available? +# will be needed in a near future. +my $nb_packet = 2; +my $server = "google.com"; +my $result = `ping -c $nb_packet $server | grep received | sed 's/ //g' | cut -d, -f 2 | cut -c 1 | tr -d '\n'`; +is ($result, $nb_packet, "Network available"); + done_testing(); diff --git a/t/001_check_file.t b/t/001_check_file.t index 022a8d7..edbf7ba 100644 --- a/t/001_check_file.t +++ b/t/001_check_file.t @@ -41,10 +41,6 @@ if (scalar %info) { diag 'See https://wiki.mageia.org/en/Product_naming for more information.'; } -# are files available? -ok(-r $image_path, 'ISO file is readable.') - or diag("$image_path: $!"); - # is file size correct? my $du = `du --apparent-size --block-size=MB $image_path`; my @size_name = split(/\t/, $du); @@ -56,10 +52,6 @@ ok($size le $max_sizes{$info{medium}}, sprintf("File has a working size (%s) for its medium type (%s, max %s).", $size, $info{medium}, $max_sizes{$info{medium}})); -# -ok(-r $image_path . '.md5', 'MD5 checksum is available.'); -ok(-r $image_path . '.sha1', 'SHA1 checkum is available.'); - TODO: { local $TODO = ".idx & .lst" if 1; -- cgit v1.2.1