1
0
mirror of synced 2026-04-04 20:27:58 +00:00

Run some tests twice, once with mocked File::Which, once with original File::Which

This commit is contained in:
Axel Beckert
2014-09-25 21:57:33 +02:00
parent 0546776c17
commit e850ad7ab3
2 changed files with 41 additions and 6 deletions

View File

@@ -0,0 +1,20 @@
package File::Which;
# Mockup package to _not_ find anything
use strict;
use warnings;
use Exporter;
use vars qw{@ISA @EXPORT @EXPORT_OK};
BEGIN {
@ISA = 'Exporter';
@EXPORT = 'which';
}
sub which {
return;
}
'This is a fake!';

View File

@@ -20,7 +20,27 @@ use File::Temp;
#
#
runAllTests();
# Fake File::Which to find nothing at all, i.e. no lsb_release.
$ENV{PERL5OPT} = '-It/mockup-lib'.($ENV{PERL5OPT}?" $ENV{PERL5OPT}":'');
runAllTests();
done_testing;
=head2 runAllTests
Runs all the xt-create-xen-config test.
The idea is to be able to run these tests multiple times under
different conditions.
=cut
sub runAllTests {
#
# Look for mention of DHCP when setting up DHCP, this conflicts with
# a static IP address.
@@ -104,12 +124,7 @@ testOutputContains( "/tmp/domains/foo.my.flat",
memory => 128, dhcp => 1, dir => '/tmp' );
noMentionOf( "phy:",
memory => 128, dhcp => 1, dir => '/tmp' );
done_testing();
} # end of runAllTests
=head2 runCreateCommand