diff options
author | Romain d'Alverny <rda@mageia.org> | 2011-12-05 22:55:33 +0000 |
---|---|---|
committer | Romain d'Alverny <rda@mageia.org> | 2011-12-05 22:55:33 +0000 |
commit | 586a59e00d00f2b1347f015911545b722f2d1f8b (patch) | |
tree | 0410ef511a253d5f94298c7f130527a4672c230f /test_iso.pl | |
parent | 9412e3c3beb6d547f0932d4e1c19a9dfb0cd4378 (diff) | |
download | isocheck-586a59e00d00f2b1347f015911545b722f2d1f8b.tar isocheck-586a59e00d00f2b1347f015911545b722f2d1f8b.tar.gz isocheck-586a59e00d00f2b1347f015911545b722f2d1f8b.tar.bz2 isocheck-586a59e00d00f2b1347f015911545b722f2d1f8b.tar.xz isocheck-586a59e00d00f2b1347f015911545b722f2d1f8b.zip |
First import, test suite attempt for built ISOs
Code heavily taken from previous dams work,
reorganized in a test suite to better separate test cases.
Does basic things already (in t/).
Needs more fixes (esp. in t_install_iso/).
Diffstat (limited to 'test_iso.pl')
-rw-r--r-- | test_iso.pl | 57 |
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"; |