6 top="$(WVPASS pwd)" || exit $?
7 tmpdir="$(WVPASS wvmktempdir)" || exit $?
9 export BUP_DIR="$tmpdir/bup"
10 export GIT_DIR="$tmpdir/bup"
12 bup() { "$top/bup" "$@"; }
20 WVPASS touch -t 196907202018 src/.dotfile
21 WVPASS date > src/file
22 WVPASS bup random 1k > src/file
23 WVPASS touch -t 196907202018 src/file
24 (WVPASS cd src; WVPASS ln -s file symlink) || exit $?
25 WVPASS mkfifo src/fifo
26 WVPASS touch -t 196907202018 src/fifo
27 WVPASS "$top"/t/mksock src/socket
28 WVPASS touch -t 196907202018 src/socket
29 WVPASS touch -t 196907202018 src/executable
30 WVPASS chmod u+x src/executable
31 WVPASS touch -t 196907202018 src/executable
32 WVPASS touch -t 196907202018 src
33 WVPASS touch -t 196907202018 .
34 WVPASS chmod -R u=rwX,g-rwx,o-rwx .
36 WVPASS bup save -n src src
40 WVPASSEQ "$(WVPASS bup ls /)" "src"
42 WVPASSEQ "$(WVPASS bup ls -A /)" ".commit
46 WVPASSEQ "$(WVPASS bup ls -AF /)" ".commit/
50 WVPASSEQ "$(WVPASS bup ls -a /)" ".
56 WVPASSEQ "$(WVPASS bup ls -aF /)" "./
62 WVPASSEQ "$(WVPASS bup ls src/latest/"$tmpdir"/src)" "executable
68 WVPASSEQ "$(WVPASS bup ls -A src/latest/"$tmpdir"/src)" ".dotfile
75 WVPASSEQ "$(WVPASS bup ls -a src/latest/"$tmpdir"/src)" ".
84 WVPASSEQ "$(WVPASS bup ls -F src/latest/"$tmpdir"/src)" "executable*
90 WVPASSEQ "$(WVPASS bup ls --file-type src/latest/"$tmpdir"/src)" "executable
98 WVPASSEQ "$(WVPASS bup ls -l / | tr -s ' ' ' ')" \
99 "d--------- ?/? - 1970-01-01 00:00 src"
101 WVPASSEQ "$(WVPASS bup ls -lA / | tr -s ' ' ' ')" \
102 "d--------- ?/? - 1970-01-01 00:00 .commit
103 d--------- ?/? - 1970-01-01 00:00 .tag
104 d--------- ?/? - 1970-01-01 00:00 src"
106 WVPASSEQ "$(WVPASS bup ls -lAF / | tr -s ' ' ' ')" \
107 "d--------- ?/? - 1970-01-01 00:00 .commit/
108 d--------- ?/? - 1970-01-01 00:00 .tag/
109 d--------- ?/? - 1970-01-01 00:00 src/"
111 WVPASSEQ "$(WVPASS bup ls -la / | tr -s ' ' ' ')" \
112 "d--------- ?/? - 1970-01-01 00:00 .
113 d--------- ?/? - 1970-01-01 00:00 ..
114 d--------- ?/? - 1970-01-01 00:00 .commit
115 d--------- ?/? - 1970-01-01 00:00 .tag
116 d--------- ?/? - 1970-01-01 00:00 src"
118 WVPASSEQ "$(WVPASS bup ls -laF / | tr -s ' ' ' ')" \
119 "d--------- ?/? - 1970-01-01 00:00 ./
120 d--------- ?/? - 1970-01-01 00:00 ../
121 d--------- ?/? - 1970-01-01 00:00 .commit/
122 d--------- ?/? - 1970-01-01 00:00 .tag/
123 d--------- ?/? - 1970-01-01 00:00 src/"
125 symlink_size="$(python -c "import os; print os.lstat('src/symlink').st_size")"
126 symlink_date="$(bup ls -l src/latest"$tmpdir"/src | grep symlink)"
127 symlink_date="$(echo "$symlink_date" \
128 | perl -ne 'm/.*? (\d+) (\d\d\d\d-\d\d-\d\d \d\d:\d\d)/ and print $2')"
129 uid="$(id -u)" || exit $?
130 gid="$(id -g)" || exit $?
131 user="$(id -un)" || exit $?
132 group="$(id -gn)" || exit $?
134 WVPASSEQ "$(bup ls -l src/latest"$tmpdir"/src | tr -s ' ' ' ')" \
135 "-rwx------ $user/$group - 1969-07-20 20:18 executable
136 prw------- $user/$group - 1969-07-20 20:18 fifo
137 -rw------- $user/$group 1024 1969-07-20 20:18 file
138 srwx------ $user/$group - 1969-07-20 20:18 socket
139 lrwxrwxrwx $user/$group $symlink_size $symlink_date symlink -> file"
141 WVPASSEQ "$(bup ls -la src/latest"$tmpdir"/src | tr -s ' ' ' ')" \
142 "drwx------ $user/$group - 1969-07-20 20:18 .
143 drwx------ $user/$group - 1969-07-20 20:18 ..
144 -rw------- $user/$group - 1969-07-20 20:18 .dotfile
145 -rwx------ $user/$group - 1969-07-20 20:18 executable
146 prw------- $user/$group - 1969-07-20 20:18 fifo
147 -rw------- $user/$group 1024 1969-07-20 20:18 file
148 srwx------ $user/$group - 1969-07-20 20:18 socket
149 lrwxrwxrwx $user/$group $symlink_size $symlink_date symlink -> file"
151 WVPASSEQ "$(bup ls -lA src/latest"$tmpdir"/src | tr -s ' ' ' ')" \
152 "-rw------- $user/$group - 1969-07-20 20:18 .dotfile
153 -rwx------ $user/$group - 1969-07-20 20:18 executable
154 prw------- $user/$group - 1969-07-20 20:18 fifo
155 -rw------- $user/$group 1024 1969-07-20 20:18 file
156 srwx------ $user/$group - 1969-07-20 20:18 socket
157 lrwxrwxrwx $user/$group $symlink_size $symlink_date symlink -> file"
159 WVPASSEQ "$(bup ls -lF src/latest"$tmpdir"/src | tr -s ' ' ' ')" \
160 "-rwx------ $user/$group - 1969-07-20 20:18 executable*
161 prw------- $user/$group - 1969-07-20 20:18 fifo|
162 -rw------- $user/$group 1024 1969-07-20 20:18 file
163 srwx------ $user/$group - 1969-07-20 20:18 socket=
164 lrwxrwxrwx $user/$group $symlink_size $symlink_date symlink@ -> file"
166 WVPASSEQ "$(bup ls -l --file-type src/latest"$tmpdir"/src | tr -s ' ' ' ')" \
167 "-rwx------ $user/$group - 1969-07-20 20:18 executable
168 prw------- $user/$group - 1969-07-20 20:18 fifo|
169 -rw------- $user/$group 1024 1969-07-20 20:18 file
170 srwx------ $user/$group - 1969-07-20 20:18 socket=
171 lrwxrwxrwx $user/$group $symlink_size $symlink_date symlink@ -> file"
173 WVPASSEQ "$(bup ls -ln src/latest"$tmpdir"/src | tr -s ' ' ' ')" \
174 "-rwx------ $uid/$gid - 1969-07-20 20:18 executable
175 prw------- $uid/$gid - 1969-07-20 20:18 fifo
176 -rw------- $uid/$gid 1024 1969-07-20 20:18 file
177 srwx------ $uid/$gid - 1969-07-20 20:18 socket
178 lrwxrwxrwx $uid/$gid $symlink_size $symlink_date symlink -> file"
180 WVSTART "ls (backup set - long)"
181 WVPASSEQ "$(bup ls -l src | cut -d' ' -f 1-2)" \
185 WVSTART "ls (dates TZ != UTC)"
187 symlink_date_central="$(bup ls -l src/latest"$tmpdir"/src | grep symlink)"
188 symlink_date_central="$(echo "$symlink_date_central" \
189 | perl -ne 'm/.*? (\d+) (\d\d\d\d-\d\d-\d\d \d\d:\d\d)/ and print $2')"
190 WVPASSEQ "$(bup ls -ln src/latest"$tmpdir"/src | tr -s ' ' ' ')" \
191 "-rwx------ $uid/$gid - 1969-07-20 15:18 executable
192 prw------- $uid/$gid - 1969-07-20 15:18 fifo
193 -rw------- $uid/$gid 1024 1969-07-20 15:18 file
194 srwx------ $uid/$gid - 1969-07-20 15:18 socket
195 lrwxrwxrwx $uid/$gid $symlink_size $symlink_date_central symlink -> file"
198 WVPASS rm -rf "$tmpdir"