aboutsummaryrefslogtreecommitdiffstats
path: root/test_iso.pl
diff options
context:
space:
mode:
Diffstat (limited to 'test_iso.pl')
-rw-r--r--test_iso.pl57
1 files changed, 57 insertions, 0 deletions
diff --git a/test_iso.pl b/test_iso.pl
new file mode 100644
index 0000000..0c67efb
--- /dev/null
+++ b/test_iso.pl
@@ -0,0 +1,57 @@
+#!/usr/bin/perl -w
+#
+
+use 5.010;
+use MDK::Common;
+use TAP::Harness;
+use Tools;
+
+my ($image_path) = @ARGV;
+
+if (!defined $image_path) {
+ print "Usage: ./test_iso.pl path_to_iso/file.iso\n\n";
+ exit;
+}
+
+my $harness = TAP::Harness->new({
+ formatter_class => 'TAP::Formatter::Console',
+ merge => 1,
+ verbosity => 1,
+ normalize => 1,
+ color => 1,
+ test_args => [
+ $image_path,
+ "Testing"
+ ]
+});
+
+print "# Date: ", `date --rfc-3339='ns' -u`;
+print "# Testing: $image_path\n";
+print "# Host: ", `uname -n`;
+
+$harness->runtests(<./t/*.t>);
+
+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/";
+print "... ok\n";
+
+my $name = basename($image_path);
+my %info = Tools::parse_mageia_iso_name($name);
+
+# FIXME the difference is actually regular versus LiveCD
+if ($info{"medium"} eq "DVD") {
+ $harness->runtests(<./t_install_iso/*.t>);
+} elsif ($info{"medium"} eq "CD") {
+ # LiveCD specific
+ # CD specific
+}
+# Umounting the iso
+print "# Umounting ISO\n";
+
+# FIXME this fails sometimes; no idea why. Force umount?
+system 'umount -fr /media/iso_check';
+system 'rm -r /media/iso_check';
+print "... ok\n";
+print "# Date: ", `date --rfc-3339='ns' -u`;
+print "# Test is over.\n";