Thomas Vachuska

Fixed a failed unit test and added more to the setup scenario.

Change-Id: I28ee6627834f8964d5d06756afb44e6213c8afaa
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
1 +#!/bin/bash
2 +# -----------------------------------------------------------------------------
3 +# Checks whether all ONOS components are either ACTIVE or DISABLED.
4 +# -----------------------------------------------------------------------------
5 +
6 +aux=/tmp/stc-$$.log
7 +trap "rm -f $aux 2>/dev/null" EXIT
8 +
9 +onos ${1:-$OCI} scr:list > $aux
10 +cat $aux
11 +grep -q UNSATISFIED $aux && exit 1 || exit 0
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
17 <group name="Prerequisites"> 17 <group name="Prerequisites">
18 <step name="Check-Environment" exec="test -n ${ONOS_ROOT} -a -n ${ONOS_NIC} -a -n ${OC1}"/> 18 <step name="Check-Environment" exec="test -n ${ONOS_ROOT} -a -n ${ONOS_NIC} -a -n ${OC1}"/>
19 <step name="Check-ONOS-Bits" exec="onos-check-bits"/> 19 <step name="Check-ONOS-Bits" exec="onos-check-bits"/>
20 +
20 <parallel var="${OC#}"> 21 <parallel var="${OC#}">
21 <step name="Check-Passwordless-Login-${#}" 22 <step name="Check-Passwordless-Login-${#}"
22 exec="ssh -n -o ConnectTimeout=3 -o PasswordAuthentication=no sdn@${OC#} date"/> 23 exec="ssh -n -o ConnectTimeout=3 -o PasswordAuthentication=no sdn@${OC#} date"/>
......
...@@ -16,14 +16,22 @@ ...@@ -16,14 +16,22 @@
16 <scenario name="setup" description="ONOS cluster setup"> 16 <scenario name="setup" description="ONOS cluster setup">
17 <group name="Setup"> 17 <group name="Setup">
18 <step name="Push-Bits" exec="onos-push-bits-through-proxy" if="${OCT}"/> 18 <step name="Push-Bits" exec="onos-push-bits-through-proxy" if="${OCT}"/>
19 +
19 <parallel var="${OC#}"> 20 <parallel var="${OC#}">
20 <step name="Uninstall-${#}" exec="onos-uninstall ${OC#}"/> 21 <step name="Uninstall-${#}" exec="onos-uninstall ${OC#}"/>
22 +
21 <step name="Install-${#}" exec="onos-install ${OC#}" 23 <step name="Install-${#}" exec="onos-install ${OC#}"
22 requires="Uninstall-${#},Push-Bits"/> 24 requires="Uninstall-${#},Push-Bits"/>
25 +
23 <step name="Wait-for-Start-${#}" exec="onos-wait-for-start ${OC#}" 26 <step name="Wait-for-Start-${#}" exec="onos-wait-for-start ${OC#}"
24 requires="Install-${#}"/> 27 requires="Install-${#}"/>
28 +
25 <step name="Check-Logs-${#}" exec="onos-check-logs ${OC#}" 29 <step name="Check-Logs-${#}" exec="onos-check-logs ${OC#}"
26 requires="-Wait-for-Start-${#}"/> 30 requires="-Wait-for-Start-${#}"/>
31 + <step name="Check-Components-${#}" exec="onos-check-components ${OC#}"
32 + requires="-Wait-for-Start-${#}"/>
33 + <step name="Check-Apps-${#}" exec="onos-check-apps ${OC#}"
34 + requires="-Wait-for-Start-${#}"/>
27 </parallel> 35 </parallel>
28 </group> 36 </group>
29 </scenario> 37 </scenario>
......
...@@ -48,9 +48,9 @@ public class CompilerTest { ...@@ -48,9 +48,9 @@ public class CompilerTest {
48 48
49 System.setProperty("prop.foo", "Foobar"); 49 System.setProperty("prop.foo", "Foobar");
50 System.setProperty("prop.bar", "Barfoo"); 50 System.setProperty("prop.bar", "Barfoo");
51 - System.setProperty("OC1", "1.2.3.1"); 51 + System.setProperty("TOC1", "1.2.3.1");
52 - System.setProperty("OC2", "1.2.3.2"); 52 + System.setProperty("TOC2", "1.2.3.2");
53 - System.setProperty("OC3", "1.2.3.3"); 53 + System.setProperty("TOC3", "1.2.3.3");
54 } 54 }
55 55
56 public static FileInputStream getStream(String name) throws FileNotFoundException { 56 public static FileInputStream getStream(String name) throws FileNotFoundException {
......
...@@ -38,8 +38,8 @@ ...@@ -38,8 +38,8 @@
38 38
39 <dependency name="maybe" requires="yo"/> 39 <dependency name="maybe" requires="yo"/>
40 40
41 - <parallel var="${OC#}" requires="alpha"> 41 + <parallel var="${TOC#}" requires="alpha">
42 - <step name="ping-${#}" exec="asdads ${OC#}"/> 42 + <step name="ping-${#}" exec="asdads ${TOC#}"/>
43 <step name="pong-${#}" exec="asdads"/> 43 <step name="pong-${#}" exec="asdads"/>
44 <step name="ding-${#}" exec="asdads" requires="ping-${#},pong-${#}"/> 44 <step name="ding-${#}" exec="asdads" requires="ping-${#},pong-${#}"/>
45 <dependency name="maybe" requires="ding-${#}"/> 45 <dependency name="maybe" requires="ding-${#}"/>
......