Handle hostnames with upper-case letters
[webmin.git] / t / lib_os_compare.t
1 #!/usr/bin/perl -w
2 use strict;
3 use OsChooser;
4
5 my $DATADIR = "t/data";
6
7 # Get a list of the example OS definition files
8 opendir(DIR, $DATADIR) || die "can't opendir $DATADIR: $!";
9 my @files = grep { /\.os/ } readdir(DIR);
10 closedir DIR;
11 use Test::More qw(no_plan);
12 use Test::Files;
13
14 foreach my $file (sort @files) {
15         $file =~ /(.*)\.os$/;
16         my $osname = $1;
17         my $issue = "$DATADIR/$1.issue";
18         my $outfile = "t/outfile";
19         OsChooser::write_file($outfile,
20           OsChooser::oschooser("os_list.txt", 1, $issue));
21         compare_ok($outfile, "$DATADIR/$file", $osname);
22
23         # Cleanup
24         unlink $outfile;
25 }
26