]> wimlib.net Git - wimlib/blob - tests/common_tests.sh
Add Windows rpfix tests
[wimlib] / tests / common_tests.sh
1
2 msg "nothing"
3 do_test ""
4
5 msg "a single file"
6 do_test "echo 1 > file"
7
8 msg "a single directory"
9 do_test "mkdir dir"
10
11 msg "subdirectory with file"
12 do_test "mkdir dir; echo 1 > dir/file"
13
14 msg "empty file"
15 do_test "echo -n > empty_file"
16
17 msg "two empty files"
18 do_test "echo -n > empty_file_1; echo -n > empty_file_2"
19
20 msg "hard link in same directory"
21 do_test "echo 1 > file; ln file link"
22
23 msg "hard link between empty files"
24 do_test "echo -n > empty_file; ln empty_file link"
25
26 msg "relative symbolic link"
27 do_test "echo 1 > file; ln -s file symlink"
28
29 msg "absolute symbolic link"
30 do_test "echo 1 > file; ln -s /some/absolute/target symlink"
31
32 msg "large file"
33 do_test "dd if=/dev/zero of=file bs=4096 count=10 &> /dev/null"
34
35 msg "many nested directories"
36 do_test 'mkdir dir; mkdir dir/subdir; mkdir dir/subdir/subdir2; mkdir dir/subdir/subdir3'
37
38 msg "identical files and symlinks in subdirectory"
39 do_test 'mkdir dir;
40          echo 888 > dir/file;
41          echo 888 > dir/idfile2;
42          ln -s ../dir dir/circle; ln -s file dir/filelink'
43
44 msg "hard link group and identical files not hard linked"
45 do_test 'echo 888 > file;
46          echo 888 > file2;
47          ln file link;
48          ln file link2;
49          echo 888 > file3'
50
51 msg "C source code of wimlib"
52 do_test 'cp $srcdir/src/*.{c,h} .'
53
54 msg "tons of random stuff"
55 do_test 'echo -n 8 > file;
56          ln file hardlink;
57          ln -s hardlink symlink;
58          echo -n 8 > identical file;
59          dd if=/dev/urandom of=randomfile bs=4096 count=10 &>/dev/null;
60          mkdir dir;
61          mkdir anotherdir;
62          cp file anotherdir;
63          ln file anotherdir/anotherhardlink;
64          ln -s .. anotherdir/anothersymlink;
65          ln -s anothersymlink anotherdir/symlinktosymlink;
66          echo -n 33 > anotherfile;
67          echo -n > emptyfile;
68          mkdir dir/subdir;
69          ln file dir/subdir/file;
70          echo -n 8 > dir/subdir/file2;
71          ln dir/subdir/file dir/subdir/link;'