Thomas Vachuska | cb20528 | 2016-10-25 10:41:49 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # ----------------------------------------------------------------------------- |
| 3 | # Validates the specified ONOS release bits using STC and a borrowed cell. |
| 4 | # ----------------------------------------------------------------------------- |
| 5 | |
Ray Milkey | ddc0bd7 | 2016-12-12 13:49:15 -0800 | [diff] [blame] | 6 | set -e |
| 7 | |
Thomas Vachuska | cb20528 | 2016-10-25 10:41:49 -0700 | [diff] [blame] | 8 | export ONOS_VERSION=$1 |
Ray Milkey | ddc0bd7 | 2016-12-12 13:49:15 -0800 | [diff] [blame] | 9 | RELEASE=$2 |
Thomas Vachuska | cb20528 | 2016-10-25 10:41:49 -0700 | [diff] [blame] | 10 | |
Ray Milkey | 5535abd | 2016-12-13 14:14:47 -0800 | [diff] [blame^] | 11 | [ -z "$ONOS_VERSION" -o -z "$RELEASE" ] && echo "usage: $(basename $0) <version> <release,nightly>" >&2 && exit 1 |
Thomas Vachuska | cb20528 | 2016-10-25 10:41:49 -0700 | [diff] [blame] | 12 | |
Ray Milkey | ddc0bd7 | 2016-12-12 13:49:15 -0800 | [diff] [blame] | 13 | DIR=$(mktemp -d /tmp/onos-test.XXXXX) && |
| 14 | echo "Created tempdir for release: $DIR" || |
| 15 | { echo "Failed to create temp file"; exit 1; } |
Thomas Vachuska | cb20528 | 2016-10-25 10:41:49 -0700 | [diff] [blame] | 16 | |
Ray Milkey | ddc0bd7 | 2016-12-12 13:49:15 -0800 | [diff] [blame] | 17 | cd $DIR |
| 18 | |
| 19 | export DOWNLOAD_URL=http://downloads.onosproject.org/${RELEASE} |
| 20 | |
| 21 | # Download the ONOS release bits from the download site |
| 22 | rm -f /tmp/onos-$ONOS_VERSION.tar.gz |
Thomas Vachuska | cb20528 | 2016-10-25 10:41:49 -0700 | [diff] [blame] | 23 | curl -LsS --fail $DOWNLOAD_URL/onos-$ONOS_VERSION.tar.gz > /tmp/onos-$ONOS_VERSION.tar.gz |
| 24 | |
Ray Milkey | ddc0bd7 | 2016-12-12 13:49:15 -0800 | [diff] [blame] | 25 | # Download the ONOS test bits from the download site |
| 26 | rm -f /tmp/onos-test-$ONOS_VERSION.tar.gz |
| 27 | curl -LsS --fail $DOWNLOAD_URL/onos-test-$ONOS_VERSION.tar.gz > /tmp/onos-test-$ONOS_VERSION.tar.gz |
| 28 | |
| 29 | # unroll the test release |
| 30 | tar xvf /tmp/onos-test-$ONOS_VERSION.tar.gz |
| 31 | |
| 32 | # set up environment |
| 33 | export ONOS_ROOT=${DIR}/onos-test-${ONOS_VERSION} |
| 34 | cd ${ONOS_ROOT} |
| 35 | . ${ONOS_ROOT}/tools/dev/bash_profile |
| 36 | |
Thomas Vachuska | cb20528 | 2016-10-25 10:41:49 -0700 | [diff] [blame] | 37 | # Borrow a test cell and run STC |
Ray Milkey | ddc0bd7 | 2016-12-12 13:49:15 -0800 | [diff] [blame] | 38 | ( export PATH=${ONOS_ROOT}/tools/test/bin:${ONOS_ROOT}/tools/dev/bin:${PATH} && cell borrow && stc ) |