components/git/patches/test.patch
author John Ojemann <john.ojemann@oracle.com>
Tue, 24 Jan 2017 04:39:14 -0800
branchs11u3-sru
changeset 7597 21897c6862f7
parent 5720 519e1bb835ee
permissions -rw-r--r--
25366898 pcsclite SCardReleaseContext can result in a double-free of the "cardsList"

A couple of tests need patching:

  - There's a garbled sed command in the clone tests, which works for GNU
    sed, but not for Solaris.

  - Because we're doing the build in a symlink farm, one of the diff tests
    thinks that we're changing the type of the files from symlink to file,
    so the diffs come out wrong.  Rather than cleverly mucking around with
    the working directory vs the repo directory, we just cat the files as
    real files into place.

The first patch is probably fine for upstream; the latter perhaps less so.

--- git-2.4.5/t/t5601-clone.sh	Thu Jun 25 12:15:40 2015
+++ git-2.4.5/t/t5601-clone.sh	Thu Jul  2 12:35:08 2015
@@ -445,7 +445,7 @@
 #IPv6
 for tuah in ::1 [::1] [::1]: user@::1 user@[::1] user@[::1]: [user@::1] [user@::1]:
 do
-	ehost=$(echo $tuah | sed -e "s/1]:/1]/ "| tr -d "[]")
+	ehost=$(echo $tuah | sed -e "s/1]:/1]/" | tr -d "[]")
 	test_expect_success "clone ssh://$tuah/home/user/repo" "
 	  test_clone_url ssh://$tuah/home/user/repo $ehost /home/user/repo
 	"
--- git-2.4.5/t/t4018-diff-funcname.sh	Thu Jun 25 12:15:40 2015
+++ git-2.4.5/t/t4018-diff-funcname.sh	Thu Jul  2 14:11:09 2015
@@ -79,8 +79,11 @@
 
 	# add all test files to the index
 	(
-		cd "$TEST_DIRECTORY"/t4018 &&
-		git --git-dir="$TRASH_DIRECTORY/.git" add .
+		( cd "$TEST_DIRECTORY"/t4018 && printf "%s\n" * ) | while read f
+		do
+			cat "$TEST_DIRECTORY"/t4018/$f > $f
+			git add -v $f
+		done
 	) &&
 
 	# place modified files in the worktree


This simply adds a couple of targets to the test Makefile which allow us to
run the tests in parallel cleanly.  This way the results don't get cleaned
up automatically after running the tests, and we can emit those results to
the master file.  This might be interesting to upstream, but is really
specific to running the tests in an external framework.

--- git-2.7.4/t/Makefile	Thu Mar 17 13:47:59 2016
+++ git-2.7.4/t/Makefile	Tue Mar 22 14:28:40 2016
@@ -36,6 +36,9 @@
 test: pre-clean $(TEST_LINT)
 	$(MAKE) aggregate-results-and-cleanup
 
+test-noclean: pre-clean $(TEST_LINT)
+	$(MAKE) T
+
 prove: pre-clean $(TEST_LINT)
 	@echo "*** prove ***"; $(PROVE) --exec '$(SHELL_PATH_SQ)' $(GIT_PROVE_OPTS) $(T) :: $(GIT_TEST_OPTS)
 	$(MAKE) clean-except-prove-cache
@@ -68,6 +71,8 @@
 test-lint-shell-syntax:
 	@'$(PERL_PATH_SQ)' check-non-portable-shell.pl $(T) $(THELPERS)
 
+T: $(T)
+
 aggregate-results-and-cleanup: $(T)
 	$(MAKE) aggregate-results
 	$(MAKE) clean


This is a Solaris-specific patch that turns on GnuPG in the tests, which it
wouldn't otherwise because we don't deliver GnuPG in its usual path.

--- git-2.7.4/t/lib-gpg.sh	Thu Mar 17 13:47:59 2016
+++ git-2.7.4/t/lib-gpg.sh	Tue Mar 22 14:40:59 2016
@@ -1,5 +1,9 @@
 #!/bin/sh
 
+gpg() {
+	gpg2 "$@"
+}
+
 gpg_version=$(gpg --version 2>&1)
 if test $? = 127; then
 	say "You do not seem to have gpg installed"


This allows Apache 2.4 to load on Solaris.

--- git-2.7.4/t/lib-httpd/apache.conf	Thu Mar 17 13:47:59 2016
+++ git-2.7.4/t/lib-httpd/apache.conf	Tue Mar 22 15:15:56 2016
@@ -64,6 +64,9 @@
 <IfModule !mod_mpm_prefork.c>
 	LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
 </IfModule>
+<IfModule !mod_unixd.c>
+	LoadModule unixd_module modules/mod_unixd.so
+</IfModule>
 </IfVersion>
 
 PassEnv GIT_VALGRIND