Thomas Vachuska
Committed by Gerrit Code Review

Added STC shutdown scenario.

Change-Id: I48b882c872f69fdd84fe2fd057163e68ffb58012
......@@ -92,21 +92,18 @@ public class ClusterManager implements ClusterService, ClusterAdminService {
@Override
public ControllerNode getLocalNode() {
checkPermission(Permission.CLUSTER_READ);
return store.getLocalNode();
}
@Override
public Set<ControllerNode> getNodes() {
checkPermission(Permission.CLUSTER_READ);
return store.getNodes();
}
@Override
public ControllerNode getNode(NodeId nodeId) {
checkPermission(Permission.CLUSTER_READ);
checkNotNull(nodeId, INSTANCE_ID_NULL);
return store.getNode(nodeId);
}
......@@ -114,7 +111,6 @@ public class ClusterManager implements ClusterService, ClusterAdminService {
@Override
public ControllerNode.State getState(NodeId nodeId) {
checkPermission(Permission.CLUSTER_READ);
checkNotNull(nodeId, INSTANCE_ID_NULL);
return store.getState(nodeId);
}
......@@ -123,7 +119,6 @@ public class ClusterManager implements ClusterService, ClusterAdminService {
@Override
public DateTime getLastUpdated(NodeId nodeId) {
checkPermission(Permission.CLUSTER_READ);
return store.getLastUpdated(nodeId);
}
......@@ -158,14 +153,12 @@ public class ClusterManager implements ClusterService, ClusterAdminService {
@Override
public void addListener(ClusterEventListener listener) {
checkPermission(Permission.CLUSTER_EVENT);
listenerRegistry.addListener(listener);
}
@Override
public void removeListener(ClusterEventListener listener) {
checkPermission(Permission.CLUSTER_EVENT);
listenerRegistry.removeListener(listener);
}
......
......@@ -141,8 +141,8 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr
public void deactivate() {
providerRegistry.unregister(this);
controller.removeListener(listener);
collectors.values().forEach(PortStatsCollector::stop);
providerService = null;
LOG.info("Stopped");
}
......@@ -165,6 +165,7 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr
if (sw == null || !sw.isConnected()) {
LOG.error("Failed to probe device {} on sw={}", deviceId, sw);
providerService.deviceDisconnected(deviceId);
return;
} else {
LOG.trace("Confirmed device {} connection", deviceId);
}
......
......@@ -15,8 +15,8 @@ env LANG=en_US.UTF-8
#env NEW_JAVA_HOME=/usr/lib/jvm/java-8-oracle/
pre-stop script
/opt/onos/bin/onos halt 2>/opt/onos/var/stderr.log
sleep 2
/opt/onos/bin/onos halt 2>>/opt/onos/var/stderr.log
sleep 1
end script
script
......
<!--
~ Copyright 2015 Open Networking Laboratory
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<scenario name="shutdown" description="ONOS cluster shutdown">
<group name="Shutdown">
<parallel var="${OC#}">
<step name="Stop-Service-${#}" exec="onos-service ${OC#} stop"/>
<step name="Check-Logs-${#}" exec="onos-check-logs ${OC#}"
requires="~Stop-Service-${#}"/>
</parallel>
</group>
</scenario>
<!--
~ Copyright 2015 Open Networking Laboratory
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<scenario name="startup" description="ONOS cluster startup">
<group name="Startup">
<parallel var="${OC#}">
<step name="Start-Service-${#}" exec="onos-service ${OC#} start"/>
<step name="Wait-for-Start-${#}" exec="onos-wait-for-start ${OC#}"
requires="Start-Service-${#}"/>
<step name="Check-Logs-${#}" exec="onos-check-logs ${OC#}"
requires="~Wait-for-Start-${#}"/>
</parallel>
</group>
</scenario>