diff options
Diffstat (limited to 't/000_test_env.t')
-rw-r--r-- | t/000_test_env.t | 29 |
1 files changed, 25 insertions, 4 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(); |