File: basic.t

package info (click to toggle)
nocache 0.9-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 164 kB
  • ctags: 70
  • sloc: ansic: 512; makefile: 74; sh: 26
file content (15 lines) | stat: -rw-r--r-- 537 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh

NR=0

. ./testlib.sh

echo 1..4

t "echo test > testfile.$$ && ../cachestats -q testfile.$$" "file is cached"
t "while ../cachestats -q testfile.$$; do ../cachedel testfile.$$ && sleep 1; done" "file is not cached any more"
t "! ( env LD_PRELOAD=../nocache.so cat testfile.$$ >/dev/null && ../cachestats -q testfile.$$ )" "file is still not in cache"
t "! ( env LD_PRELOAD=../nocache.so cp testfile.$$ testfile.$$.2 && ../cachestats -q testfile.$$.2 )" "copy of file is not cached"

# clean up
rm -f testfile.$$ testfile.$$.2