File: 049_invalid_props

package info (click to toggle)
fsvs 1.2.7-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 2,964 kB
  • ctags: 1,464
  • sloc: ansic: 16,650; sh: 5,885; perl: 783; makefile: 338; python: 90
file content (103 lines) | stat: -rwxr-xr-x 2,031 bytes parent folder | download
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/bin/bash

set -e 
$PREPARE_CLEAN WC_COUNT=3 > /dev/null
$INCLUDE_FUNCS
cd $WC


filename=asd
logfile=$LOGDIR/049.iprop

svndir=$WC2/f


svn co $REPURL $svndir
svnfile=$svndir/$filename

function SetProp
{
	test -f $svnfile && rm $svnfile
	svn ci -m2 $svndir

	echo $RANDOM > $svnfile
	# Grmpf ... svn: warning: W150002: '...asd' is already under version control
	svn add $svnfile 2> /dev/null || true
	test -n "$1" && svn ps fsvs:owner "$1" $svnfile
	test -n "$2" && svn ps fsvs:group "$2" $svnfile
	test -n "$3" && svn ps fsvs:text-time "$3" $svnfile
	test -n "$4" && svn ps fsvs:unix-mode "$4" $svnfile
	svn ci -m2 $svndir
}


SetProp
$BINdflt up
# Currently *no* fsvs-properties are set ... so defaults should apply.
ls -la $filename > $logfile
if grep -- '-rw-------' < $logfile
then
  $SUCCESS "Unset mode gives 0600."
else
	cat $logfile
  $ERROR "Mode should default to 0600"
fi

# We allow a few seconds off, in case the system is very busy.
if perl -e 'exit 1 if -M shift() > (3/86400.0)' $filename
then
  $SUCCESS "Timestamp is current"
else
	date
	ls -la $filename
  $ERROR "Timestamp is wrong"
fi


SetProp "x" "x" "x" "x"
$BINdflt up

if perl -e 'exit 1 if -M shift() > (10/86400.0)' $filename
then
  $SUCCESS "Invalid timestamps get converted to now()"
else
  $ERROR "Invalid timestamps are wrong"
fi

if [[ $UID -eq 0 ]]
then
	SetProp "x" "x" "" ""
	$BINdflt up
#	ls -la $filename

	SetProp "999 a" "999 a" "" ""
	$BINdflt up
#	ls -la $filename

  $SUCCESS "arbitrary owner/group ok."
else
  $WARN "UID 0 needed to get arbitrary owner/group."
fi


svn pd fsvs:owner $svnfile
svn pd fsvs:group $svnfile
svn pd fsvs:text-time $svnfile
svn pd fsvs:unix-mode $svnfile
svn ci -m3 $svndir

$BINdflt diff -r HEAD
rev=`$BINdflt up | grep "revision	" | tail -1 | cut -f2 -d"	" | cut -f1 -d"."` 
for ro in `seq 3 $rev` 
do
	$BINdflt up -r $ro > /dev/null
	echo -n "Diff $ro: "
	for r in `seq 3 $rev` 
	do
		echo -n "  $r"
		$BINdflt diff -r $r > /dev/null
	done
	echo "."
done
$SUCCESS "All diff revision combinations ok."