File: 001_init_dir

package info (click to toggle)
fsvs 1.2.7-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 2,964 kB
  • ctags: 1,464
  • sloc: ansic: 16,650; sh: 5,885; perl: 783; makefile: 338; python: 90
file content (95 lines) | stat: -rwxr-xr-x 1,965 bytes parent folder | download | duplicates (6)
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
#!/bin/bash

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

umask 0
touch -t 200502281400.13 empty-file
echo blabla > blabla
chmod 2741 blabla || chmod 741 blabla

# symlinks
ln -s blabla blabla-symlink
ln -s reclink reclink
ln -s non-existant invalid-symlink

umask 023
mkdir dir-with-perms

ln -s dir-with-perms symlink-to-empty-dir
ln -s tree symlink-to-dir

mkdir long_name_dir loc-utf8 loc-loc
perl -e 'print pack("c",$_) for (33..125)' > long_name_dir/chars
date > long_name_dir/28374fwlifuazwlgvkaj.sbg.awilgzq3a5zgh-aenr.kahw4tgeoa34zht2l3kj4zhwq34tgza.we24ltzkn351243tgwerg

echo $STG_UTF8 > loc-loc/$STG_LOC
echo $STG_LOC > loc-utf8/$STG_UTF8

# just a bit above 512kB
filename=big_file
seq 1 99999 > $filename

for i in a b c
do
  for j in 1 2 3
	do
		p=tree/$i/$j
		mkdir -p $p
		for k in x y z
		do
		  echo $RANDOM > $p/file-$k
		done
	done
done

#ln /dev/urandom .
if [[ `id -u` -eq 0 ]]
then
  cp -a /dev/null device
	chmod 765 device
	chown 1.2 device
  cp -a `readlink -e /dev/cdrom*` block-device
  cp -a /dev/null device-2be-updated
	chmod 123 device-2be-updated
fi

# If we're not UID 0, that's simply a dangling link more.
ln -s device device-link

# encoder/decoder
encoder="openssl enc -e -a"
decoder="openssl enc -d -a"
filename=enc-dec
echo $encoder $decoder > $filename
$BINq ps fsvs:commit-pipe "$encoder" $filename
$BINq ps fsvs:update-pipe "$decoder" $filename


$BINq ci -m "some entries" -o delay=yes
if [[ `$BINdflt st` == "" ]]
then
  $SUCCESS "No status after commit"
else
  $ERROR "Status after commit?"
fi

for f in empty-file tree tree/b tree/c/2 tree/a/3/file-x
do
	if ! $BINdflt info $f | egrep 'Revision:[[:space:]]+4$' > /dev/null
	then
		$ERROR "Wrong revision number on '$f'"
	fi
done

echo new file > newfile1
echo new file > newfile2
$BINq ci -m "newfile" -o delay=yes
rm newfile2
$BINq ci -m "rm newfile" -o delay=yes

cat long_name_dir/chars > copied
$BINq cp long_name_dir/chars copied
$BINq ci -m "copy"