aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.txt3
-rw-r--r--t/000_test_env.t4
-rw-r--r--t/001_check_file.t8
-rw-r--r--t/003_is_hybrid.t2
-rw-r--r--t_install_iso/010_check_autorun.t35
-rw-r--r--t_install_iso/014_check_bad_words.t12
-rw-r--r--test_iso.pl11
7 files changed, 23 insertions, 52 deletions
diff --git a/README.txt b/README.txt
index 7bd0373..6dfeb3c 100644
--- a/README.txt
+++ b/README.txt
@@ -17,7 +17,6 @@ User running this script must be able to mount an ISO image.
Depends on:
- cdrkit, cdrkit-isotools
- gpg
- - mono
- Perl
- Test::Most
- TAP::Harness
@@ -32,4 +31,4 @@ TODO
Style
-----
- - 4 spaces indent, no tab \ No newline at end of file
+ - 4 spaces indent, no tab
diff --git a/t/000_test_env.t b/t/000_test_env.t
index 9484e5b..684efbf 100644
--- a/t/000_test_env.t
+++ b/t/000_test_env.t
@@ -8,14 +8,12 @@ bail_on_fail;
my ($image_path) = @ARGV;
-# FIXME why need to be root? for mounting the ISO only?
-# FIXME USER or USERNAME?
is($ENV{USERNAME}, 'root', "Current user is root.");
# TODO move this elsewhere maybe?
sub pkg_check { my ($pkg) = @_; return system("rpm -q $pkg >/dev/null"); }
-my @packages = qw(cdrkit cdrkit-isotools mono gnupg);
+my @packages = qw(cdrkit cdrkit-isotools gnupg);
foreach my $p (@packages) {
is(pkg_check($p), 0, sprintf("%s is installed.", $p));
diff --git a/t/001_check_file.t b/t/001_check_file.t
index f82b149..2eded9f 100644
--- a/t/001_check_file.t
+++ b/t/001_check_file.t
@@ -24,7 +24,7 @@ if (scalar %info) {
}
} else {
fail 'ISO has valid filename.';
- diag 'See https://wiki.mageia.org/en/Product_naming';
+ diag 'See https://wiki.mageia.org/en/Product_naming for more information.';
}
# are files available?
@@ -32,12 +32,12 @@ ok -r $image_path, 'ISO file is readable.'
or diag("$image_path: $!");
# is file size correct?
-my $du = `du --apparent-size --block-size=M $image_path`;
+my $du = `du --apparent-size --block-size=MB $image_path`;
my @size_name = split(/\t/, $du);
my $size = $size_name[0];
-# FIXME put correct sizes here
-my %max_sizes = ( "CD" => "740M", "DVD" => "4200M" );
+# Correct sizes: CD == 700MB & DVD == 4,700.373MB
+my %max_sizes = ( "CD" => "700MB", "DVD" => "4700MB" );
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"}}));
diff --git a/t/003_is_hybrid.t b/t/003_is_hybrid.t
index 37ccbcd..343bc7f 100644
--- a/t/003_is_hybrid.t
+++ b/t/003_is_hybrid.t
@@ -9,7 +9,7 @@ my ($image_path) = @ARGV;
ok (is_hybrid($image_path, 0), "Is hybrid");
-# Verification if the Iso is hybrid
+# Verification if the ISO is hybrid
sub is_hybrid {
my ($img, $full) = @_;
diff --git a/t_install_iso/010_check_autorun.t b/t_install_iso/010_check_autorun.t
index 757951e..1ae45e0 100644
--- a/t_install_iso/010_check_autorun.t
+++ b/t_install_iso/010_check_autorun.t
@@ -1,7 +1,7 @@
#
# Check autorun
#
-use Test::Most tests => 13;
+use Test::Most tests => 12;
use File::Basename;
use Tools;
@@ -16,8 +16,9 @@ set_failure_handler( sub {
system 'umount /media/iso_check; rm -r /media/iso_check';
});
-my %info = Tools::parse_mageia_iso_name($name);
-skip 'Autorun is only on DVDs.', 13 unless $info{"medium"} eq 'DVD';
+# Autorun is on CD AND DVD
+#my %info = Tools::parse_mageia_iso_name($name);
+#skip 'Autorun is only on DVDs.', 13 unless $info{"medium"} eq 'DVD';
#
ok (-r "/media/iso_check/autorun.inf", 'autorun.inf is there');
@@ -63,32 +64,4 @@ foreach my $a ("de-DE/", "es-ES/", "fr-FR/", "it-IT/", "pt-BR/", "ru-RU/", "zh-C
ok -r $file, "$file is there";
}
-# FIXME what does this do? does it work?
-# in the meantime, skipped
-SKIP: {
- skip 'Not clear what this does', 1 unless 0;
-
- my $_cp = `cp $exe .`;
- eval {
- local $SIG{ALRM} = sub { die "alarm\n" }; # NB: \n required
- alarm 5;
- my $_nread = sysread my $_SOCKET, my $_buffer, my $_size;
- my $_mono = `mono autorun.exe 2> autorun_exe.log`;
- alarm 0;
- if ($@) {
- die unless $@ eq "alarm\n"; # propagate unexpected errors
- # timed out
- } else {
- # didn't
- }
- };
-
- open(my $exe_log, 'autorun_exe.log');
- my $line = <$exe_log>;
-
- isnt (substr($line, 0, 20), 'Cannot open assembly', 'autorun.exe is launchable');
-
- my $_rm = `rm autorun.exe autorun_exe.log`;
-}
-
done_testing();
diff --git a/t_install_iso/014_check_bad_words.t b/t_install_iso/014_check_bad_words.t
index 88cf122..b08dee5 100644
--- a/t_install_iso/014_check_bad_words.t
+++ b/t_install_iso/014_check_bad_words.t
@@ -7,21 +7,21 @@ use Test::Most tests => 2;
bail_on_fail;
#
-my $res = `find /media/iso_check/ -name '*~' -or -iname '*.swp'`;
+my $res = `find /media/iso_check/ -name '*~' -or -iname '*.swp' -or -iname '.svn' -or -iname '.git*'`;
if ($res) {
- fail('Has no swap temporary file (*~ or *.swp).');
+ fail('Has no swap temp or hiden RCS files (*~, *.swp, .svn or .git*).');
note $res;
} else {
- pass('Has no swap temp file.');
+ pass('Has no swap temp or hiden RDC files (*~, *.swp, .svn or .git*).');
}
#
-$res = `find /media/iso_check/ -iname '*roxx*' -or -iname '*sucks*' -or -iname 'ubuntu*' -or -iname 'microsoft*' -or -iname 'mandrake*' -or -iname 'mandriva'`;
+$res = `find /media/iso_check/ -iname '*roxx*' -or -iname '*sucks*' -or -iname 'ubuntu*' -or -iname 'microsoft*' -or -iname 'mandrake*' -or -iname 'mandriva' -or -iname 'todo' -or -iname 'delete*'`;
if ($res) {
- fail('Has no blacklisted word.');
+ fail('Has no blacklisted words.');
note $res;
} else {
- pass('Has no blacklisted word.');
+ pass('Has no blacklisted words.');
}
done_testing();
diff --git a/test_iso.pl b/test_iso.pl
index 0c67efb..2a650eb 100644
--- a/test_iso.pl
+++ b/test_iso.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl -w
#
use 5.010;
@@ -9,7 +9,7 @@ use Tools;
my ($image_path) = @ARGV;
if (!defined $image_path) {
- print "Usage: ./test_iso.pl path_to_iso/file.iso\n\n";
+ print "Usage: ./test_iso.pl [ISO file]\nTry `./test_iso.pl --help' for more information.\n";
exit;
}
@@ -31,6 +31,7 @@ print "# Host: ", `uname -n`;
$harness->runtests(<./t/*.t>);
+# Mounting the ISO
print "# Mounting ISO in /media/iso_check";
-r "/media/iso_check" or system 'mkdir /media/iso_check';
system "mount -r " . if_(!-b $image_path, "-o loop ") . "$image_path /media/iso_check/";
@@ -46,11 +47,11 @@ if ($info{"medium"} eq "DVD") {
# LiveCD specific
# CD specific
}
-# Umounting the iso
-print "# Umounting ISO\n";
+# Umounting the ISO
+print "# Umounting ISO\n";
# FIXME this fails sometimes; no idea why. Force umount?
-system 'umount -fr /media/iso_check';
+system 'umount /media/iso_check';
system 'rm -r /media/iso_check';
print "... ok\n";
print "# Date: ", `date --rfc-3339='ns' -u`;