tom

Enhanced cell & cells tools.

Provided initial sketch of the Annotated concept for the model attributes.
package org.onlab.onos.net;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Maps;
import org.onlab.onos.net.provider.ProviderId;
import java.util.Map;
import java.util.Set;
/**
* Base implementation of a network model entity.
*/
public class AbstractModel implements Provided {
public class AbstractModel implements Provided, Annotated {
private final ProviderId providerId;
// FIXME: figure out whether to make this concurrent or immutable
private final Map<String, String> annotations = Maps.newHashMap();
// For serialization
public AbstractModel() {
providerId = null;
......@@ -28,4 +36,13 @@ public class AbstractModel implements Provided {
return providerId;
}
@Override
public Set<String> annotationKeys() {
return ImmutableSet.copyOf(annotations.keySet());
}
@Override
public String annotation(String key) {
return annotations.get(key);
}
}
......
package org.onlab.onos.net;
import java.util.Set;
/**
* Represents an entity that carries arbitrary annotations.
*/
public interface Annotated {
/**
* Returns the set of annotation keys currently available.
*
* @return set of annotation keys
*/
Set<String> annotationKeys();
/**
* Returns the annotation value for the specified key.
*
* @param key annotation key
* @return annotation value; null if there is no annotation
*/
String annotation(String key);
}
......@@ -9,5 +9,9 @@
nodes=$(env | sort | egrep "OC[0-9]+" | cut -d= -f2)
onos-package
for node in $nodes; do (printf "%s: %s\n" "$node" "`onos-install -f $node`")& done
for node in $nodes; do onos-install -f $node 1>/dev/null & done
# Wait for shutdown before waiting for restart
sleep 3
for node in $nodes; do onos-wait-for-start $node; done
......
......@@ -57,6 +57,7 @@ function cell {
if [ -n "$1" ]; then
[ ! -f $ONOS_ROOT/tools/test/cells/$1 ] && \
echo "No such cell: $1" >&2 && return 1
unset OC1 OC2 OC3 OC4 OC5 OC6 OC7 OC8 OC9 OCN OCI
. $ONOS_ROOT/tools/test/cells/$1
export OCI=$OC1
export ONOS_CELL=$1
......@@ -74,7 +75,11 @@ cell local >/dev/null # Default cell is the local VMs
# Lists available cells
function cells {
ls -1 $ONOS_ROOT/tools/test/cells
for cell in $(ls -1 $ONOS_ROOT/tools/test/cells); do
printf "%-12s %s\n" \
"$([ $cell = $ONOS_CELL ] && echo $cell '*' || echo $cell)" \
"$(grep '^#' $ONOS_ROOT/tools/test/cells/$cell | head -n 1)"
done
}
# Miscellaneous
......
unset OC1 OC2 OC3 OC4 OC5 OC6 OC7 OC8 OC9 OCN ONOS_NIC ONOS_FEATURES
# Default virtual box ONOS instances 1,2 & ONOS mininet box
. $ONOS_ROOT/tools/test/cells/.reset
# Local VirtualBox-based ONOS instances 1,2 & ONOS mininet box
export ONOS_NIC=192.168.56.*
export OC1="192.168.56.101"
export OC2="192.168.56.102"
......
# ProxMox-based cell of ONOS instances 1,2 & ONOS mininet box
. $ONOS_ROOT/tools/test/cells/.reset
# ProxMox-based cell of ONOS instance; no mininet-box
export ONOS_FEATURES="webconsole,onos-api,onos-core-trivial,onos-cli,onos-openflow,onos-app-fwd,onos-app-mobility,onos-app-tvue"
export ONOS_NIC="10.128.4.*"
export OC1="10.128.4.60"
......
# ProxMox-based cell of ONOS instances 1,2 & ONOS mininet box
. $ONOS_ROOT/tools/test/cells/.reset
export ONOS_NIC="10.1.9.*"
export OC1="10.1.9.94"
export OC2="10.1.9.82"
......
# Local VirtualBox-based single ONOS instance & ONOS mininet box
export ONOS_NIC=192.168.56.*
export OC1="192.168.56.101"
export OCN="192.168.56.103"
# Default virtual box ONOS instances 1,2 & ONOS mininet box
export ONOS_NIC=192.168.56.*
export OC1="192.168.56.11"
export OC2="192.168.56.12"
export OCN="192.168.56.7"
# Default virtual box ONOS instances 1,2 & ONOS mininet box
# Local VirtualBox-based ONOS instances 1,2,3 & ONOS mininet box
export ONOS_NIC=192.168.56.*
export ONOS_FEATURES="webconsole,onos-api,onos-core-trivial,onos-cli,onos-rest,onos-gui,onos-openflow,onos-app-fwd,onos-app-foo"
export OC1="192.168.56.101"
export OC2="192.168.56.102"
export OC3="192.168.56.104"
......