/[pxelator]/lib/PXElator/t/client.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/PXElator/t/client.t

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 217 by dpavlin, Thu Aug 13 13:32:19 2009 UTC revision 313 by dpavlin, Thu Aug 27 18:59:12 2009 UTC
# Line 4  use warnings; Line 4  use warnings;
4  use strict;  use strict;
5  use autodie;  use autodie;
6    
7  use Test::More tests => 13;  use Test::More tests => 15;
8  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
9  use English;  use English;
10    
11  use_ok 'client';  use_ok 'client';
12    
13  my $host = '127.0.0.1';  my $host = '127.0.0.1';
14  my $mac  = 'dead00beef';  my $mac  = 'DE:AD:00:00:BE:EF';
15    
16  my $dir = "$server::base_dir/conf/$server::ip";  my $dir = "$server::base_dir/conf/$server::ip";
17  system "sudo chown $UID $dir/ip $dir/mac";  system "sudo chown $UID $dir/ip $dir/mac";
# Line 21  cmp_ok( client::conf( $host => 'test' ), Line 21  cmp_ok( client::conf( $host => 'test' ),
21  ok( client::conf( $host => 'test' => 'value' ), 'conf set' );  ok( client::conf( $host => 'test' => 'value' ), 'conf set' );
22  cmp_ok( client::conf( $host => 'test' ), 'eq', 'value', 'value' );  cmp_ok( client::conf( $host => 'test' ), 'eq', 'value', 'value' );
23    
24    ok( ! client::conf( $host => 'non-existing' ), 'conf non-existing' );
25    
26  ok( my $ip = client::next_ip( $mac ), 'next_ip' );  ok( my $ip = client::next_ip( $mac ), 'next_ip' );
27  diag $ip;  diag $ip;
28    
# Line 32  ok( my $mac_from_ip = client::mac_from_i Line 34  ok( my $mac_from_ip = client::mac_from_i
34  diag $mac_from_ip;  diag $mac_from_ip;
35  cmp_ok( $mac_from_ip, 'eq', $mac );  cmp_ok( $mac_from_ip, 'eq', $mac );
36    
37    ok( my $conf = client::all_conf( $ip ), 'all_conf' );
38    diag dump $conf;
39    
40  diag "cleanup";  diag "cleanup";
41  ok( unlink( $_ ), "unlink $_" ) foreach ( glob("$dir/ip/$host/*"), "$dir/mac/$mac" );  ok( unlink( $_ ), "unlink $_" ) foreach ( glob("$dir/ip/$host/*"), "$dir/mac/$mac" );
42  ok( rmdir "$dir/ip/$host", 'rmdir' );  ok( rmdir "$dir/ip/$host", 'rmdir' );

Legend:
Removed from v.217  
changed lines
  Added in v.313

  ViewVC Help
Powered by ViewVC 1.1.26