2 # Including in script/integration and every test/test-*.sh file.
12 if [[ $UNAME == MINGW* || $UNAME == MSYS* || $UNAME == CYGWIN* ]]
16 # Windows might be MSYS2 which does not have the shasum Perl wrapper
17 # script by default, so use sha256sum directly. MacOS on the other hand
18 # does not have sha256sum, so still use shasum as the default.
21 elif [[ $UNAME == *Darwin* ]]
28 if [ $IS_WINDOWS -eq 1 ]; then
30 elif [ $IS_MAC -eq 1 ]; then
31 # no readlink -f on Mac
36 target=`basename $target`
37 while [ -L "$target" ]
39 target=`readlink $target`
41 target=`basename $target`
44 local resolveddir=`pwd -P`
46 printf '%s' "$resolveddir/$target"
54 # The root directory for the git-lfs repository by default.
55 if [ -z "$ROOTDIR" ]; then
56 ROOTDIR=$(cd $(dirname "$0")/.. && pwd -P)
59 # Where Git LFS outputs the compiled binaries
60 BINPATH="$ROOTDIR/bin"
62 # Put bin path on PATH
65 # Always provide a test dir outside our git repo if not specified
66 TEMPDIR_PREFIX="git-lfs_TEMP.XXXXXX"
67 if [ -z "$GIT_LFS_TEST_DIR" ]; then
68 GIT_LFS_TEST_DIR=$(mktemp -d -t "$TEMPDIR_PREFIX")
69 GIT_LFS_TEST_DIR=$(resolve_symlink $GIT_LFS_TEST_DIR)
70 # cleanup either after single test or at end of integration (except on fail)
71 RM_GIT_LFS_TEST_DIR=yes
73 # create a temporary work space
74 TMPDIR=$GIT_LFS_TEST_DIR
76 # This is unique to every test file, and cleared after every test run.
77 TRASHDIR="$TMPDIR/$(basename "$0")-$$"
79 # The directory that the test Git server works from. This cleared at the
80 # beginning of every test run.
81 REMOTEDIR="$ROOTDIR/test/remote"
83 # The directory that stores credentials. Credentials are stored in files with
84 # the username:password with filenames identifying the host (port numbers are
87 # # stores the credentials for http://127.0.0.1:*
90 # # stores the credentials for http://git-server.com
91 # $CREDSDIR/git-server.com
93 CREDSDIR="$REMOTEDIR/creds"
95 # This is the prefix for Git config files. See the "Test Suite" section in
97 LFS_CONFIG="$REMOTEDIR/config"
99 # This file contains the URL of the test Git server. See the "Test Suite"
100 # section in test/README.md
101 LFS_URL_FILE="$REMOTEDIR/url"
103 # This file contains the SSL URL of the test Git server. See the "Test Suite"
104 # section in test/README.md
105 LFS_SSL_URL_FILE="$REMOTEDIR/sslurl"
107 # This file contains the client cert SSL URL of the test Git server. See the "Test Suite"
108 # section in test/README.md
109 LFS_CLIENT_CERT_URL_FILE="$REMOTEDIR/clientcerturl"
111 # This file contains the self-signed SSL cert of the TLS endpoint of the test Git server.
112 LFS_CERT_FILE="$REMOTEDIR/cert"
114 # This file contains the client certificate of the client cert endpoint of the test Git server.
115 LFS_CLIENT_CERT_FILE="$REMOTEDIR/client.crt"
117 # This file contains the client key of the client cert endpoint of the test Git server.
118 LFS_CLIENT_KEY_FILE="$REMOTEDIR/client.key"
120 # the fake home dir used for the initial setup
121 TESTHOME="$REMOTEDIR/home"
123 GIT_CONFIG_NOSYSTEM=1
124 GIT_TERMINAL_PROMPT=0
126 APPVEYOR_REPO_COMMIT_MESSAGE="test: env test should look for GIT_SSH too"
129 export GIT_CONFIG_NOSYSTEM
131 export APPVEYOR_REPO_COMMIT_MESSAGE
136 if [ $IS_WINDOWS -eq 1 ]; then
137 # prevent Windows OpenSSH from opening GUI prompts
140 . "test/testhelpers.sh"