Thomas Vachuska | 8189a74 | 2015-05-29 10:02:52 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # ----------------------------------------------------------------------------- |
| 3 | # Checks whether all and only the ONOS apps configured in ONOS_APPS are active. |
| 4 | # ----------------------------------------------------------------------------- |
| 5 | |
Thomas Vachuska | 4cfcc56 | 2015-06-03 09:51:02 -0700 | [diff] [blame^] | 6 | [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 |
| 7 | . $ONOS_ROOT/tools/build/envDefaults |
| 8 | |
Thomas Vachuska | 8189a74 | 2015-05-29 10:02:52 -0700 | [diff] [blame] | 9 | aux=/tmp/stc-$$.log |
| 10 | trap "rm -f $aux $aux.1 $aux.2 2>/dev/null" EXIT |
| 11 | |
| 12 | onos ${1:-$OCI} "onos:apps -s -a" > $aux |
| 13 | cat $aux |
| 14 | |
| 15 | # Normalize the installed apps |
| 16 | cut -c7- $aux | cut -d\ -f1 | sort > $aux.1 |
| 17 | |
| 18 | # Normalize the expected apps |
Thomas Vachuska | a48e3d1 | 2015-06-02 09:43:29 -0700 | [diff] [blame] | 19 | apps=${2:-$ONOS_APPS} |
| 20 | apps=${apps:-drivers,openflow} |
Thomas Vachuska | fdbc4c2 | 2015-05-29 15:53:01 -0700 | [diff] [blame] | 21 | (for app in ${apps//,/ }; do echo org.onosproject.$app; done) | sort > $aux.2 |
Thomas Vachuska | 8189a74 | 2015-05-29 10:02:52 -0700 | [diff] [blame] | 22 | |
| 23 | # Check for differences |
| 24 | diff $aux.1 $aux.2 |