blob: 0d1bf83e0b0af01ceacfc346ae6816cb092d3734 [file] [log] [blame]
Thomas Vachuska8189a742015-05-29 10:02:52 -07001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Checks whether all and only the ONOS apps configured in ONOS_APPS are active.
4# -----------------------------------------------------------------------------
5
Thomas Vachuska4cfcc562015-06-03 09:51:02 -07006[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
7. $ONOS_ROOT/tools/build/envDefaults
8
Thomas Vachuska8189a742015-05-29 10:02:52 -07009aux=/tmp/stc-$$.log
10trap "rm -f $aux $aux.1 $aux.2 2>/dev/null" EXIT
11
12onos ${1:-$OCI} "onos:apps -s -a" > $aux
13cat $aux
14
15# Normalize the installed apps
Thomas Vachuska354eb9e2015-06-30 12:38:09 -070016cut -c7- $aux | grep -v '/bin/client' | cut -d\ -f1 | sort > $aux.1
Thomas Vachuska8189a742015-05-29 10:02:52 -070017
18# Normalize the expected apps
Thomas Vachuskaa48e3d12015-06-02 09:43:29 -070019apps=${2:-$ONOS_APPS}
20apps=${apps:-drivers,openflow}
Thomas Vachuskafdbc4c22015-05-29 15:53:01 -070021(for app in ${apps//,/ }; do echo org.onosproject.$app; done) | sort > $aux.2
Thomas Vachuska8189a742015-05-29 10:02:52 -070022
23# Check for differences
24diff $aux.1 $aux.2