/[pxelator]/lib/PXElator/t/file.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

Contents of /lib/PXElator/t/file.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 271 - (show annotations)
Wed Aug 19 22:48:54 2009 UTC (14 years, 8 months ago) by dpavlin
File MIME type: application/x-troff
File size: 589 byte(s)
first semi-complicated setup to show off some of sysadmin DSL in PXElator

implement nfs root boot with writable snapshot directories for each
client which are rolled out on demand using aufs on server side.

So, client can implement additional layer of aufs if needed
(for /tmp and things like that) and offload more important files
(configuration changes) back to server via NFS.

1 #!/usr/bin/perl
2
3 use warnings;
4 use strict;
5 use autodie;
6
7 use Test::More tests => 10;
8 use Data::Dump qw/dump/;
9
10 use_ok 'file';
11
12 my $file = '/tmp/test';
13
14 ok( ! -e $file, "$file doesn't exist" );
15 ok( file::append( $file, 'test' ), 'append' );
16 ok( my $size = -s $file, "size" );
17 ok( ! file::append( $file, 'test' ), 'append again' );
18 cmp_ok( -s $file, '==', $size, 'size not changed' );
19
20 ok( file::change( $file, 'test' => 'foobar' ), 'change' );
21 cmp_ok( -s $file, '>', $size, 'size bigger' );
22 ok( ! file::change( $file, 'test' => 'foobar' ), 'change again' );
23
24 ok( unlink($file), 'unlink' );

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26