implement Debian live and fix tests
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 16 Aug 2009 23:32:21 +0000 (23:32 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 16 Aug 2009 23:32:21 +0000 (23:32 +0000)
lib/PXElator/config.pm
lib/PXElator/t/config.t

index 7bfc477..294a8a4 100644 (file)
@@ -21,16 +21,16 @@ sub debian_live {
                debian-live-501-i386-standard.squashfs
        });
 
+       my $hostname = client::conf( $ip => 'hostname' ) || 'debian-live';
+
        pxelinux::config_for_ip( $ip, qq{
 
 default debian_live
 label debian_live
-       kernel iso/live/vmlinuz-2.6.30-backports.1-486
-       append initrd=iso/live/initrd.img-2.6.30-backports.1-486 fetch=http://${server::ip}:7777/webconverger/iso/live/filesystem.squashfs boot=live quiet nosudo splash video=vesa:ywrap,mtrr vga=788 nopersistent username=webc hostname=$hostname union=aufs homepage=$homepage locale=hr
+       kernel vmlinuz1
+       append initrd=initrd1.img fetch=http://${server::ip}:7777/debian-live/debian-live-501-i386-standard.squashfs boot=live nopersistent hostname=$hostname union=aufs
+       });
 
-       $dhcpd::file = "pxelinux.0";
-       $pxelinux::path_prefix = 'live-helper/tftpboot/';
-       $pxelinux::config_file = 'pxelinux.cfg/default';
 }
 
 use upstream;
index 1c6bfe6..111f5e5 100755 (executable)
@@ -11,7 +11,14 @@ use_ok 'config';
 
 sub test {
        my $name = shift;
-       eval 'config::' . $name . '( "172.0.0.1" );';
+       my $eval = qq|config::$name( "172.0.0.1" );|;
+       diag "eval $eval";
+       my $config = eval $eval;
+       die $@ if $@;
+       return $config;
 }
 
-ok( test($_), $_ ) foreach ( 'webconverger', 'debirf' );
+foreach my $name ( 'webconverger', 'debian_live' ) {
+       ok( my $config = test($name), $name );
+       diag "config", $config;
+}