Commit 3b257e5 Add tests for skipping rsync and nfs tempfiles.

1 file Authored and Committed by tibbs a month ago
Add tests for skipping rsync and nfs tempfiles.

    
 1 @@ -54,6 +54,35 @@
 2   
 3   }
 4   
 5 + test_skip_rsynctmp () {
 6 +     # Make sure that rsync .~tmp~ files are skipped
 7 + 
 8 +     for i in $td/dir*; do
 9 +         mkdir $i/.~tmp~
10 +         touch $i/.~tmp~/foo
11 +     done
12 + 
13 +     $cf -d $td -t $tl
14 + 
15 +     assertFalse 'create_filelist must always skip rsync temporaries' "file_contains $tl \"\.~tmp~\""
16 +     assertFalse 'create_filelist must skip files inside of rsync tempdirs' "file_contains $tl foo"
17 + }
18 + 
19 + test_skip_nfs () {
20 +     # Make sure that files beginning with ".nfs" are skipped
21 + 
22 +     for i in $td $td/dir*; do
23 +         touch $i/.nfs$RANDOM$RANDOM$RANDOM
24 +         touch $i/foo-1.2.3.nfs-$RANDOM.foo
25 +     done
26 + 
27 +     $cf -d $td -t $tl
28 + 
29 +     assertFalse 'create_filelist must skip .nfs files (1)' "file_contains $tl \"\t\.nfs\""
30 +     assertFalse 'create_filelist must skip .nfs files (2)' "file_contains $tl \"/\.nfs\""
31 +     assertTrue 'create_filelist should not skip filenames merely containing ".nfs"' "file_contains $tl foo"
32 + }
33 + 
34   test_file_size_update () {
35       # Check that an updated file gets an updated size
36       $cf -d $td -t $tl