File: hardlinks.sh

package info (click to toggle)
cssc 1.0.1-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,612 kB
  • ctags: 1,424
  • sloc: cpp: 13,502; sh: 4,759; ansic: 2,971; perl: 342; makefile: 339; awk: 11
file content (45 lines) | stat: -rw-r--r-- 1,098 bytes parent folder | download | duplicates (3)
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
38
39
40
41
42
43
44
45
#! /bin/sh

# hardlinks.sh:  Testing for behaviour when there are hard links to
#                the s-file.  


# Import common functions & definitions.
. ../common/test-common

g=foo
s=s.$g
s2=s.bar
files="$s $g $s2"

remove $files

docommand L1 "${admin} -n ${s}" 0 "" IGNORE
docommand L2 "test -r ${s}" 0 "" IGNORE

# Make a hard link.
if ln $s $s2
then
    # OS and filessystem support hard links - we can do the test

    # SCCS commands should fail on the SCCS file now, since the link 
    # count is not 1.  We try a selection. 
    docommand L3 "${prs} ${s}"           1 IGNORE IGNORE
    docommand L4 "${admin} -anobby ${s}" 1 IGNORE IGNORE
    docommand L5 "${get} -g ${s}"        1 IGNORE IGNORE

    # For some reason the SCCS version of "val" does not make this check.
    # We do, but I don't think this functional difference is very 
    # important. 
    # expect_fail=true
    # docommand L6 "${val} ${s}"           1 IGNORE IGNORE
    # expect_fail=false
else
    echo "Your OS or your the filesystem do not support hard links - some tests skipped"
fi



remove s.bar 
success