blob: 3931ddbfa01d6107d6ab10af6b7fa7e2d300ab8a [file] [log] [blame]
Neels Hofmeyrd46ea132017-04-08 15:56:31 +02001#!/bin/sh
2set -e -x
3
Neels Hofmeyrc59e0792017-05-14 01:57:25 +02004# remove older trial dirs and *-run.tgz, if any
5trial_dir_prefix="trial-"
6rm -rf "$trial_dir_prefix"* || true
Neels Hofmeyrd46ea132017-04-08 15:56:31 +02007
Neels Hofmeyrc59e0792017-05-14 01:57:25 +02008# Expecting *.tgz artifacts to be copied to this workspace from the various
9# jenkins-*.sh runs, via jenkins job configuration. Compose a trial dir:
10trial_dir="${trial_dir_prefix}$BUILD_NUMBER"
11mkdir -p "$trial_dir"
Neels Hofmeyrd46ea132017-04-08 15:56:31 +020012
Neels Hofmeyrc59e0792017-05-14 01:57:25 +020013mv *.tgz "$trial_dir"
14cat *.md5 >> "$trial_dir/checksums.md5"
15rm *.md5
Neels Hofmeyrd46ea132017-04-08 15:56:31 +020016
Neels Hofmeyrc59e0792017-05-14 01:57:25 +020017# OSMO_GSM_TESTER_OPTS is a way to pass in e.g. logging preferences from the
18# jenkins build job.
Neels Hofmeyrbcd43322017-05-14 15:21:48 +020019# On failure, first clean up below and then return the exit code.
20exit_code="1"
21if python3 -u "$(which osmo-gsm-tester.py)" "$trial_dir" $OSMO_GSM_TESTER_OPTS ; then
22 exit_code="0"
23fi
Neels Hofmeyrd46ea132017-04-08 15:56:31 +020024
Neels Hofmeyrc59e0792017-05-14 01:57:25 +020025# no need to keep extracted binaries
26rm -rf "$trial_dir/inst" || true
Neels Hofmeyrd46ea132017-04-08 15:56:31 +020027
Neels Hofmeyrc59e0792017-05-14 01:57:25 +020028# tar up all results for archiving (optional)
29tar czf "$trial_dir"-run.tgz "$trial_dir"
Neels Hofmeyrbcd43322017-05-14 15:21:48 +020030
31exit $exit_code