test deduplication with file modification
[cloudstore.git] / t / client.t
1 #!/usr/bin/perl
2 use warnings;
3 use strict;
4
5 use Test::More tests => 5;
6 use Data::Dump qw(dump);
7 use File::Slurp;
8
9 my $user = 'u2001';
10 $ENV{RSYNC_PASSWORD} = 'password';
11
12 sub upload {
13         system('rsync', '-vv', @_, "rsync://$user\@127.0.0.1:6501/$user/" ), "rsync @_ $user";
14 }
15
16 mkdir('/tmp/client');
17
18 diag "create shared file one";
19
20 ok write_file('/tmp/client/one', "one");
21
22 ok upload('/tmp/client/one'), "upload $user";
23
24 $user = 'u2002';
25 ok upload('/tmp/client/one'), "upload $user";
26
27
28 diag "modify shared file one";
29
30 ok write_file('/tmp/client/one', "modified");
31
32 ok upload('/tmp/client/one'), "upload $user";