From 477334a69cc90f4d7b1bcb5b4aa747b1aba2fca8 Mon Sep 17 00:00:00 2001 From: Nigel Babu Date: Mon, 12 Sep 2016 10:24:21 +0530 Subject: Add all the jobs/scripts for build.gluster.org Change-Id: I39e4d0407957e47a695d9be47add20094d8c41f2 --- build-gluster-org/scripts/centos-regression.sh | 112 +++++++++++++++++++ build-gluster-org/scripts/freebsd-smoke.sh | 20 ++++ build-gluster-org/scripts/glusterfs-devrpms.sh | 6 + build-gluster-org/scripts/glusterfs-rpms.sh | 6 + build-gluster-org/scripts/netbsd6-smoke.sh | 10 ++ build-gluster-org/scripts/netbsd7-regression.sh | 122 +++++++++++++++++++++ build-gluster-org/scripts/reboot-vm.sh | 1 + .../scripts/regression-test-burn-in.sh | 67 +++++++++++ build-gluster-org/scripts/smoke.sh | 23 ++++ build-gluster-org/scripts/strfmt_errors.sh | 16 +++ 10 files changed, 383 insertions(+) create mode 100755 build-gluster-org/scripts/centos-regression.sh create mode 100755 build-gluster-org/scripts/freebsd-smoke.sh create mode 100755 build-gluster-org/scripts/glusterfs-devrpms.sh create mode 100755 build-gluster-org/scripts/glusterfs-rpms.sh create mode 100755 build-gluster-org/scripts/netbsd6-smoke.sh create mode 100755 build-gluster-org/scripts/netbsd7-regression.sh create mode 100755 build-gluster-org/scripts/reboot-vm.sh create mode 100755 build-gluster-org/scripts/regression-test-burn-in.sh create mode 100755 build-gluster-org/scripts/smoke.sh create mode 100755 build-gluster-org/scripts/strfmt_errors.sh (limited to 'build-gluster-org/scripts') diff --git a/build-gluster-org/scripts/centos-regression.sh b/build-gluster-org/scripts/centos-regression.sh new file mode 100755 index 0000000..146a6ce --- /dev/null +++ b/build-gluster-org/scripts/centos-regression.sh @@ -0,0 +1,112 @@ +#!/bin/bash + +MY_ENV=`env | sort` +BURL=${BUILD_URL}consoleFull + +# Display all environment variables in the debugging log +echo "Start time $(date)" +echo +echo "Display all environment variables" +echo "*********************************" +echo +echo "$MY_ENV" +echo + + +# Remove any gluster daemon leftovers from aborted runs +sudo -E bash /opt/qa/cleanup.sh + +# Clean up the git repo +sudo rm -rf $WORKSPACE/.gitignore $WORKSPACE/* +sudo chown -R jenkins:jenkins $WORKSPACE +cd $WORKSPACE +git reset --hard HEAD + +# Clean up other Gluster dirs +sudo rm -rf /var/lib/glusterd/* /build/install /build/scratch >/dev/null 2>&1 + +# Remove the many left over socket files in /var/run +sudo rm -f /var/run/????????????????????????????????.socket >/dev/null 2>&1 + +# Remove GlusterFS log files from previous runs +sudo rm -rf /var/log/glusterfs/* /var/log/glusterfs/.cmd_log_history >/dev/null 2>&1 + +JDIRS="/var/log/glusterfs /var/lib/glusterd /var/run/gluster /d /d/archived_builds /d/backends /d/build /d/logs /home/jenkins/root" +sudo mkdir -p $JDIRS +sudo chown jenkins:jenkins $JDIRS +chmod 755 $JDIRS + + +# Do not run tests that only modifies doc; does not consider chained changes or files in repo root +DOC_ONLY=true +for file in `git diff-tree --no-commit-id --name-only -r HEAD`; do + if [[ $file != doc/* ]]; then + DOC_ONLY=false + break + fi +done +if [[ "$DOC_ONLY" == true ]]; then + echo "Patch only modifies doc/*. Skipping further tests" + RET=0 + VERDICT="Skipped tests for doc only change" + V="+1" + ssh build@review.gluster.org gerrit review --message "'$BURL : $VERDICT'" --project=glusterfs --label CentOS-regression=$V $GIT_COMMIT + exit $RET +fi + + +# Skip tests for patches that make distaf only changes +# Do not run tests that only modifies distaf; does not consider chained changes or files in repo root +DISTAF_ONLY=true +for file in `git diff-tree --no-commit-id --name-only -r HEAD`; do + if [[ $file != tests/distaf/* ]]; then + DISTAF_ONLY=false + break + fi +done +if [[ "$DISTAF_ONLY" == true ]]; then + echo "Patch only modifies tests/distaf/*. Skipping further tests" + RET=0 + VERDICT="Skipped tests for distaf only change" + V="+1" + ssh build@review.gluster.org gerrit review --message "'$BURL : $VERDICT'" --project=glusterfs --label CentOS-regression=$V $GIT_COMMIT + exit $RET +fi + +# Build Gluster +echo "Start time $(date)" +echo +echo "Build GlusterFS" +echo "***************" +echo +/opt/qa/build.sh +RET=$? +if [ $RET != 0 ]; then + # Build failed, so abort early + RET=0 + VERDICT="FAILED" + V="-1" + ssh build@review.gluster.org gerrit review --message "'$BURL : $VERDICT'" --project=glusterfs --label CentOS-regression=$V $GIT_COMMIT + exit $RET +fi +echo + +# Run the regression test +echo "Start time $(date)" +echo +echo "Run the regression test" +echo "***********************" +echo +sudo -E bash /opt/qa/regression.sh +RET=$? +if [ $RET = 0 ]; then + V="+1" + VERDICT="SUCCESS" +else + V="-1" + VERDICT="FAILED" +fi + +# Update Gerrit with the success/failure status +ssh build@review.gluster.org gerrit review --message "'$BURL : $VERDICT'" --project=glusterfs --label CentOS-regression="$V" $GIT_COMMIT +exit $RET diff --git a/build-gluster-org/scripts/freebsd-smoke.sh b/build-gluster-org/scripts/freebsd-smoke.sh new file mode 100755 index 0000000..f513bc8 --- /dev/null +++ b/build-gluster-org/scripts/freebsd-smoke.sh @@ -0,0 +1,20 @@ +#!/usr/local/bin/bash + +# Added by JD on 2016/03/07 because I don't have access to edit build.sh and I'm tired +# of these tests failing due to permissions errors in glupy. +glupydir=/usr/local/lib/python2.7/site-packages/gluster +sudo mkdir -p $glupydir +sudo chown jenkins $glupydir +sudo chmod 755 $glupydir + +/opt/qa/build.sh +RET=$? +echo $RET +if [ $RET -ne 0 ]; then + exit 1 +fi + +#sudo /opt/qa/smoke.sh +#RET=$? +#echo smoke.sh returned $RET +exit $RET diff --git a/build-gluster-org/scripts/glusterfs-devrpms.sh b/build-gluster-org/scripts/glusterfs-devrpms.sh new file mode 100755 index 0000000..13b9177 --- /dev/null +++ b/build-gluster-org/scripts/glusterfs-devrpms.sh @@ -0,0 +1,6 @@ +#!/bin/bash +./autogen.sh || exit 1 +./configure --enable-fusermount || exit 1 +cd extras/LinuxRPM +make prep srcrpm || exit 1 +sudo mock -r {build_flag} --resultdir=${{WORKSPACE}}/RPMS/"%(dist)s"/"%(target_arch)s"/ --cleanup-after --rebuild glusterfs*src.rpm || exit 1 diff --git a/build-gluster-org/scripts/glusterfs-rpms.sh b/build-gluster-org/scripts/glusterfs-rpms.sh new file mode 100755 index 0000000..e617bda --- /dev/null +++ b/build-gluster-org/scripts/glusterfs-rpms.sh @@ -0,0 +1,6 @@ +#!/bin/bash +./autogen.sh || exit 1 +./configure --enable-fusermount || exit 1 +cd extras/LinuxRPM +make prep srcrpm || exit 1 +sudo mock -r {build_flag} --resultdir=${{WORKSPACE}}/RPMS/"%(dist)s"/"%(target_arch)s"/ --rebuild glusterfs*src.rpm || exit 1 diff --git a/build-gluster-org/scripts/netbsd6-smoke.sh b/build-gluster-org/scripts/netbsd6-smoke.sh new file mode 100755 index 0000000..bdc029d --- /dev/null +++ b/build-gluster-org/scripts/netbsd6-smoke.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +/opt/qa/build.sh +RET=$? +echo $RET +if [ $RET -ne 0 ]; then + exit 1 +fi + +exit $RET diff --git a/build-gluster-org/scripts/netbsd7-regression.sh b/build-gluster-org/scripts/netbsd7-regression.sh new file mode 100755 index 0000000..185ad63 --- /dev/null +++ b/build-gluster-org/scripts/netbsd7-regression.sh @@ -0,0 +1,122 @@ +#!/bin/bash + +MY_ENV=`env | sort` +BURL=${BUILD_URL}consoleFull + +# Display all environment variables in the debugging log +echo "Start time $(date)" +echo +echo "Display all environment variables" +echo "*********************************" +echo +echo "$MY_ENV" +echo + + +# Exit early with success if the change is on release-3.{5,6} +# NetBSD regression doesn't run successfully on release-3.{5,6} +if [ $GERRIT_BRANCH = "release-3.5" -o $GERRIT_BRANCH = "release-3.6" ]; then + echo "Skipping regression run for ${GERRIT_BRANCH}" + RET=0 + VERDICT="Skipped for ${GERRIT_BRANCH}" + V="+1" + ssh nb7build@review.gluster.org gerrit review --message "'$BURL : $VERDICT'" --project=glusterfs --code-review=0 --label NetBSD-regression=$V $GIT_COMMIT + exit $RET +fi + +# Remove any gluster daemon leftovers from aborted runs +ps -axl | grep gluster +su -l root -c "pkill gluster" +su -l root -c /opt/qa/cleanup.sh >/dev/null 2>&1 + +# Fix installation permissions +su -l root -c "chown -R jenkins /usr/pkg/lib/python2.7/site-packages/gluster" + +# Clean up the git repo +su -l root -c "rm -rf $WORKSPACE/.gitignore $WORKSPACE/*" +su -l root -c "chown -R jenkins $WORKSPACE" +cd $WORKSPACE +git reset --hard HEAD + +# Clean up other Gluster dirs +su -l root -c "rm -rf /var/lib/glusterd/* /build/install /build/scratch" + +# Remove the many left over socket files in /var/run +su -l root -c "rm -f /var/run/glusterd.socket" + +# Remove GlusterFS log files from previous runs +su -l root -c "rm -rf /var/log/glusterfs/* /var/log/glusterfs/.cmd_log_history" + +# Do not run tests that only modifies doc; does not consider chained changes or files in repo root +DOC_ONLY=true +for file in `git diff-tree --no-commit-id --name-only -r HEAD`; do + if [[ $file != doc/* ]]; then + DOC_ONLY=false + break + fi +done +if [[ "$DOC_ONLY" == true ]]; then + echo "Patch only modifies doc/*. Skipping further tests" + RET=0 + VERDICT="Skipped tests for doc only change" + V="+1" + ssh nb7build@review.gluster.org gerrit review --message "'$BURL : $VERDICT'" --project=glusterfs --code-review=0 --label NetBSD-regression=$V $GIT_COMMIT + exit $RET +fi + +# Do not run tests that only modifies distaf; does not consider chained changes or files in repo root +DISTAF_ONLY=true +for file in `git diff-tree --no-commit-id --name-only -r HEAD`; do + if [[ $file != tests/distaf/* ]]; then + DISTAF_ONLY=false + break + fi +done +if [[ "$DISTAF_ONLY" == true ]]; then + echo "Patch only modifies tests/distaf/*. Skipping further tests" + RET=0 + VERDICT="Skipped tests for distaf only change" + V="+1" + ssh nb7build@review.gluster.org gerrit review --message "'$BURL : $VERDICT'" --project=glusterfs --code-review=0 --label NetBSD-regression=$V $GIT_COMMIT + exit $RET +fi + +# Build Gluster +echo "Start time $(date)" +echo +echo "Build GlusterFS" +echo "***************" +echo +/opt/qa/build.sh +RET=$? +if [ $RET != 0 ]; then + # Build failed, so abort early + exit 1 +fi +echo + +# regression tests assumes build is done inside source directory +# which is not the case here. The simpliest fix is to copy the +# required object back to source directory +cp /build/scratch/contrib/argp-standalone/libargp.a \ + $WORKSPACE/contrib/argp-standalone + +# Run the regression test +echo "Start time $(date)" +echo "Run the regression test" +echo "***********************" +echo +su -l root -c "cd $WORKSPACE && /opt/qa/regression.sh" +RET=$? +if [ $RET = 0 ]; then + V="+1" + R="0" + VERDICT="SUCCESS" +else + V="-1" + R="0" + VERDICT="FAILED" +fi + +ssh nb7build@review.gluster.org gerrit review --message "'$BURL : $VERDICT'" --project=glusterfs --code-review=0 --label NetBSD-regression=$V $GIT_COMMIT +exit $RET diff --git a/build-gluster-org/scripts/reboot-vm.sh b/build-gluster-org/scripts/reboot-vm.sh new file mode 100755 index 0000000..cf68fa6 --- /dev/null +++ b/build-gluster-org/scripts/reboot-vm.sh @@ -0,0 +1 @@ +sudo /usr/local/bin/reboot-vm.py ${VM} diff --git a/build-gluster-org/scripts/regression-test-burn-in.sh b/build-gluster-org/scripts/regression-test-burn-in.sh new file mode 100755 index 0000000..a716658 --- /dev/null +++ b/build-gluster-org/scripts/regression-test-burn-in.sh @@ -0,0 +1,67 @@ +#!/bin/bash + +MY_ENV=`env | sort` +BURL=${BUILD_URL}consoleFull + +# Display all environment variables in the debugging log +echo "Start time $(date)" +echo +echo "Display all environment variables" +echo "*********************************" +echo +echo "$MY_ENV" +echo + + +# Remove any gluster daemon leftovers from aborted runs +sudo -E bash /opt/qa/cleanup.sh + +# Clean up the git repo +sudo rm -rf $WORKSPACE/.gitignore $WORKSPACE/* +sudo chown -R jenkins:jenkins $WORKSPACE +cd $WORKSPACE +git reset --hard HEAD + +# Clean up other Gluster dirs +sudo rm -rf /var/lib/glusterd/* /build/install /build/scratch >/dev/null 2>&1 + +# Remove the many left over socket files in /var/run +sudo rm -f /var/run/????????????????????????????????.socket >/dev/null 2>&1 + +# Remove GlusterFS log files from previous runs +sudo rm -rf /var/log/glusterfs/* /var/log/glusterfs/.cmd_log_history >/dev/null 2>&1 + +JDIRS="/var/log/glusterfs /var/lib/glusterd /var/run/gluster /d /d/archived_builds /d/backends /d/build /d/logs /home/jenkins/root" +sudo mkdir -p $JDIRS +sudo chown jenkins:jenkins $JDIRS +chmod 755 $JDIRS + +# Build Gluster +echo "Start time $(date)" +echo +echo "Build GlusterFS" +echo "***************" +echo +/opt/qa/build.sh +RET=$? +if [ $RET != 0 ]; then + # Build failed, so abort early + RET=0 + VERDICT="FAILED" + V="-1" + ssh build@review.gluster.org gerrit review --message "'$BURL : $VERDICT'" --project=glusterfs --label CentOS-regression=$V $GIT_COMMIT + exit $RET +fi +echo + +# Run the regression test +echo "Start time $(date)" +echo +echo "Run the regression test" +echo "***********************" +echo +sudo -E bash /opt/qa/regression.sh + +RET=$? + +exit $RET diff --git a/build-gluster-org/scripts/smoke.sh b/build-gluster-org/scripts/smoke.sh new file mode 100755 index 0000000..b6a6b75 --- /dev/null +++ b/build-gluster-org/scripts/smoke.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +BURL=${BUILD_URL}consoleFull + +JDIRS="/var/log/glusterfs /var/lib/glusterd /var/lib/glusterd/groups/virt /var/run/gluster /d /d/archived_builds /d/backends /d/build /d/logs /home/jenkins/root /build/*" +sudo mkdir -p $JDIRS +echo Return code = $? +sudo chown -RH jenkins:jenkins $JDIRS +echo Return code = $? +sudo chmod -R 755 $JDIRS +echo Return code = $? + +sudo yum -y install cmockery2 cmockery2-devel +/opt/qa/build.sh +RET=$? +if [ $RET -ne 0 ]; then + exit 1 +fi +sudo /opt/qa/smoke.sh +RET=$? + +echo smoke.sh returned $RET +exit $RET diff --git a/build-gluster-org/scripts/strfmt_errors.sh b/build-gluster-org/scripts/strfmt_errors.sh new file mode 100755 index 0000000..5cafce9 --- /dev/null +++ b/build-gluster-org/scripts/strfmt_errors.sh @@ -0,0 +1,16 @@ +#!/bin/bash +./autogen.sh || exit 1 +./configure --enable-fusermount || exit 1 +cd extras/LinuxRPM +make prep srcrpm || exit 1 +sudo mock -r 'epel-6-i386' --resultdir=${WORKSPACE}/RPMS/"%(dist)s"/"%(target_arch)s"/ --cleanup-after --rebuild glusterfs*src.rpm || exit 1 + +rm -f warnings.txt +grep -E ".*: warning: format '%.*' expects( argument of)? type '.*', but argument .* has type 'ssize_t" ${WORKSPACE}/RPMS/el6/i686/build.log | tee -a warnings.txt +grep -E ".+: warning: format '%.+' expects( argument of)? type '.+', but argument .+ has type 'size_t" ${WORKSPACE}/RPMS/el6/i686/build.log | tee -a warnings.txt + +WARNINGS=$(wc -l < warnings.txt) +if [ "$WARNINGS" -gt "0" ]; +then + exit 1 +fi -- cgit