Blob


1 #!/bin/sh
2 #
3 # Copyright (c) 2024 Stefan Sperling <stsp@openbsd.org>
4 #
5 # Permission to use, copy, modify, and distribute this software for any
6 # purpose with or without fee is hereby granted, provided that the above
7 # copyright notice and this permission notice appear in all copies.
8 #
9 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 . ../cmdline/common.sh
18 . ./common.sh
20 test_file_changed() {
21 local testroot=`test_init file_changed 1`
23 got clone -a -q ${GOTD_TEST_REPO_URL} $testroot/repo-clone
24 ret=$?
25 if [ $ret -ne 0 ]; then
26 echo "got clone failed unexpectedly" >&2
27 test_done "$testroot" 1
28 return 1
29 fi
31 got checkout -q $testroot/repo-clone $testroot/wt >/dev/null
32 ret=$?
33 if [ $ret -ne 0 ]; then
34 echo "got checkout failed unexpectedly" >&2
35 test_done "$testroot" 1
36 return 1
37 fi
39 echo "change alpha" > $testroot/wt/alpha
40 (cd $testroot/wt && got commit -m 'make changes' > /dev/null)
41 local commit_id=`git_show_head $testroot/repo-clone`
42 local author_time=`git_show_author_time $testroot/repo-clone`
44 (printf "220\r\n250\r\n250\r\n250\r\n354\r\n250\r\n221\r\n" \
45 | timeout 5 nc -l "$GOTD_TEST_SMTP_PORT" > $testroot/stdout) &
47 sleep 1 # server starts up
49 got send -b main -q -r $testroot/repo-clone
50 ret=$?
51 if [ $ret -ne 0 ]; then
52 echo "got send failed unexpectedly" >&2
53 test_done "$testroot" "1"
54 return 1
55 fi
57 wait %1 # wait for nc -l
59 short_commit_id=`trim_obj_id 28 $commit_id`
60 HOSTNAME=`hostname`
61 printf "HELO localhost\r\n" > $testroot/stdout.expected
62 printf "MAIL FROM:<${GOTD_USER}@${HOSTNAME}>\r\n" \
63 >> $testroot/stdout.expected
64 printf "RCPT TO:<${GOTD_DEVUSER}>\r\n" >> $testroot/stdout.expected
65 printf "DATA\r\n" >> $testroot/stdout.expected
66 printf "From: ${GOTD_USER}@${HOSTNAME}\r\n" >> $testroot/stdout.expected
67 printf "To: ${GOTD_DEVUSER}\r\n" >> $testroot/stdout.expected
68 printf "Subject: $GOTD_TEST_REPO_NAME: " >> $testroot/stdout.expected
69 printf "${GOTD_DEVUSER} changed refs/heads/main: $short_commit_id\r\n" \
70 >> $testroot/stdout.expected
71 printf "\r\n" >> $testroot/stdout.expected
72 printf "commit $commit_id\n" >> $testroot/stdout.expected
73 printf "from: $GOT_AUTHOR\n" >> $testroot/stdout.expected
74 d=`date -u -r $author_time +"%a %b %e %X %Y UTC"`
75 printf "date: $d\n" >> $testroot/stdout.expected
76 printf "messagelen: 14\n" >> $testroot/stdout.expected
77 printf " \n" >> $testroot/stdout.expected
78 printf " make changes\n \n" >> $testroot/stdout.expected
79 printf " M alpha | 1+ 1-\n\n" >> $testroot/stdout.expected
80 printf "1 file changed, 1 insertion(+), 1 deletion(-)\n\n" \
81 >> $testroot/stdout.expected
82 printf "\r\n" >> $testroot/stdout.expected
83 printf ".\r\n" >> $testroot/stdout.expected
84 printf "QUIT\r\n" >> $testroot/stdout.expected
86 grep -v ^Date $testroot/stdout > $testroot/stdout.filtered
87 cmp -s $testroot/stdout.expected $testroot/stdout.filtered
88 ret=$?
89 if [ $ret -ne 0 ]; then
90 diff -u $testroot/stdout.expected $testroot/stdout.filtered
91 test_done "$testroot" "$ret"
92 return 1
93 fi
95 test_done "$testroot" "$ret"
96 }
98 test_many_commits_not_summarized() {
99 local testroot=`test_init many_commits_not_summarized 1`
101 got clone -a -q ${GOTD_TEST_REPO_URL} $testroot/repo-clone
102 ret=$?
103 if [ $ret -ne 0 ]; then
104 echo "got clone failed unexpectedly" >&2
105 test_done "$testroot" 1
106 return 1
107 fi
109 got checkout -q $testroot/repo-clone $testroot/wt >/dev/null
110 ret=$?
111 if [ $ret -ne 0 ]; then
112 echo "got checkout failed unexpectedly" >&2
113 test_done "$testroot" 1
114 return 1
115 fi
117 for i in `seq 1 24`; do
118 echo "alpha $i" > $testroot/wt/alpha
119 (cd $testroot/wt && got commit -m 'make changes' > /dev/null)
120 local commit_id=`git_show_head $testroot/repo-clone`
121 local author_time=`git_show_author_time $testroot/repo-clone`
122 d=`date -u -r $author_time +"%a %b %e %X %Y UTC"`
123 set -- "$@" "$commit_id $d"
124 done
126 (printf "220\r\n250\r\n250\r\n250\r\n354\r\n250\r\n221\r\n" \
127 | timeout 5 nc -l "$GOTD_TEST_SMTP_PORT" > $testroot/stdout) &
129 sleep 1 # server starts up
131 got send -b main -q -r $testroot/repo-clone
132 ret=$?
133 if [ $ret -ne 0 ]; then
134 echo "got send failed unexpectedly" >&2
135 test_done "$testroot" "1"
136 return 1
137 fi
139 wait %1 # wait for nc -l
141 short_commit_id=`trim_obj_id 28 $commit_id`
142 HOSTNAME=`hostname`
143 printf "HELO localhost\r\n" > $testroot/stdout.expected
144 printf "MAIL FROM:<${GOTD_USER}@${HOSTNAME}>\r\n" \
145 >> $testroot/stdout.expected
146 printf "RCPT TO:<${GOTD_DEVUSER}>\r\n" >> $testroot/stdout.expected
147 printf "DATA\r\n" >> $testroot/stdout.expected
148 printf "From: ${GOTD_USER}@${HOSTNAME}\r\n" \
149 >> $testroot/stdout.expected
150 printf "To: ${GOTD_DEVUSER}\r\n" >> $testroot/stdout.expected
151 printf "Subject: $GOTD_TEST_REPO_NAME: " >> $testroot/stdout.expected
152 printf "${GOTD_DEVUSER} changed refs/heads/main: $short_commit_id\r\n" \
153 >> $testroot/stdout.expected
154 printf "\r\n" >> $testroot/stdout.expected
155 for i in `seq 1 24`; do
156 s=`pop_idx $i "$@"`
157 commit_id=$(echo $s | cut -d' ' -f1)
158 commit_time=$(echo "$s" | sed -e "s/^$commit_id //g")
159 printf "commit $commit_id\n" >> $testroot/stdout.expected
160 printf "from: $GOT_AUTHOR\n" >> $testroot/stdout.expected
161 printf "date: $commit_time\n" >> $testroot/stdout.expected
162 printf "messagelen: 14\n" >> $testroot/stdout.expected
163 printf " \n" >> $testroot/stdout.expected
164 printf " make changes\n \n" >> $testroot/stdout.expected
165 printf " M alpha | 1+ 1-\n\n" \
166 >> $testroot/stdout.expected
167 printf "1 file changed, 1 insertion(+), 1 deletion(-)\n\n" \
168 >> $testroot/stdout.expected
169 done
170 printf "\r\n" >> $testroot/stdout.expected
171 printf ".\r\n" >> $testroot/stdout.expected
172 printf "QUIT\r\n" >> $testroot/stdout.expected
174 grep -v ^Date $testroot/stdout > $testroot/stdout.filtered
175 cmp -s $testroot/stdout.expected $testroot/stdout.filtered
176 ret=$?
177 if [ $ret -ne 0 ]; then
178 diff -u $testroot/stdout.expected $testroot/stdout.filtered
179 test_done "$testroot" "$ret"
180 return 1
181 fi
183 test_done "$testroot" "$ret"
186 test_many_commits_summarized() {
187 local testroot=`test_init many_commits_summarized 1`
189 got clone -a -q ${GOTD_TEST_REPO_URL} $testroot/repo-clone
190 ret=$?
191 if [ $ret -ne 0 ]; then
192 echo "got clone failed unexpectedly" >&2
193 test_done "$testroot" 1
194 return 1
195 fi
197 got checkout -q $testroot/repo-clone $testroot/wt >/dev/null
198 ret=$?
199 if [ $ret -ne 0 ]; then
200 echo "got checkout failed unexpectedly" >&2
201 test_done "$testroot" 1
202 return 1
203 fi
205 for i in `seq 1 51`; do
206 echo "alpha $i" > $testroot/wt/alpha
207 (cd $testroot/wt && got commit -m 'make changes' > /dev/null)
208 local commit_id=`git_show_head $testroot/repo-clone`
209 local short_commit_id=`trim_obj_id 33 $commit_id`
210 local author_time=`git_show_author_time $testroot/repo-clone`
211 d=`date -u -r $author_time +"%F"`
212 set -- "$@" "$short_commit_id $d"
213 done
215 (printf "220\r\n250\r\n250\r\n250\r\n354\r\n250\r\n221\r\n" \
216 | timeout 5 nc -l "$GOTD_TEST_SMTP_PORT" > $testroot/stdout) &
218 sleep 1 # server starts up
220 got send -b main -q -r $testroot/repo-clone
221 ret=$?
222 if [ $ret -ne 0 ]; then
223 echo "got send failed unexpectedly" >&2
224 test_done "$testroot" "1"
225 return 1
226 fi
228 wait %1 # wait for nc -l
230 short_commit_id=`trim_obj_id 28 $commit_id`
231 HOSTNAME=`hostname`
232 printf "HELO localhost\r\n" > $testroot/stdout.expected
233 printf "MAIL FROM:<${GOTD_USER}@${HOSTNAME}>\r\n" \
234 >> $testroot/stdout.expected
235 printf "RCPT TO:<${GOTD_DEVUSER}>\r\n" >> $testroot/stdout.expected
236 printf "DATA\r\n" >> $testroot/stdout.expected
237 printf "From: ${GOTD_USER}@${HOSTNAME}\r\n" \
238 >> $testroot/stdout.expected
239 printf "To: ${GOTD_DEVUSER}\r\n" >> $testroot/stdout.expected
240 printf "Subject: $GOTD_TEST_REPO_NAME: " >> $testroot/stdout.expected
241 printf "${GOTD_DEVUSER} changed refs/heads/main: $short_commit_id\r\n" \
242 >> $testroot/stdout.expected
243 printf "\r\n" >> $testroot/stdout.expected
244 for i in `seq 1 51`; do
245 s=`pop_idx $i "$@"`
246 commit_id=$(echo $s | cut -d' ' -f1)
247 commit_time=$(echo "$s" | sed -e "s/^$commit_id //g")
248 printf "$commit_time $commit_id $GOT_AUTHOR_8 make changes\n" \
249 >> $testroot/stdout.expected
250 done
251 printf "\r\n" >> $testroot/stdout.expected
252 printf ".\r\n" >> $testroot/stdout.expected
253 printf "QUIT\r\n" >> $testroot/stdout.expected
255 grep -v ^Date $testroot/stdout > $testroot/stdout.filtered
256 cmp -s $testroot/stdout.expected $testroot/stdout.filtered
257 ret=$?
258 if [ $ret -ne 0 ]; then
259 diff -u $testroot/stdout.expected $testroot/stdout.filtered
260 test_done "$testroot" "$ret"
261 return 1
262 fi
264 test_done "$testroot" "$ret"
267 test_branch_created() {
268 local testroot=`test_init branch_created 1`
270 got clone -a -q ${GOTD_TEST_REPO_URL} $testroot/repo-clone
271 ret=$?
272 if [ $ret -ne 0 ]; then
273 echo "got clone failed unexpectedly" >&2
274 test_done "$testroot" 1
275 return 1
276 fi
278 got checkout -q $testroot/repo-clone $testroot/wt >/dev/null
279 ret=$?
280 if [ $ret -ne 0 ]; then
281 echo "got checkout failed unexpectedly" >&2
282 test_done "$testroot" 1
283 return 1
284 fi
286 (cd $testroot/wt && got branch newbranch > /dev/null)
288 echo "change alpha on branch" > $testroot/wt/alpha
289 (cd $testroot/wt && got commit -m 'newbranch' > /dev/null)
290 local commit_id=`git_show_branch_head $testroot/repo-clone newbranch`
291 local author_time=`git_show_author_time $testroot/repo-clone $commit_id`
293 (printf "220\r\n250\r\n250\r\n250\r\n354\r\n250\r\n221\r\n" \
294 | timeout 5 nc -l "$GOTD_TEST_SMTP_PORT" > $testroot/stdout) &
296 sleep 1 # server starts up
298 got send -b newbranch -q -r $testroot/repo-clone
299 ret=$?
300 if [ $ret -ne 0 ]; then
301 echo "got send failed unexpectedly" >&2
302 test_done "$testroot" "1"
303 return 1
304 fi
306 wait %1 # wait for nc -l
308 short_commit_id=`trim_obj_id 28 $commit_id`
309 HOSTNAME=`hostname`
310 printf "HELO localhost\r\n" > $testroot/stdout.expected
311 printf "MAIL FROM:<${GOTD_USER}@${HOSTNAME}>\r\n" \
312 >> $testroot/stdout.expected
313 printf "RCPT TO:<${GOTD_DEVUSER}>\r\n" >> $testroot/stdout.expected
314 printf "DATA\r\n" >> $testroot/stdout.expected
315 printf "From: ${GOTD_USER}@${HOSTNAME}\r\n" >> $testroot/stdout.expected
316 printf "To: ${GOTD_DEVUSER}\r\n" >> $testroot/stdout.expected
317 printf "Subject: $GOTD_TEST_REPO_NAME: " >> $testroot/stdout.expected
318 printf "${GOTD_DEVUSER} created refs/heads/newbranch: $short_commit_id\r\n" \
319 >> $testroot/stdout.expected
320 printf "\r\n" >> $testroot/stdout.expected
321 printf "commit $commit_id\n" >> $testroot/stdout.expected
322 printf "from: $GOT_AUTHOR\n" >> $testroot/stdout.expected
323 d=`date -u -r $author_time +"%a %b %e %X %Y UTC"`
324 printf "date: $d\n" >> $testroot/stdout.expected
325 printf "messagelen: 11\n" >> $testroot/stdout.expected
326 printf " \n" >> $testroot/stdout.expected
327 printf " newbranch\n \n" >> $testroot/stdout.expected
328 printf " M alpha | 1+ 1-\n\n" >> $testroot/stdout.expected
329 printf "1 file changed, 1 insertion(+), 1 deletion(-)\n\n" \
330 >> $testroot/stdout.expected
331 printf "\r\n" >> $testroot/stdout.expected
332 printf ".\r\n" >> $testroot/stdout.expected
333 printf "QUIT\r\n" >> $testroot/stdout.expected
335 grep -v ^Date $testroot/stdout > $testroot/stdout.filtered
336 cmp -s $testroot/stdout.expected $testroot/stdout.filtered
337 ret=$?
338 if [ $ret -ne 0 ]; then
339 diff -u $testroot/stdout.expected $testroot/stdout.filtered
340 test_done "$testroot" "$ret"
341 return 1
342 fi
344 test_done "$testroot" "$ret"
347 test_branch_removed() {
348 local testroot=`test_init branch_removed 1`
350 got clone -a -q ${GOTD_TEST_REPO_URL} $testroot/repo-clone
351 ret=$?
352 if [ $ret -ne 0 ]; then
353 echo "got clone failed unexpectedly" >&2
354 test_done "$testroot" 1
355 return 1
356 fi
358 (printf "220\r\n250\r\n250\r\n250\r\n354\r\n250\r\n221\r\n" \
359 | timeout 5 nc -l "$GOTD_TEST_SMTP_PORT" > $testroot/stdout) &
361 sleep 1 # server starts up
363 local commit_id=`git_show_branch_head $testroot/repo-clone newbranch`
364 local short_commit_id=`trim_obj_id 28 $commit_id`
366 got send -d newbranch -q -r $testroot/repo-clone
367 ret=$?
368 if [ $ret -ne 0 ]; then
369 echo "got send failed unexpectedly" >&2
370 test_done "$testroot" "1"
371 return 1
372 fi
374 wait %1 # wait for nc -l
376 HOSTNAME=`hostname`
377 printf "HELO localhost\r\n" > $testroot/stdout.expected
378 printf "MAIL FROM:<${GOTD_USER}@${HOSTNAME}>\r\n" \
379 >> $testroot/stdout.expected
380 printf "RCPT TO:<${GOTD_DEVUSER}>\r\n" >> $testroot/stdout.expected
381 printf "DATA\r\n" >> $testroot/stdout.expected
382 printf "From: ${GOTD_USER}@${HOSTNAME}\r\n" >> $testroot/stdout.expected
383 printf "To: ${GOTD_DEVUSER}\r\n" >> $testroot/stdout.expected
384 printf "Subject: $GOTD_TEST_REPO_NAME: " >> $testroot/stdout.expected
385 printf "${GOTD_DEVUSER} removed refs/heads/newbranch: $short_commit_id\r\n" \
386 >> $testroot/stdout.expected
387 printf "\r\n" >> $testroot/stdout.expected
388 printf "Removed refs/heads/newbranch: $commit_id\n" \
389 >> $testroot/stdout.expected
390 printf "\r\n" >> $testroot/stdout.expected
391 printf ".\r\n" >> $testroot/stdout.expected
392 printf "QUIT\r\n" >> $testroot/stdout.expected
394 grep -v ^Date $testroot/stdout > $testroot/stdout.filtered
395 cmp -s $testroot/stdout.expected $testroot/stdout.filtered
396 ret=$?
397 if [ $ret -ne 0 ]; then
398 diff -u $testroot/stdout.expected $testroot/stdout.filtered
399 test_done "$testroot" "$ret"
400 return 1
401 fi
403 test_done "$testroot" "$ret"
406 test_tag_created() {
407 local testroot=`test_init tag_created 1`
409 got clone -a -q ${GOTD_TEST_REPO_URL} $testroot/repo-clone
410 ret=$?
411 if [ $ret -ne 0 ]; then
412 echo "got clone failed unexpectedly" >&2
413 test_done "$testroot" 1
414 return 1
415 fi
417 got tag -r $testroot/repo-clone -m "new tag" 1.0 > /dev/null
418 local commit_id=`git_show_head $testroot/repo-clone`
419 local tagger_time=`git_show_tagger_time $testroot/repo-clone 1.0`
420 local tag_id=`got ref -r $testroot/repo-clone -l \
421 | grep "^refs/tags/$tag" | tr -d ' ' | cut -d: -f2`
422 local short_tag_id=`trim_obj_id 28 $tag_id`
424 (printf "220\r\n250\r\n250\r\n250\r\n354\r\n250\r\n221\r\n" \
425 | timeout 5 nc -l "$GOTD_TEST_SMTP_PORT" > $testroot/stdout) &
427 sleep 1 # server starts up
429 got send -t 1.0 -q -r $testroot/repo-clone
430 ret=$?
431 if [ $ret -ne 0 ]; then
432 echo "got send failed unexpectedly" >&2
433 test_done "$testroot" "1"
434 return 1
435 fi
437 wait %1 # wait for nc -l
439 HOSTNAME=`hostname`
440 printf "HELO localhost\r\n" > $testroot/stdout.expected
441 printf "MAIL FROM:<${GOTD_USER}@${HOSTNAME}>\r\n" \
442 >> $testroot/stdout.expected
443 printf "RCPT TO:<${GOTD_DEVUSER}>\r\n" >> $testroot/stdout.expected
444 printf "DATA\r\n" >> $testroot/stdout.expected
445 printf "From: ${GOTD_USER}@${HOSTNAME}\r\n" >> $testroot/stdout.expected
446 printf "To: ${GOTD_DEVUSER}\r\n" >> $testroot/stdout.expected
447 printf "Subject: $GOTD_TEST_REPO_NAME: " >> $testroot/stdout.expected
448 printf "${GOTD_DEVUSER} created refs/tags/1.0: $short_tag_id\r\n" \
449 >> $testroot/stdout.expected
450 printf "\r\n" >> $testroot/stdout.expected
451 printf "tag refs/tags/1.0\n" >> $testroot/stdout.expected
452 printf "from: $GOT_AUTHOR\n" >> $testroot/stdout.expected
453 d=`date -u -r $tagger_time +"%a %b %e %X %Y UTC"`
454 printf "date: $d\n" >> $testroot/stdout.expected
455 printf "object: commit $commit_id\n" >> $testroot/stdout.expected
456 printf "messagelen: 9\n" >> $testroot/stdout.expected
457 printf " \n" >> $testroot/stdout.expected
458 printf " new tag\n \n" >> $testroot/stdout.expected
459 printf "\r\n" >> $testroot/stdout.expected
460 printf ".\r\n" >> $testroot/stdout.expected
461 printf "QUIT\r\n" >> $testroot/stdout.expected
463 grep -v ^Date $testroot/stdout > $testroot/stdout.filtered
464 cmp -s $testroot/stdout.expected $testroot/stdout.filtered
465 ret=$?
466 if [ $ret -ne 0 ]; then
467 diff -u $testroot/stdout.expected $testroot/stdout.filtered
468 test_done "$testroot" "$ret"
469 return 1
470 fi
472 test_done "$testroot" "$ret"
475 test_tag_changed() {
476 local testroot=`test_init tag_changed 1`
478 got clone -a -q ${GOTD_TEST_REPO_URL} $testroot/repo-clone
479 ret=$?
480 if [ $ret -ne 0 ]; then
481 echo "got clone failed unexpectedly" >&2
482 test_done "$testroot" 1
483 return 1
484 fi
486 got checkout -q $testroot/repo-clone $testroot/wt >/dev/null
487 ret=$?
488 if [ $ret -ne 0 ]; then
489 echo "got checkout failed unexpectedly" >&2
490 test_done "$testroot" 1
491 return 1
492 fi
494 echo "change alpha" > $testroot/wt/alpha
495 (cd $testroot/wt && got commit -m 'make changes' > /dev/null)
496 local commit_id=`git_show_head $testroot/repo-clone`
498 got ref -r $testroot/repo-clone -d refs/tags/1.0 >/dev/null
499 got tag -r $testroot/repo-clone -m "new tag" 1.0 > /dev/null
500 local tagger_time=`git_show_tagger_time $testroot/repo-clone 1.0`
501 local tag_id=`got ref -r $testroot/repo-clone -l \
502 | grep "^refs/tags/$tag" | tr -d ' ' | cut -d: -f2`
503 local short_tag_id=`trim_obj_id 28 $tag_id`
505 (printf "220\r\n250\r\n250\r\n250\r\n354\r\n250\r\n221\r\n" \
506 | timeout 5 nc -l "$GOTD_TEST_SMTP_PORT" > $testroot/stdout) &
508 sleep 1 # server starts up
510 got send -f -t 1.0 -q -r $testroot/repo-clone
511 ret=$?
512 if [ $ret -ne 0 ]; then
513 echo "got send failed unexpectedly" >&2
514 test_done "$testroot" "1"
515 return 1
516 fi
518 wait %1 # wait for nc -l
520 HOSTNAME=`hostname`
521 printf "HELO localhost\r\n" > $testroot/stdout.expected
522 printf "MAIL FROM:<${GOTD_USER}@${HOSTNAME}>\r\n" \
523 >> $testroot/stdout.expected
524 printf "RCPT TO:<${GOTD_DEVUSER}>\r\n" >> $testroot/stdout.expected
525 printf "DATA\r\n" >> $testroot/stdout.expected
526 printf "From: ${GOTD_USER}@${HOSTNAME}\r\n" >> $testroot/stdout.expected
527 printf "To: ${GOTD_DEVUSER}\r\n" >> $testroot/stdout.expected
528 printf "Subject: $GOTD_TEST_REPO_NAME: " >> $testroot/stdout.expected
529 printf "${GOTD_DEVUSER} changed refs/tags/1.0: $short_tag_id\r\n" \
530 >> $testroot/stdout.expected
531 printf "\r\n" >> $testroot/stdout.expected
532 printf "tag refs/tags/1.0\n" >> $testroot/stdout.expected
533 printf "from: $GOT_AUTHOR\n" >> $testroot/stdout.expected
534 d=`date -u -r $tagger_time +"%a %b %e %X %Y UTC"`
535 printf "date: $d\n" >> $testroot/stdout.expected
536 printf "object: commit $commit_id\n" >> $testroot/stdout.expected
537 printf "messagelen: 9\n" >> $testroot/stdout.expected
538 printf " \n" >> $testroot/stdout.expected
539 printf " new tag\n \n" >> $testroot/stdout.expected
540 printf "\r\n" >> $testroot/stdout.expected
541 printf ".\r\n" >> $testroot/stdout.expected
542 printf "QUIT\r\n" >> $testroot/stdout.expected
544 grep -v ^Date $testroot/stdout > $testroot/stdout.filtered
545 cmp -s $testroot/stdout.expected $testroot/stdout.filtered
546 ret=$?
547 if [ $ret -ne 0 ]; then
548 diff -u $testroot/stdout.expected $testroot/stdout.filtered
549 test_done "$testroot" "$ret"
550 return 1
551 fi
553 test_done "$testroot" "$ret"
556 test_parseargs "$@"
557 run_test test_file_changed
558 run_test test_many_commits_not_summarized
559 run_test test_many_commits_summarized
560 run_test test_branch_created
561 run_test test_branch_removed
562 run_test test_tag_created
563 run_test test_tag_changed