add basic http clone/fetch tests
[gitweb.git] / t / t5540-http-push.sh
index c236b5e83beed8997e8f6c3a50f0bb74f73f3f33..cefab4543a3cd093b1cde2aa23f96ae2fa2de692 100755 (executable)
@@ -11,6 +11,7 @@ This test runs various sanity checks on http-push.'
 
 ROOT_PATH="$PWD"
 LIB_HTTPD_DAV=t
+LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5540'}
 
 if git http-push > /dev/null 2>&1 || [ $? -eq 128 ]
 then
@@ -20,13 +21,7 @@ then
 fi
 
 . "$TEST_DIRECTORY"/lib-httpd.sh
-
-if ! start_httpd >&3 2>&4
-then
-       say "skipping test, web server setup failed"
-       test_done
-       exit
-fi
+start_httpd
 
 test_expect_success 'setup remote repository' '
        cd "$ROOT_PATH" &&
@@ -94,6 +89,13 @@ test_expect_success 'MKCOL sends directory names with trailing slashes' '
 
 '
 
+test_expect_success 'PUT and MOVE sends object to URLs with SHA-1 hash suffix' '
+
+       grep -P "\"(?:PUT|MOVE) .+objects/[\da-z]{2}/[\da-z]{38}_[\da-z\-]{40} HTTP/[0-9.]+\" 20\d" \
+               < "$HTTPD_ROOT_PATH"/access.log
+
+'
+
 stop_httpd
 
 test_done