blob: 8d86989fa1c2f99880e91ba0694001a53cb8b6ee [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
Thomas Vachuska81c72be2018-11-27 10:47:00 -08009ONOS_TAR=$ONOS_ROOT/bazel-bin/onos.tar.gz
Ray Milkeya42cb582016-10-25 15:42:00 -070010
Thomas Vachuskab3ef9d02017-01-26 08:51:11 -080011ls -lL $ONOS_TAR && cksum $ONOS_TAR
Ray Milkeya42cb582016-10-25 15:42:00 -070012if [ $? -ne 0 ]; then
Yuta HIGUCHI34a25d12017-05-26 09:39:01 -070013 echo "ONOS archive is unreadable" && exit 1
Ray Milkeya42cb582016-10-25 15:42:00 -070014fi
15
16tar tzf ${ONOS_TAR} >/dev/null
17if [ $? -ne 0 ]; then
18 echo "ONOS archive is not a valid tar file" && exit 1
19fi
20
Yuta HIGUCHI34a25d12017-05-26 09:39:01 -070021tar tzf ${ONOS_TAR} | grep -q "onos-${ONOS_POM_VERSION}.*/VERSION"
Ray Milkeya42cb582016-10-25 15:42:00 -070022if [ $? -ne 0 ]; then
23 echo "ONOS archive does not contain the proper version file" && exit 1
24fi
25
Jon Hallb84df5d2017-01-31 11:19:48 -080026tar tzf ${ONOS_TAR} | grep -q apache-karaf-3.0.8
Ray Milkeya42cb582016-10-25 15:42:00 -070027if [ $? -ne 0 ]; then
28 echo "ONOS archive does not contain karaf" && exit 1
29fi
30
31tar tzf ${ONOS_TAR} | grep -q apps/org.onosproject.openflow
32if [ $? -ne 0 ]; then
33 echo "ONOS archive does not contain openflow app" && exit 1
34fi
35
36tar tzf ${ONOS_TAR} | grep -q onos-core-net
37if [ $? -ne 0 ]; then
38 echo "ONOS archive does not contain onos-core-net" && exit 1
39fi