blob: 0978be90bf112179df9c97a2f696a3aa0931e5df [file] [log] [blame]
Thomas Vachuskaf9c84362015-04-15 11:20:45 -07001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Checks if ONOS bits are available in preparation for install.
4# -----------------------------------------------------------------------------
5
6[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
7. $ONOS_ROOT/tools/build/envDefaults
8
Ray Milkeya42cb582016-10-25 15:42:00 -07009# If the BUCK-built bits are newer than the Maven-built bits, use the former.
10BUCK_TAR=$ONOS_ROOT/buck-out/gen/tools/package/onos-package/onos.tar.gz
11if [ -f $BUCK_TAR -a $BUCK_TAR -nt $ONOS_TAR ]; then
12 rm -f $ONOS_TAR >/dev/null; ln -s $BUCK_TAR $ONOS_TAR
13fi
14
Thomas Vachuskab3ef9d02017-01-26 08:51:11 -080015ls -lL $ONOS_TAR && cksum $ONOS_TAR
Ray Milkeya42cb582016-10-25 15:42:00 -070016if [ $? -ne 0 ]; then
17 echo "ONOS archive is unreadable" && exit 1
18fi
19
20tar tzf ${ONOS_TAR} >/dev/null
21if [ $? -ne 0 ]; then
22 echo "ONOS archive is not a valid tar file" && exit 1
23fi
24
Thomas Vachuska6066dff2016-10-26 13:57:36 -070025tar tzf ${ONOS_TAR} | grep -q onos-${ONOS_POM_VERSION}.*/VERSION
Ray Milkeya42cb582016-10-25 15:42:00 -070026if [ $? -ne 0 ]; then
27 echo "ONOS archive does not contain the proper version file" && exit 1
28fi
29
Jon Hallb84df5d2017-01-31 11:19:48 -080030tar tzf ${ONOS_TAR} | grep -q apache-karaf-3.0.8
Ray Milkeya42cb582016-10-25 15:42:00 -070031if [ $? -ne 0 ]; then
32 echo "ONOS archive does not contain karaf" && exit 1
33fi
34
35tar tzf ${ONOS_TAR} | grep -q apps/org.onosproject.openflow
36if [ $? -ne 0 ]; then
37 echo "ONOS archive does not contain openflow app" && exit 1
38fi
39
40tar tzf ${ONOS_TAR} | grep -q onos-core-net
41if [ $? -ne 0 ]; then
42 echo "ONOS archive does not contain onos-core-net" && exit 1
43fi