add comments; use --one-time for testing
This commit is contained in:
parent
ac70751767
commit
d58a241648
|
|
@ -14,6 +14,8 @@ if [ "$1" != "clone" ]; then
|
||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# `git credential fill` requires the repo url match to consume the credentials stored by git-sync.
|
||||||
|
# Askpass git only support repo started with "file://" which is used in test_e2e.sh.
|
||||||
REPO=$(echo "$@" | grep -o "file://[^ ]*")
|
REPO=$(echo "$@" | grep -o "file://[^ ]*")
|
||||||
PASSWD=$(echo "url=${REPO}" | git credential fill | grep -o "password=.*")
|
PASSWD=$(echo "url=${REPO}" | git credential fill | grep -o "password=.*")
|
||||||
# Test case much match the magic password below.
|
# Test case much match the magic password below.
|
||||||
|
|
|
||||||
10
test_e2e.sh
10
test_e2e.sh
|
|
@ -637,14 +637,13 @@ GIT_SYNC \
|
||||||
--password="I have no idea what the password is." \
|
--password="I have no idea what the password is." \
|
||||||
--logtostderr \
|
--logtostderr \
|
||||||
--v=5 \
|
--v=5 \
|
||||||
--wait=0.1 \
|
--one-time \
|
||||||
--repo="file://$REPO" \
|
--repo="file://$REPO" \
|
||||||
--branch=master \
|
--branch=master \
|
||||||
--rev=HEAD \
|
--rev=HEAD \
|
||||||
--root="$ROOT" \
|
--root="$ROOT" \
|
||||||
--dest="link" \
|
--dest="link" \
|
||||||
> "$DIR"/log."$TESTCASE" 2>&1 &
|
> "$DIR"/log."$TESTCASE" 2>&1
|
||||||
sleep 3
|
|
||||||
# check for failure
|
# check for failure
|
||||||
assert_file_absent "$ROOT"/link/file
|
assert_file_absent "$ROOT"/link/file
|
||||||
# run with askpass_git with correct password
|
# run with askpass_git with correct password
|
||||||
|
|
@ -654,14 +653,13 @@ GIT_SYNC \
|
||||||
--password="Lov3!k0os" \
|
--password="Lov3!k0os" \
|
||||||
--logtostderr \
|
--logtostderr \
|
||||||
--v=5 \
|
--v=5 \
|
||||||
--wait=0.1 \
|
--one-time \
|
||||||
--repo="file://$REPO" \
|
--repo="file://$REPO" \
|
||||||
--branch=master \
|
--branch=master \
|
||||||
--rev=HEAD \
|
--rev=HEAD \
|
||||||
--root="$ROOT" \
|
--root="$ROOT" \
|
||||||
--dest="link" \
|
--dest="link" \
|
||||||
> "$DIR"/log."$TESTCASE" 2>&1 &
|
> "$DIR"/log."$TESTCASE" 2>&1
|
||||||
sleep 3
|
|
||||||
assert_link_exists "$ROOT"/link
|
assert_link_exists "$ROOT"/link
|
||||||
assert_file_exists "$ROOT"/link/file
|
assert_file_exists "$ROOT"/link/file
|
||||||
assert_file_eq "$ROOT"/link/file "$TESTCASE 1"
|
assert_file_eq "$ROOT"/link/file "$TESTCASE 1"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue