From e1513c30d262e5c772e3bf48da2b6b6b8cf4719d Mon Sep 17 00:00:00 2001 From: John Safranek Date: Thu, 30 Jul 2015 14:24:45 -0700 Subject: [PATCH] added a pre-push hook. move fips test to pre-push check --- autogen.sh | 1 + commit-tests.sh | 8 -------- pre-push.sh | 19 +++++++++++++++++++ 3 files changed, 20 insertions(+), 8 deletions(-) create mode 100755 pre-push.sh 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