Thomas Vachuska
Committed by Gerrit Code Review

Added STC shutdown scenario.

Change-Id: I48b882c872f69fdd84fe2fd057163e68ffb58012
...@@ -92,21 +92,18 @@ public class ClusterManager implements ClusterService, ClusterAdminService { ...@@ -92,21 +92,18 @@ public class ClusterManager implements ClusterService, ClusterAdminService {
92 @Override 92 @Override
93 public ControllerNode getLocalNode() { 93 public ControllerNode getLocalNode() {
94 checkPermission(Permission.CLUSTER_READ); 94 checkPermission(Permission.CLUSTER_READ);
95 -
96 return store.getLocalNode(); 95 return store.getLocalNode();
97 } 96 }
98 97
99 @Override 98 @Override
100 public Set<ControllerNode> getNodes() { 99 public Set<ControllerNode> getNodes() {
101 checkPermission(Permission.CLUSTER_READ); 100 checkPermission(Permission.CLUSTER_READ);
102 -
103 return store.getNodes(); 101 return store.getNodes();
104 } 102 }
105 103
106 @Override 104 @Override
107 public ControllerNode getNode(NodeId nodeId) { 105 public ControllerNode getNode(NodeId nodeId) {
108 checkPermission(Permission.CLUSTER_READ); 106 checkPermission(Permission.CLUSTER_READ);
109 -
110 checkNotNull(nodeId, INSTANCE_ID_NULL); 107 checkNotNull(nodeId, INSTANCE_ID_NULL);
111 return store.getNode(nodeId); 108 return store.getNode(nodeId);
112 } 109 }
...@@ -114,7 +111,6 @@ public class ClusterManager implements ClusterService, ClusterAdminService { ...@@ -114,7 +111,6 @@ public class ClusterManager implements ClusterService, ClusterAdminService {
114 @Override 111 @Override
115 public ControllerNode.State getState(NodeId nodeId) { 112 public ControllerNode.State getState(NodeId nodeId) {
116 checkPermission(Permission.CLUSTER_READ); 113 checkPermission(Permission.CLUSTER_READ);
117 -
118 checkNotNull(nodeId, INSTANCE_ID_NULL); 114 checkNotNull(nodeId, INSTANCE_ID_NULL);
119 return store.getState(nodeId); 115 return store.getState(nodeId);
120 } 116 }
...@@ -123,7 +119,6 @@ public class ClusterManager implements ClusterService, ClusterAdminService { ...@@ -123,7 +119,6 @@ public class ClusterManager implements ClusterService, ClusterAdminService {
123 @Override 119 @Override
124 public DateTime getLastUpdated(NodeId nodeId) { 120 public DateTime getLastUpdated(NodeId nodeId) {
125 checkPermission(Permission.CLUSTER_READ); 121 checkPermission(Permission.CLUSTER_READ);
126 -
127 return store.getLastUpdated(nodeId); 122 return store.getLastUpdated(nodeId);
128 } 123 }
129 124
...@@ -158,14 +153,12 @@ public class ClusterManager implements ClusterService, ClusterAdminService { ...@@ -158,14 +153,12 @@ public class ClusterManager implements ClusterService, ClusterAdminService {
158 @Override 153 @Override
159 public void addListener(ClusterEventListener listener) { 154 public void addListener(ClusterEventListener listener) {
160 checkPermission(Permission.CLUSTER_EVENT); 155 checkPermission(Permission.CLUSTER_EVENT);
161 -
162 listenerRegistry.addListener(listener); 156 listenerRegistry.addListener(listener);
163 } 157 }
164 158
165 @Override 159 @Override
166 public void removeListener(ClusterEventListener listener) { 160 public void removeListener(ClusterEventListener listener) {
167 checkPermission(Permission.CLUSTER_EVENT); 161 checkPermission(Permission.CLUSTER_EVENT);
168 -
169 listenerRegistry.removeListener(listener); 162 listenerRegistry.removeListener(listener);
170 } 163 }
171 164
......
...@@ -141,8 +141,8 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr ...@@ -141,8 +141,8 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr
141 public void deactivate() { 141 public void deactivate() {
142 providerRegistry.unregister(this); 142 providerRegistry.unregister(this);
143 controller.removeListener(listener); 143 controller.removeListener(listener);
144 + collectors.values().forEach(PortStatsCollector::stop);
144 providerService = null; 145 providerService = null;
145 -
146 LOG.info("Stopped"); 146 LOG.info("Stopped");
147 } 147 }
148 148
...@@ -165,6 +165,7 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr ...@@ -165,6 +165,7 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr
165 if (sw == null || !sw.isConnected()) { 165 if (sw == null || !sw.isConnected()) {
166 LOG.error("Failed to probe device {} on sw={}", deviceId, sw); 166 LOG.error("Failed to probe device {} on sw={}", deviceId, sw);
167 providerService.deviceDisconnected(deviceId); 167 providerService.deviceDisconnected(deviceId);
168 + return;
168 } else { 169 } else {
169 LOG.trace("Confirmed device {} connection", deviceId); 170 LOG.trace("Confirmed device {} connection", deviceId);
170 } 171 }
......
...@@ -15,8 +15,8 @@ env LANG=en_US.UTF-8 ...@@ -15,8 +15,8 @@ env LANG=en_US.UTF-8
15 #env NEW_JAVA_HOME=/usr/lib/jvm/java-8-oracle/ 15 #env NEW_JAVA_HOME=/usr/lib/jvm/java-8-oracle/
16 16
17 pre-stop script 17 pre-stop script
18 - /opt/onos/bin/onos halt 2>/opt/onos/var/stderr.log 18 + /opt/onos/bin/onos halt 2>>/opt/onos/var/stderr.log
19 - sleep 2 19 + sleep 1
20 end script 20 end script
21 21
22 script 22 script
......
1 +<!--
2 + ~ Copyright 2015 Open Networking Laboratory
3 + ~
4 + ~ Licensed under the Apache License, Version 2.0 (the "License");
5 + ~ you may not use this file except in compliance with the License.
6 + ~ You may obtain a copy of the License at
7 + ~
8 + ~ http://www.apache.org/licenses/LICENSE-2.0
9 + ~
10 + ~ Unless required by applicable law or agreed to in writing, software
11 + ~ distributed under the License is distributed on an "AS IS" BASIS,
12 + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 + ~ See the License for the specific language governing permissions and
14 + ~ limitations under the License.
15 + -->
16 +<scenario name="shutdown" description="ONOS cluster shutdown">
17 + <group name="Shutdown">
18 + <parallel var="${OC#}">
19 + <step name="Stop-Service-${#}" exec="onos-service ${OC#} stop"/>
20 + <step name="Check-Logs-${#}" exec="onos-check-logs ${OC#}"
21 + requires="~Stop-Service-${#}"/>
22 + </parallel>
23 + </group>
24 +</scenario>
1 +<!--
2 + ~ Copyright 2015 Open Networking Laboratory
3 + ~
4 + ~ Licensed under the Apache License, Version 2.0 (the "License");
5 + ~ you may not use this file except in compliance with the License.
6 + ~ You may obtain a copy of the License at
7 + ~
8 + ~ http://www.apache.org/licenses/LICENSE-2.0
9 + ~
10 + ~ Unless required by applicable law or agreed to in writing, software
11 + ~ distributed under the License is distributed on an "AS IS" BASIS,
12 + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 + ~ See the License for the specific language governing permissions and
14 + ~ limitations under the License.
15 + -->
16 +<scenario name="startup" description="ONOS cluster startup">
17 + <group name="Startup">
18 + <parallel var="${OC#}">
19 + <step name="Start-Service-${#}" exec="onos-service ${OC#} start"/>
20 + <step name="Wait-for-Start-${#}" exec="onos-wait-for-start ${OC#}"
21 + requires="Start-Service-${#}"/>
22 + <step name="Check-Logs-${#}" exec="onos-check-logs ${OC#}"
23 + requires="~Wait-for-Start-${#}"/>
24 + </parallel>
25 + </group>
26 +</scenario>