| # ----------------------------------------------------------------------------- |
| # Validates the specified ONOS release bits using STC and a borrowed cell. |
| # ----------------------------------------------------------------------------- |
| [ -z "$ONOS_VERSION" -o -z "$RELEASE" ] && echo "usage: $(basename $0) <version> <release,nightly>" >&2 && exit 1 |
| DIR=$(mktemp -d /tmp/onos-test.XXXXX) && |
| echo "Created tempdir for release: $DIR" || |
| { echo "Failed to create temp file"; exit 1; } |
| export DOWNLOAD_URL=http://downloads.onosproject.org/${RELEASE} |
| # Download the ONOS release bits from the download site |
| rm -f /tmp/onos-$ONOS_VERSION.tar.gz |
| curl -LsS --fail $DOWNLOAD_URL/onos-$ONOS_VERSION.tar.gz > /tmp/onos-$ONOS_VERSION.tar.gz |
| # Download the ONOS test bits from the download site |
| rm -f /tmp/onos-test-$ONOS_VERSION.tar.gz |
| curl -LsS --fail $DOWNLOAD_URL/onos-test-$ONOS_VERSION.tar.gz > /tmp/onos-test-$ONOS_VERSION.tar.gz |
| # unroll the test release |
| tar xvf /tmp/onos-test-$ONOS_VERSION.tar.gz |
| export ONOS_ROOT=${DIR}/onos-test-${ONOS_VERSION} |
| . ${ONOS_ROOT}/tools/dev/bash_profile |
| # Borrow a test cell and run STC |
| ( export PATH=${ONOS_ROOT}/tools/test/bin:${ONOS_ROOT}/tools/dev/bin:${PATH} && cell borrow && stc ) |