blob: cae945d1895ff0251d8096ce8ba57cc47b4eeb02 [file] [log] [blame]
Thomas Vachuskacb205282016-10-25 10:41:49 -07001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Validates the specified ONOS release bits using STC and a borrowed cell.
4# -----------------------------------------------------------------------------
5
Ray Milkeyddc0bd72016-12-12 13:49:15 -08006set -e
7
Thomas Vachuskacb205282016-10-25 10:41:49 -07008export ONOS_VERSION=$1
Ray Milkeyddc0bd72016-12-12 13:49:15 -08009RELEASE=$2
Thomas Vachuskacb205282016-10-25 10:41:49 -070010
Ray Milkey5535abd2016-12-13 14:14:47 -080011[ -z "$ONOS_VERSION" -o -z "$RELEASE" ] && echo "usage: $(basename $0) <version> <release,nightly>" >&2 && exit 1
Thomas Vachuskacb205282016-10-25 10:41:49 -070012
Ray Milkeyddc0bd72016-12-12 13:49:15 -080013DIR=$(mktemp -d /tmp/onos-test.XXXXX) &&
14 echo "Created tempdir for release: $DIR" ||
15 { echo "Failed to create temp file"; exit 1; }
Thomas Vachuskacb205282016-10-25 10:41:49 -070016
Ray Milkeyddc0bd72016-12-12 13:49:15 -080017cd $DIR
18
19export DOWNLOAD_URL=http://downloads.onosproject.org/${RELEASE}
20
21# Download the ONOS release bits from the download site
22rm -f /tmp/onos-$ONOS_VERSION.tar.gz
Thomas Vachuskacb205282016-10-25 10:41:49 -070023curl -LsS --fail $DOWNLOAD_URL/onos-$ONOS_VERSION.tar.gz > /tmp/onos-$ONOS_VERSION.tar.gz
24
Ray Milkeyddc0bd72016-12-12 13:49:15 -080025# Download the ONOS test bits from the download site
26rm -f /tmp/onos-test-$ONOS_VERSION.tar.gz
27curl -LsS --fail $DOWNLOAD_URL/onos-test-$ONOS_VERSION.tar.gz > /tmp/onos-test-$ONOS_VERSION.tar.gz
28
29# unroll the test release
30tar xvf /tmp/onos-test-$ONOS_VERSION.tar.gz
31
32# set up environment
33export ONOS_ROOT=${DIR}/onos-test-${ONOS_VERSION}
34cd ${ONOS_ROOT}
35. ${ONOS_ROOT}/tools/dev/bash_profile
36
Thomas Vachuskacb205282016-10-25 10:41:49 -070037# Borrow a test cell and run STC
Ray Milkeyddc0bd72016-12-12 13:49:15 -080038 ( export PATH=${ONOS_ROOT}/tools/test/bin:${ONOS_ROOT}/tools/dev/bin:${PATH} && cell borrow && stc )