From 8ccdb714a5546bc09d98d959f29aac3e84f6da73 Mon Sep 17 00:00:00 2001 From: Cleber Rosa Date: Wed, 17 Apr 2019 10:33:40 -0400 Subject: [PATCH] Selftests: extract signed off check to a script Signed-off-by: Cleber Rosa --- selftests/checkall | 12 +----------- selftests/signedoff-check.sh | 8 ++++++++ 2 files changed, 9 insertions(+), 11 deletions(-) create mode 100755 selftests/signedoff-check.sh diff --git a/selftests/checkall b/selftests/checkall index 9169bcf4..7f0c338c 100755 --- a/selftests/checkall +++ b/selftests/checkall @@ -124,16 +124,6 @@ parallel_selftests() { } -signed_off_check() { - AUTHOR="$(git log -1 --pretty='format:%aN <%aE>')" - git log -1 --pretty=format:%B | grep "Signed-off-by: $AUTHOR" - if [ $? != 0 ]; then - echo "The commit message does not contain author's signature (Signed-off-by: $AUTHOR)" - return 1 - fi -} - - results_dir_content() { NOW="$(ls $RESULTS_DIR)" if [ "$(echo $* | xargs)" != "$(echo $NOW | xargs)" ]; then @@ -164,7 +154,7 @@ run_rc lint "$LINT_CMD $PYLINT_ENABLE" run_rc indent 'inspekt indent --exclude=.git,selftests/unit/test_utils_cpu.py' run_rc style 'inspekt style --exclude=.git --disable E501,E265,W601,E402,E722' run_rc boundaries 'selftests/modules_boundaries' -run_rc signed-off-by signed_off_check +run_rc signed-off-by 'selftests/signedoff-check.sh' if [ "$AVOCADO_PARALLEL_CHECK" ]; then run_rc selftests parallel_selftests elif [ -z "$AVOCADO_SELF_CHECK" ]; then diff --git a/selftests/signedoff-check.sh b/selftests/signedoff-check.sh new file mode 100755 index 00000000..a904c61b --- /dev/null +++ b/selftests/signedoff-check.sh @@ -0,0 +1,8 @@ +#!/bin/sh -e + +AUTHOR="$(git log -1 --pretty='format:%aN <%aE>')" +git log -1 --pretty=format:%B | grep "Signed-off-by: $AUTHOR" +if [ $? != 0 ]; then + echo "The commit message does not contain author's signature (Signed-off-by: $AUTHOR)" + return 1 +fi -- GitLab