diff options
author | Damien Lallement <dams@mageia.org> | 2011-12-13 15:24:33 +0000 |
---|---|---|
committer | Damien Lallement <dams@mageia.org> | 2011-12-13 15:24:33 +0000 |
commit | 1f2ca24bf78e6355cd76ec078954af99466a24de (patch) | |
tree | 25260655e093d5df8a187844f0b29ac8c620db90 /t | |
parent | de97b7594050ca17fc6a9f40741286bc0ebd5fc3 (diff) | |
download | isocheck-1f2ca24bf78e6355cd76ec078954af99466a24de.tar isocheck-1f2ca24bf78e6355cd76ec078954af99466a24de.tar.gz isocheck-1f2ca24bf78e6355cd76ec078954af99466a24de.tar.bz2 isocheck-1f2ca24bf78e6355cd76ec078954af99466a24de.tar.xz isocheck-1f2ca24bf78e6355cd76ec078954af99466a24de.zip |
- update wiki link
- add 'network' detection
- update/clean test available files
- update 'check badwords'
- update 'display info'
Diffstat (limited to 't')
-rw-r--r-- | t/000_test_env.t | 29 | ||||
-rw-r--r-- | t/001_check_file.t | 8 |
2 files changed, 25 insertions, 12 deletions
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 <dams@mageia.org> -# (C) 2011 Romain D'Alverny <rda@mageia.org> -# +# 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 @@ -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; |