File: 000_test_basic.sh

package info (click to toggle)
cowdancer 0.90
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 648 kB
  • sloc: ansic: 4,593; sh: 407; makefile: 142; cpp: 5
file content (37 lines) | stat: -rwxr-xr-x 582 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
# test that things are working as expected.
#
# Requires a installed cowdancer, and will test the installed cowdancer.

set -ex

TESTDIR=$(mktemp -d )

cd ${TESTDIR}
mkdir 1/

# make a few files for testing.
touch 1/a 1/b 1/c 1/d
dd if=/dev/zero of=1/e bs=512 count=2

ls -li 1/ > ls.prev

sleep 1s

cp -al 1/ 2

echo "   2/ before"
ls -li 2/ 
echo "cd 2 && echo a > a && mv b c && touch c && dd if=e of=d" | cow-shell
echo "   2/ after"
ls -li 2/

rm -rf 2/

ls -li 1/ > ls.after


echo "   1/ differences; should not exist"
diff -u ls.prev ls.after

rm -rf ${TESTDIR}