Thomas Vachuska

Fixing & enhancing STC test scenarios.

Change-Id: Ieff7ce5350a69d8ebb215a2344c67e41479cf371
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
6 [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 6 [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
7 . $ONOS_ROOT/tools/build/envDefaults 7 . $ONOS_ROOT/tools/build/envDefaults
8 8
9 -export MAX_WAIT=45 9 +export MAX_WAIT=60
10 10
11 cmd="$1" && shift 11 cmd="$1" && shift
12 log="screenlog.0" 12 log="screenlog.0"
......
...@@ -16,8 +16,14 @@ ...@@ -16,8 +16,14 @@
16 <scenario name="net-pingall" description="Network pingall test"> 16 <scenario name="net-pingall" description="Network pingall test">
17 <!-- TODO: parametrize this via recipes --> 17 <!-- TODO: parametrize this via recipes -->
18 <group name="Net-Pingall"> 18 <group name="Net-Pingall">
19 - <step name="Ping-All-And-Verify" 19 + <step name="Install-Apps"
20 - exec="onos-mininet sendAndExpect py net.pingAll(1) --expect Results: [0-5]% dropped"/> 20 + exec="onos ${OC1} app activate org.onosproject.openflow org.onosproject.proxyarp org.onosproject.fwd"/>
21 +
22 + <step name="Check-Apps" requires="Install-Apps"
23 + exec="onos-check-apps ${OC1} drivers,openflow,proxyarp,fwd"/>
24 +
25 + <step name="Ping-All-And-Verify" requires="Check-Apps"
26 + exec="onos-mininet sendAndExpect py net.pingAll(1) --expect Results: .% dropped"/>
21 27
22 <step name="Check-Summary-For-Hosts" requires="~Ping-All-And-Verify" 28 <step name="Check-Summary-For-Hosts" requires="~Ping-All-And-Verify"
23 exec="onos-check-summary ${OC1} [0-9]* 25 140 25"/> 29 exec="onos-check-summary ${OC1} [0-9]* 25 140 25"/>
......
...@@ -19,13 +19,7 @@ ...@@ -19,13 +19,7 @@
19 <step name="Push-Topos" exec="onos-push-topos ${OCN}"/> 19 <step name="Push-Topos" exec="onos-push-topos ${OCN}"/>
20 <step name="Stop-Mininet-If-Needed" env="~" exec="onos-mininet stop"/> 20 <step name="Stop-Mininet-If-Needed" env="~" exec="onos-mininet stop"/>
21 21
22 - <step name="Install-Apps" 22 + <step name="Wipe-Out-Data-Before" exec="onos-wipe-out"/>
23 - exec="onos ${OC1} app activate org.onosproject.openflow org.onosproject.proxyarp org.onosproject.fwd"/>
24 -
25 - <step name="Check-Apps" requires="Install-Apps"
26 - exec="onos-check-apps ${OC1} drivers,openflow,proxyarp,fwd"/>
27 -
28 - <step name="Wipe-Out-Data-Before" requires="~Check-Apps" exec="onos-wipe-out"/>
29 23
30 <step name="Initial-Summary-Check" requires="~Wipe-Out-Data-Before" 24 <step name="Initial-Summary-Check" requires="~Wipe-Out-Data-Before"
31 exec="onos-check-summary ${OC1} [0-9]* 0 0 0"/> 25 exec="onos-check-summary ${OC1} [0-9]* 0 0 0"/>
...@@ -42,5 +36,8 @@ ...@@ -42,5 +36,8 @@
42 36
43 <step name="Balance-Masters" requires="Check-Summary" 37 <step name="Balance-Masters" requires="Check-Summary"
44 exec="onos ${OC1} balance-masters"/> 38 exec="onos ${OC1} balance-masters"/>
39 +
40 + <step name="Pause-For-Masters" requires="Balance-Masters"
41 + exec="sleep 10"/>
45 </group> 42 </group>
46 </scenario> 43 </scenario>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -17,6 +17,7 @@ package org.onosproject.ui.impl; ...@@ -17,6 +17,7 @@ package org.onosproject.ui.impl;
17 17
18 import com.google.common.collect.ImmutableList; 18 import com.google.common.collect.ImmutableList;
19 import com.google.common.collect.ImmutableList.Builder; 19 import com.google.common.collect.ImmutableList.Builder;
20 +import org.onlab.osgi.ServiceNotFoundException;
20 import org.onosproject.ui.UiExtensionService; 21 import org.onosproject.ui.UiExtensionService;
21 22
22 import javax.ws.rs.GET; 23 import javax.ws.rs.GET;
...@@ -38,6 +39,7 @@ import static com.google.common.io.ByteStreams.toByteArray; ...@@ -38,6 +39,7 @@ import static com.google.common.io.ByteStreams.toByteArray;
38 public class MainIndexResource extends AbstractInjectionResource { 39 public class MainIndexResource extends AbstractInjectionResource {
39 40
40 private static final String INDEX = "index.html"; 41 private static final String INDEX = "index.html";
42 + private static final String NOT_READY = "not-ready.html";
41 43
42 private static final String INJECT_CSS_START = "<!-- {INJECTED-STYLESHEETS-START} -->"; 44 private static final String INJECT_CSS_START = "<!-- {INJECTED-STYLESHEETS-START} -->";
43 private static final String INJECT_CSS_END = "<!-- {INJECTED-STYLESHEETS-END} -->"; 45 private static final String INJECT_CSS_END = "<!-- {INJECTED-STYLESHEETS-END} -->";
...@@ -48,8 +50,15 @@ public class MainIndexResource extends AbstractInjectionResource { ...@@ -48,8 +50,15 @@ public class MainIndexResource extends AbstractInjectionResource {
48 @GET 50 @GET
49 @Produces(MediaType.TEXT_HTML) 51 @Produces(MediaType.TEXT_HTML)
50 public Response getMainIndex() throws IOException { 52 public Response getMainIndex() throws IOException {
51 - UiExtensionService service = get(UiExtensionService.class); 53 + ClassLoader classLoader = getClass().getClassLoader();
52 - InputStream indexTemplate = getClass().getClassLoader().getResourceAsStream(INDEX); 54 + UiExtensionService service;
55 + try {
56 + service = get(UiExtensionService.class);
57 + } catch (ServiceNotFoundException e) {
58 + return Response.ok(classLoader.getResourceAsStream(NOT_READY)).build();
59 + }
60 +
61 + InputStream indexTemplate = classLoader.getResourceAsStream(INDEX);
53 String index = new String(toByteArray(indexTemplate)); 62 String index = new String(toByteArray(indexTemplate));
54 63
55 int p1s = split(index, 0, INJECT_JS_START); 64 int p1s = split(index, 0, INJECT_JS_START);
......
1 +<!DOCTYPE html>
2 +<!--
3 + ~ Copyright 2015 Open Networking Laboratory
4 + ~
5 + ~ Licensed under the Apache License, Version 2.0 (the "License");
6 + ~ you may not use this file except in compliance with the License.
7 + ~ You may obtain a copy of the License at
8 + ~
9 + ~ http://www.apache.org/licenses/LICENSE-2.0
10 + ~
11 + ~ Unless required by applicable law or agreed to in writing, software
12 + ~ distributed under the License is distributed on an "AS IS" BASIS,
13 + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 + ~ See the License for the specific language governing permissions and
15 + ~ limitations under the License.
16 + -->
17 +<html>
18 +<head>
19 + <meta charset="utf-8">
20 + <link rel="shortcut icon" href="data/img/onos-logo.png">
21 +
22 + <link rel="apple-touch-icon" href="data/img/apple-touch-icon.png">
23 + <meta name="apple-mobile-web-app-capable" content="yes">
24 + <meta name="apple-mobile-web-app-status-bar-style" content="black">
25 + <meta name="viewport" content="width=device-width, initial-scale=1.0">
26 +
27 + <meta http-equiv="refresh" content="5;URL=/onos/ui">
28 +
29 + <title>ONOS</title>
30 +
31 +</head>
32 +<body>
33 +<h1>ONOS GUI not ready yet... stand by...</h1>
34 +</body>
35 +</html>