--- /dev/null
+CentOS release 4.3 (Final)
--- /dev/null
+os_type='redhat-linux'
+os_version='12.3'
+real_os_type='CentOS Linux'
+real_os_version='4.3'
--- /dev/null
+CentOS release 5 (Final)
--- /dev/null
+os_type='redhat-linux'
+os_version='13'
+real_os_type='CentOS Linux'
+real_os_version='5'
--- /dev/null
+Debian GNU/Linux 3.1 \n \l
+
--- /dev/null
+os_type='debian'
+os_version='3.1'
+real_os_type='Debian Linux'
+real_os_version='3.1'
--- /dev/null
+Debian GNU/Linux 4.0
--- /dev/null
+os_type='debian'
+os_version='4.0'
+real_os_type='Debian Linux'
+real_os_version='4.0'
--- /dev/null
+Fedora release 5 (Bordeaux)
--- /dev/null
+os_type='fedora'
+os_version='5'
+real_os_type='Fedora Core Linux'
+real_os_version='Fedora 5'
--- /dev/null
+Fedora Core release 6 (Zod)
--- /dev/null
+os_type='fedora'
+os_version='6'
+real_os_type='Fedora Core Linux'
+real_os_version='Fedora 6'
--- /dev/null
+Fedora release 7 (Moonshine)
--- /dev/null
+os_type='fedora'
+os_version='7'
+real_os_type='Fedora Core Linux'
+real_os_version='Fedora 7'
--- /dev/null
+FreeBSD freebsd.virtualmin 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Sun Feb 24 19:59:52 UTC 2008 root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386
--- /dev/null
+os_type='freebsd'
+os_version='7.0'
+real_os_type='FreeBSD'
+real_os_version='7.0'
--- /dev/null
+Red Hat Enterprise Linux ES release 3 (Taroon Update 4)
--- /dev/null
+os_type='rhel'
+os_version='3'
+real_os_type='Red Hat Enterprise Linux'
+real_os_version='3ES'
--- /dev/null
+Red Hat Enterprise Linux AS release 4 (Nahant Update 4)
--- /dev/null
+os_type='rhel'
+os_version='4'
+real_os_type='Red Hat Enterprise Linux'
+real_os_version='4AS'
--- /dev/null
+Red Hat Enterprise Linux ES release 4 (Nahant Update 6)
--- /dev/null
+os_type='rhel'
+os_version='4'
+real_os_type='Red Hat Enterprise Linux'
+real_os_version='4ES'
--- /dev/null
+Red Hat Enterprise Linux Server release 5 (Tikanga)
--- /dev/null
+os_type='rhel'
+os_version='5'
+real_os_type='Red Hat Enterprise Linux'
+real_os_version='5'
--- /dev/null
+Slackware 10.0.0
--- /dev/null
+os_type='slackware-linux'
+os_version='10.0.0'
+real_os_type='Slackware Linux'
+real_os_version='10.0.0'
--- /dev/null
+Ubuntu 6.06.1 LTS \n \l
--- /dev/null
+os_type='ubuntu'
+os_version='6.06'
+real_os_type='Ubuntu Linux'
+real_os_version='6.06.1'
--- /dev/null
+Ubuntu 8.04 \n \l
+
--- /dev/null
+os_type='ubuntu'
+os_version='8.04'
+real_os_type='Ubuntu Linux'
+real_os_version='8.04'
--- /dev/null
+#!/usr/bin/perl -w
+use strict;
+use OsChooser;
+
+my $DATADIR = "t/data";
+
+# Get a list of the example OS definition files
+opendir(DIR, $DATADIR) || die "can't opendir $DATADIR: $!";
+my @files = grep { /\.os/ } readdir(DIR);
+closedir DIR;
+use Test::More qw(no_plan);
+use Test::Files;
+
+foreach my $file (sort @files) {
+ $file =~ /(.*)\.os$/;
+ my $osname = $1;
+ my $issue = "$DATADIR/$1.issue";
+ my $outfile = "t/outfile";
+ OsChooser::write_file($outfile,
+ OsChooser::oschooser("os_list.txt", 1, $issue));
+ compare_ok($outfile, "$DATADIR/$file", $osname);
+
+ # Cleanup
+ unlink $outfile;
+}
+
--- /dev/null
+#!/usr/bin/perl -w
+# Test in command mode...
+use strict;
+
+my $DATADIR = "t/data";
+
+# Get a list of the example OS definition files
+opendir(DIR, $DATADIR) || die "can't opendir $DATADIR: $!";
+my @files = grep { /\.os/ } readdir(DIR);
+closedir DIR;
+use Test::More qw(no_plan);
+use Test::Files;
+
+foreach my $file (sort @files) {
+ $file =~ /(.*)\.os$/;
+ my $osname = $1;
+ my $issue = $1 . ".issue";
+ my $outfile = "t/outfile";
+ my $result = `./OsChooser.pm os_list.txt $outfile 1 $DATADIR/$issue`;
+ # Do something with $result
+ compare_ok($outfile, "$DATADIR/$file", $osname);
+
+ # Cleanup
+ unlink $outfile;
+}
+
--- /dev/null
+#!/usr/bin/perl -w
+# These tests just check to be sure all functions return something
+# It doesn't care what it is returned...so garbage can still pass,
+# as long as the garbage is the right data type.
+
+use strict;
+use Test::More tests => 3;
+
+use_ok( 'OsChooser' );
+
+isa_ok(\OsChooser::have_tty(), 'SCALAR');
+isa_ok(\OsChooser::has_command("cp"), 'SCALAR');
+
+# Don't know how to test the return from a die exception
+# Maybe use Test::Exception and put this into another test file
+#isa_ok(OsChooser::main(), 'SCALAR');
--- /dev/null
+#!/usr/bin/perl -w
+# Test utility functions to be sure they do something utilitiful
+use strict;
+use Test::More tests => 1;
+use OsChooser;
+
+# Problematic...when run from harness, will not have tty
+ok(OsChooser::have_tty() == 1, "have_tty");
+