File: t-push-bad-dns.sh

package info (click to toggle)
git-lfs 3.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,808 kB
  • sloc: sh: 21,256; makefile: 507; ruby: 417
file content (36 lines) | stat: -rwxr-xr-x 748 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/env bash

. "$(dirname "$0")/testlib.sh"

ensure_git_version_isnt $VERSION_LOWER "2.3.0"

begin_test "push: upload to bad dns"
(
  set -e

  reponame="$(basename "$0" ".sh")-bad-dns"
  setup_remote_repo "$reponame"
  clone_repo "$reponame" "$reponame"

  git lfs track "*.dat"
  printf "hi" > good.dat
  git add .gitattributes good.dat
  git commit -m "welp"

  port="$(echo "http://127.0.0.1:63378" | cut -f 3 -d ":")"
  git config lfs.url "http://git-lfs-bad-dns:$port"

  set +e
  GIT_TERMINAL_PROMPT=0 git push origin main 2>&1 | tee push.log
  res="${PIPESTATUS[0]}"
  set -e

  refute_server_object "$reponame" "$(calc_oid "hi")"
  if [ "$res" = "0" ]; then
    cat push.log

    echo "push successful?"
    exit 1
  fi
)
end_test