Merge "Add L2 selector options to connectivity intents"
diff --git a/core/api/src/main/java/org/onlab/onos/net/intent/HostToHostIntent.java b/core/api/src/main/java/org/onlab/onos/net/intent/HostToHostIntent.java
index 83fe92a..2d42f58 100644
--- a/core/api/src/main/java/org/onlab/onos/net/intent/HostToHostIntent.java
+++ b/core/api/src/main/java/org/onlab/onos/net/intent/HostToHostIntent.java
@@ -41,7 +41,7 @@
}
private static HostId max(HostId one, HostId two) {
- return one.hashCode() > two.hashCode() ? one : two;
+ return one.hashCode() >= two.hashCode() ? one : two;
}
/**
diff --git a/core/api/src/main/java/org/onlab/onos/net/intent/Intent.java b/core/api/src/main/java/org/onlab/onos/net/intent/Intent.java
index f23a448..4c11f57 100644
--- a/core/api/src/main/java/org/onlab/onos/net/intent/Intent.java
+++ b/core/api/src/main/java/org/onlab/onos/net/intent/Intent.java
@@ -37,8 +37,8 @@
*/
protected Intent(IntentId id, ApplicationId appId,
Collection<NetworkResource> resources) {
+ this.id = checkNotNull(id, "Intent ID cannot be null");
this.appId = checkNotNull(appId, "Application ID cannot be null");
- this.id = checkNotNull(id, "Fingerprint cannot be null");
this.resources = resources;
}
@@ -77,6 +77,7 @@
* @return intent identifier
*/
protected static IntentId id(Object... fields) {
+ // FIXME: spread the bits across the full long spectrum
return IntentId.valueOf(Objects.hash(fields));
}
@@ -90,12 +91,12 @@
}
@Override
- public int hashCode() {
+ public final int hashCode() {
return Objects.hash(id);
}
@Override
- public boolean equals(Object obj) {
+ public final boolean equals(Object obj) {
if (this == obj) {
return true;
}
diff --git a/tools/test/bin/onos-install b/tools/test/bin/onos-install
index d999f36..3448214 100755
--- a/tools/test/bin/onos-install
+++ b/tools/test/bin/onos-install
@@ -6,8 +6,17 @@
[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
. $ONOS_ROOT/tools/build/envDefaults
-# If the first option is -f attempt uninstall first.
-[ "$1" = "-f" ] && shift && onos-uninstall ${1:-$OCI}
+while getopts fn o; do
+ case "$o" in
+ f) uninstall=true;;
+ n) nostart=true;;
+ esac
+done
+let OPC=$OPTIND-1
+shift $OPC
+
+# If the -f was given, attempt uninstall first.
+[ -n "$uninstall" ] && onos-uninstall ${1:-$OCI}
node=${1:-$OCI}
remote=$ONOS_USER@$node
@@ -27,19 +36,20 @@
mkdir $ONOS_INSTALL_DIR/config
# Install the upstart configuration file and setup options for debugging
- sudo cp $ONOS_INSTALL_DIR/debian/onos.conf /etc/init/onos.conf
+ [ -z "$nostart" ] && sudo cp $ONOS_INSTALL_DIR/debian/onos.conf /etc/init/onos.conf
echo 'export ONOS_OPTS=debug' > $ONOS_INSTALL_DIR/options
# Remove any previous ON.Lab bits from ~/.m2 repo
rm -fr ~/.m2/repository/org/onlab
# Drop log level for the console
- echo "log4j.logger.org.apache.sshd = WARN" >> $ONOS_INSTALL_DIR/$KARAF_DIST/etc/org.ops4j.pax.logging.cfg
+ echo "log4j.logger.org.apache.sshd = WARN" \
+ >> $ONOS_INSTALL_DIR/$KARAF_DIST/etc/org.ops4j.pax.logging.cfg
"
# Configure the ONOS installation
onos-config $node
-# Ignite the ONOS service.
-onos-service $node start
+# Unless -n option was given, attempt to ignite the ONOS service.
+[ -z "$nostart" ] && onos-service $node start