diff options
author | Daniel Willmann <dwillmann@sysmocom.de> | 2019-04-26 11:57:24 +0200 |
---|---|---|
committer | Daniel Willmann <dwillmann@sysmocom.de> | 2019-04-26 12:07:15 +0200 |
commit | 6e601e60ad6b9ec9cc211f2287a9e0719c78e631 (patch) | |
tree | fe5e864101363aff1c3e949d7279c8eeabaadd10 | |
parent | b59a9ed8d4d00eab4193caa46a1f24d280478b96 (diff) |
Add script to bisect test failures with ttcn3 and docker
With this script you can now use docker ttcn3 test results to bisect a
regression and find the offending commit.
Use like this from the osmo-* git repository:
$ git bisect start <bad-rev> <good-rev>
$ git bisect run ~/scm/osmo/docker-playground/osmo-bisect.sh <component-to-test> <testcase>
e.g.:
$ git bisect run ~/scm/osmo/docker-playground/osmo-bisect.sh bsc BSC_Tests.TC_ho_in_fail_no_detect
Change-Id: I11f7e61a9b30d58a0fdfcaf77dde447806bf661f
-rwxr-xr-x | osmo-bisect.sh | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/osmo-bisect.sh b/osmo-bisect.sh new file mode 100755 index 0000000..5ca69cd --- /dev/null +++ b/osmo-bisect.sh @@ -0,0 +1,53 @@ +#!/bin/sh + +# Script to bisect an osmo-* project with the docker ttcn3 images +# You need the git checkout of the project you wand to test as well as a +# checkout of the docker-playground repository. + +# Use like this from the osmo-* project repository where the regression +# occurs: +# $ git bisect start <bad-rev> <good-rev> +# $ git bisect run ~/scm/osmo/docker-playground/osmo-bisect.sh <component-to-test> <testcase> +# e.g.: +# $ git bisect run ~/scm/osmo/docker-playground/osmo-bisect.sh bsc BSC_Tests.TC_ho_in_fail_no_detect + + +DOCKER_PLAYGROUND=$(dirname "$0") +COMP_UPPER=$(echo "$1" | tr '[:lower:]' '[:upper:]') +COMP_LOWER=$(echo "$1" | tr '[:upper:]' '[:lower:]') +TESTCASE=$2 + +COMMIT=$(git log -1 --format=format:%H) + +case $COMP_LOWER in + "hnbgw") + BRANCH="OSMO_IUH_BRANCH" + SUITE="ttcn3-hnbgw-test" + ;; + "bsc"|\ + "bts"|\ + "ggsn"|\ + "hlr"|\ + "mgw"|\ + "msc"|\ + "nitb"|\ + "pcu"|\ + "sgsn"|\ + "sip"|\ + "stp") + BRANCH="OSMO_${COMP_UPPER}_BRANCH" + SUITE="ttcn3-${COMP_LOWER}-test" + ;; + *) + echo "Unknown repo, please fix the script!" + exit 125 + ;; +esac + +export "$BRANCH=$COMMIT" + +cd "$DOCKER_PLAYGROUND/$SUITE" || exit 125 + +echo "Testing for $COMMIT" +./jenkins.sh | grep -- "====== $TESTCASE pass ======" +exit $? |