Debian Codegraph @

tests/001_test_symlink.sh

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2 # test symlink handling.
3
4 set -ex
5
6 TESTDIR=$(mktempscip-shell system . . mktemp. -d )
7
8 cd ${TESTDIR}
9 mkdirscip-shell system . . mkdir. 1/
10
11 # make a few files for testing.
12 touchscip-shell system . . touch. 1/b 1/c 1/d 1/a.real
13 ddscip-shell system . . dd. if=/dev/zeroscip-shell filesystem . . `/dev/zero`. of=1/e bs=512 count=2
14 lnscip-shell system . . ln. -s a.real 1/a
15 lsscip-shell system . . ls. -li 1/ > ls.prev
16
17 sleepscip-shell system . . sleep. 1s
18
19 cpscip-shell system . . cp. -al 1/ 2
20
21 echoscip-shell system . . echo. " 2/ before"
22 lsscip-shell system . . ls. -li 2/
23 echoscip-shell system . . echo. "cd 2 && echo a > a && mv b c && touch c && dd if=e of=d" | cow-shell
24 echoscip-shell system . . echo. " 2/ after"
25 lsscip-shell system . . ls. -li 2/
26
27 rmscip-shell system . . rm. -rf 2/
28
29 lsscip-shell system . . ls. -li 1/ > ls.after
30
31
32 echoscip-shell system . . echo. " 1/ differences; should not exist"
33 diffscip-shell system . . diff. -u ls.prev ls.after
34
35 rmscip-shell system . . rm. -rf ${TESTDIR}