Debian Codegraph @

t/t-expired.sh

raw symbols SCIP
1 #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash
2
3 . "$(dirnamescip-shell system . . dirname. "$0")/testlib.sh"
4
5 declare -a expiration_types=("absolute" "relative" "both")
6
7 for typ in "${expiration_types[@]}"; do
8 begin_test "expired action ($typ time)"
9 (
10 set -e
11
12 reponame="expired-$typ"
13 setup_remote_repo "$reponame"
14 clone_repo "$reponame" "$reponame"
15
16 contents="contents"
17 contents_oid="$(calc_oid "$contents")"
18
19 gitscip-shell system . . git. lfs track "*.dat"
20 gitscip-shell system . . git. add .gitattributes
21 gitscip-shell system . . git. commit -m "initial commit"
22
23 printfscip-shell system . . printf. "%s" "$contents" > a.dat
24
25 gitscip-shell system . . git. add a.dat
26 gitscip-shell system . . git. commit -m "add a.dat"
27
28 GIT_TRACE=1 gitscip-shell system . . git. push origin main 2>&1 | teescip-shell system . . tee. push.log
29 if [scip-shell system . . `[`. "0" -eq "${PIPESTATUS[0]}" ]; then
30 echoscip-shell system . . echo. >&2 "fatal: expected push to fail, didn't"
31 exit 1
32 fi
33
34 refute_server_object "$reponame" "$contents_oid"
35 )
36 end_test
37 done
38
39 for typ in "${expiration_types[@]}"; do
40 begin_test "ssh expired ($typ time; git-lfs-authenticate)"
41 (
42 set -e
43
44 reponame="ssh-expired-$typ"
45 setup_remote_repo "$reponame"
46 clone_repo "$reponame" "$reponame"
47
48 sshurl="${GITSERVER/http:\/\//ssh://git@}/$reponame"
49 gitscip-shell system . . git. config lfs.url "$sshurl"
50
51 contents="contents"
52 contents_oid="$(calc_oid "$contents")"
53
54 gitscip-shell system . . git. lfs track "*.dat"
55 gitscip-shell system . . git. add .gitattributes
56 gitscip-shell system . . git. commit -m "initial commit"
57
58 printfscip-shell system . . printf. "%s" "$contents" > a.dat
59
60 gitscip-shell system . . git. add a.dat
61 gitscip-shell system . . git. commit -m "add a.dat"
62
63 GIT_TRACE=1 gitscip-shell system . . git. push origin main 2>&1 | teescip-shell system . . tee. push.log
64 grepscip-shell system . . grep. "ssh cache expired" push.log
65 )
66 end_test
67 done