From a341fb62f9c3857c2eaf68bf73fe8eb835c6a586 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Sat, 11 Jun 2022 10:51:37 -0700 Subject: [PATCH] Make ssh e2e test not use --one-time There is functionality that needs to be tested beyond that. --- test_e2e.sh | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/test_e2e.sh b/test_e2e.sh index 46d74ed..d62b03b 100755 --- a/test_e2e.sh +++ b/test_e2e.sh @@ -1800,8 +1800,12 @@ function e2e::ssh() { IP=$(docker_ip "$CTR") git -C "$REPO" commit -qam "$FUNCNAME" + # First sync + echo "$FUNCNAME 1" > "$REPO"/file + git -C "$REPO" commit -qam "$FUNCNAME 1" + GIT_SYNC \ - --one-time \ + --period=100ms \ --repo="test@$IP:/src" \ --branch="$MAIN_BRANCH" \ --rev=HEAD \ @@ -1809,10 +1813,26 @@ function e2e::ssh() { --link="link" \ --ssh \ --ssh-known-hosts=false \ - >> "$1" 2>&1 + >> "$1" 2>&1 & + sleep 3 assert_link_exists "$ROOT"/link assert_file_exists "$ROOT"/link/file - assert_file_eq "$ROOT"/link/file "$FUNCNAME" + assert_file_eq "$ROOT"/link/file "$FUNCNAME 1" + + # Move HEAD forward + echo "$FUNCNAME 2" > "$REPO"/file + git -C "$REPO" commit -qam "$FUNCNAME 2" + sleep 3 + assert_link_exists "$ROOT"/link + assert_file_exists "$ROOT"/link/file + assert_file_eq "$ROOT"/link/file "$FUNCNAME 2" + + # Move HEAD backward + git -C "$REPO" reset -q --hard HEAD^ + sleep 3 + assert_link_exists "$ROOT"/link + assert_file_exists "$ROOT"/link/file + assert_file_eq "$ROOT"/link/file "$FUNCNAME 1" } ##############################################