commit 14551591612b0ec1b9956851d2e3bb672761636b from: Stefan Sperling via: Thomas Adam date: Sat Jul 26 10:36:08 2025 UTC rename test "large loose objects" to "large files" We might have more large file test cases eventually. And the existing test involves packing the loose objects. So the former name was not ideal. commit - bcbad685e6f97b8f9112a4c68d1c7937c5f519a3 commit + 14551591612b0ec1b9956851d2e3bb672761636b blob - 1698972f9fb04c46f3e9026125a1493811eb358d blob + 19405752bdd0434de7f199e1bf626cfec39abb98 --- regress/gotd/Makefile +++ regress/gotd/Makefile @@ -8,7 +8,7 @@ REGRESS_TARGETS=test_repo_read test_repo_read_group \ test_email_notification test_http_notification \ test_git_interop test_email_and_http_notification \ test_http_notification_hmac test_connection_limit \ - test_large_loose_objects + test_large_files NOOBJ=Yes CLEANFILES=gotd.conf gotd-secrets.conf @@ -253,9 +253,9 @@ prepare_test_repo_empty: ensure_root @chown ${GOTD_USER} "${GOTD_TEST_REPO}" @su -m ${GOTD_USER} -c 'env $(GOTD_TEST_ENV) sh ./prepare_test_repo.sh 1' -prepare_large_loose_objects: ensure_root prepare_test_repo +prepare_large_files: ensure_root prepare_test_repo @su -m ${GOTD_USER} -c 'env $(GOTD_TEST_ENV) \ - sh ./prepare_large_loose_objects.sh' + sh ./prepare_large_files.sh' test_repo_read: prepare_test_repo start_gotd_ro @-$(GOTD_TRAP); su ${GOTD_TEST_USER} -c \ @@ -355,9 +355,9 @@ test_connection_limit: prepare_test_repo start_gotd_co 'env $(GOTD_TEST_ENV) sh ./connection_limit.sh' @$(GOTD_STOP_CMD) 2>/dev/null -test_large_loose_objects: prepare_large_loose_objects start_gotd_ro +test_large_files: prepare_large_files start_gotd_ro @-$(GOTD_TRAP); su ${GOTD_TEST_USER} -c \ - 'env $(GOTD_TEST_ENV) sh ./large_loose_objects.sh' + 'env $(GOTD_TEST_ENV) sh ./large_files.sh' @$(GOTD_STOP_CMD) 2>/dev/null .include blob - 358b001d6584ee02bae559e83d62199d0b6ea030 (mode 644) blob + /dev/null --- regress/gotd/large_loose_objects.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2025 Stefan Sperling -# -# Permission to use, copy, modify, and distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -. ../cmdline/common.sh -. ./common.sh - -test_clone_basic() { - local testroot=`test_init clone_basic 1` - - got clone -q ${GOTD_TEST_REPO_URL} $testroot/repo-clone - ret=$? - if [ $ret -ne 0 ]; then - echo "got clone failed unexpectedly" >&2 - test_done "$testroot" "1" - return 1 - fi - - # Verify that the clone operation worked fine. - git_fsck "$testroot" "$testroot/repo-clone" - ret=$? - if [ $ret -ne 0 ]; then - test_done "$testroot" "1" - return 1 - fi - - got tree -R -r "$testroot/repo-clone" > $testroot/stdout - cat > $testroot/stdout.expected < +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +. ../cmdline/common.sh +. ./common.sh + +test_clone_basic() { + local testroot=`test_init clone_basic 1` + + got clone -q ${GOTD_TEST_REPO_URL} $testroot/repo-clone + ret=$? + if [ $ret -ne 0 ]; then + echo "got clone failed unexpectedly" >&2 + test_done "$testroot" "1" + return 1 + fi + + # Verify that the clone operation worked fine. + git_fsck "$testroot" "$testroot/repo-clone" + ret=$? + if [ $ret -ne 0 ]; then + test_done "$testroot" "1" + return 1 + fi + + got tree -R -r "$testroot/repo-clone" > $testroot/stdout + cat > $testroot/stdout.expected < -# -# Permission to use, copy, modify, and distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -test_tree=`mktemp -d "${GOTD_TEST_ROOT}/gotd-test-tree-XXXXXXXXXX"` -trap "rm -r $test_tree" HUP INT QUIT PIPE TERM - -got checkout -q "${GOTD_TEST_REPO}" "$test_tree" > /dev/null - -dd if=/dev/random of="$test_tree/large_file1" count=32768 status=none -(cd "$test_tree" && got add "$test_tree/large_file1" > /dev/null) -for i in 2 3; do - cp "$test_tree/large_file1" "$test_tree/large_file$i" - dd if=/dev/random of="$test_tree/large_file$i" seek=32768 count=64 \ - status=none - (cd "$test_tree" && got add "$test_tree/large_file$i" > /dev/null) -done - -(cd "$test_tree" && got commit -m "add large objects" "$test_tree" > /dev/null) - -rm -r "$test_tree" blob - /dev/null blob + 2af31250d5bf7dff93902bbdecc36e924cfde0d0 (mode 755) --- /dev/null +++ regress/gotd/prepare_large_files.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# +# Copyright (c) 2025 Stefan Sperling +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +test_tree=`mktemp -d "${GOTD_TEST_ROOT}/gotd-test-tree-XXXXXXXXXX"` +trap "rm -r $test_tree" HUP INT QUIT PIPE TERM + +got checkout -q "${GOTD_TEST_REPO}" "$test_tree" > /dev/null + +dd if=/dev/random of="$test_tree/large_file1" count=32768 status=none +(cd "$test_tree" && got add "$test_tree/large_file1" > /dev/null) +for i in 2 3; do + cp "$test_tree/large_file1" "$test_tree/large_file$i" + dd if=/dev/random of="$test_tree/large_file$i" seek=32768 count=64 \ + status=none + (cd "$test_tree" && got add "$test_tree/large_file$i" > /dev/null) +done + +(cd "$test_tree" && got commit -m "add large files" "$test_tree" > /dev/null) + +rm -r "$test_tree"