diff --git a/autogen.sh b/autogen.sh index f0042765d..d817ee781 100755 --- a/autogen.sh +++ b/autogen.sh @@ -9,6 +9,7 @@ if test -d .git; then mkdir .git/hooks fi ln -s -f ../../pre-commit.sh .git/hooks/pre-commit + ln -s -f ../../pre-push.sh .git/hooks/pre-push fi # Set HAVE_FIPS_SOURCE to 1 in your .profile if you have access to the FIPS diff --git a/commit-tests.sh b/commit-tests.sh index eae91ab19..d7a95af48 100755 --- a/commit-tests.sh +++ b/commit-tests.sh @@ -31,12 +31,4 @@ make -j 8 test; RESULT=$? [ $RESULT -ne 0 ] && echo -e "\n\nFull config make test failed" && exit 1 -if [ -n "$HAVE_FIPS_SOURCE" ]; -then - echo -e "\n\nTesting with FIPS release code...\n\n" - ./fips-check.sh - RESULT=$? - [ $RESULT -ne 0 ] && echo -e "\n\nFIPS build test failed" && exit 1 -fi - exit 0 diff --git a/pre-push.sh b/pre-push.sh new file mode 100755 index 000000000..f5a065bd1 --- /dev/null +++ b/pre-push.sh @@ -0,0 +1,19 @@ +#!/bin/sh +# +# +# Our "pre-push" hook. + +RESULT=0 + +if [ -n "$HAVE_FIPS_SOURCE" ]; +then + echo -e "\n\nTesting with FIPS release code...\n\n" + ./fips-check.sh --no-keep + RESULT=$? + [ $RESULT -ne 0 ] && echo -e "\n\nFIPS build test failed" && exit 1 +fi + +[ $RESULT -ne 0 ] && echo "\nOops, your push failed\n" && exit 1 + +echo "\nPush tests passed!\n" +exit 0