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 | |
| 6 | aux=/tmp/stc-$$.log |
| 7 | trap "rm -f $aux $aux.1 $aux.2 2>/dev/null" EXIT |
| 8 | |
| 9 | onos ${1:-$OCI} "onos:apps -s -a" > $aux |
| 10 | cat $aux |
| 11 | |
| 12 | # Normalize the installed apps |
| 13 | cut -c7- $aux | cut -d\ -f1 | sort > $aux.1 |
| 14 | |
| 15 | # Normalize the expected apps |
| 16 | apps=${ONOS_APPS:-drivers,openflow} |
| 17 | (for app in ${apps/,/ }; do echo org.onosproject.$app; done) | sort > $aux.2 |
| 18 | |
| 19 | # Check for differences |
| 20 | diff $aux.1 $aux.2 |