Added prox test cell and enhanced install to allow customization of the hazelcas…
…t.xml for proper network interface.
Showing
4 changed files
with
37 additions
and
6 deletions
... | @@ -8,6 +8,9 @@ import org.apache.felix.scr.annotations.ReferenceCardinality; | ... | @@ -8,6 +8,9 @@ import org.apache.felix.scr.annotations.ReferenceCardinality; |
8 | import org.onlab.onos.cluster.ClusterEvent; | 8 | import org.onlab.onos.cluster.ClusterEvent; |
9 | import org.onlab.onos.cluster.ClusterEventListener; | 9 | import org.onlab.onos.cluster.ClusterEventListener; |
10 | import org.onlab.onos.cluster.ClusterService; | 10 | import org.onlab.onos.cluster.ClusterService; |
11 | +import org.onlab.onos.net.device.DeviceEvent; | ||
12 | +import org.onlab.onos.net.device.DeviceListener; | ||
13 | +import org.onlab.onos.net.device.DeviceService; | ||
11 | import org.slf4j.Logger; | 14 | import org.slf4j.Logger; |
12 | 15 | ||
13 | import static org.slf4j.LoggerFactory.getLogger; | 16 | import static org.slf4j.LoggerFactory.getLogger; |
... | @@ -23,17 +26,23 @@ public class FooComponent { | ... | @@ -23,17 +26,23 @@ public class FooComponent { |
23 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | 26 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
24 | protected ClusterService clusterService; | 27 | protected ClusterService clusterService; |
25 | 28 | ||
26 | - private ClusterEventListener clusterListener = new InnerClusterListener(); | 29 | + @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
30 | + protected DeviceService deviceService; | ||
31 | + | ||
32 | + private final ClusterEventListener clusterListener = new InnerClusterListener(); | ||
33 | + private final DeviceListener deviceListener = new InnerDeviceListener(); | ||
27 | 34 | ||
28 | @Activate | 35 | @Activate |
29 | public void activate() { | 36 | public void activate() { |
30 | clusterService.addListener(clusterListener); | 37 | clusterService.addListener(clusterListener); |
38 | + deviceService.addListener(deviceListener); | ||
31 | log.info("Started"); | 39 | log.info("Started"); |
32 | } | 40 | } |
33 | 41 | ||
34 | @Deactivate | 42 | @Deactivate |
35 | public void deactivate() { | 43 | public void deactivate() { |
36 | clusterService.removeListener(clusterListener); | 44 | clusterService.removeListener(clusterListener); |
45 | + deviceService.removeListener(deviceListener); | ||
37 | log.info("Stopped"); | 46 | log.info("Stopped"); |
38 | } | 47 | } |
39 | 48 | ||
... | @@ -43,6 +52,13 @@ public class FooComponent { | ... | @@ -43,6 +52,13 @@ public class FooComponent { |
43 | log.info("WOOOOT! {}", event); | 52 | log.info("WOOOOT! {}", event); |
44 | } | 53 | } |
45 | } | 54 | } |
55 | + | ||
56 | + private class InnerDeviceListener implements DeviceListener { | ||
57 | + @Override | ||
58 | + public void event(DeviceEvent event) { | ||
59 | + log.info("YEEEEHAAAAW! {}", event); | ||
60 | + } | ||
61 | + } | ||
46 | } | 62 | } |
47 | 63 | ||
48 | 64 | ... | ... |
... | @@ -8,4 +8,7 @@ | ... | @@ -8,4 +8,7 @@ |
8 | 8 | ||
9 | remote=$ONOS_USER@${1:-$OCI} | 9 | remote=$ONOS_USER@${1:-$OCI} |
10 | 10 | ||
11 | -echo "Deprecated!" | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
11 | +ssh $remote " | ||
12 | + sudo perl -pi.bak -e \"s/ <interface>.*</ <interface>${ONOS_NIC:-192.168.56.*}</g\" \ | ||
13 | + $ONOS_INSTALL_DIR/$KARAF_DIST/etc/hazelcast.xml | ||
14 | +" | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -9,7 +9,8 @@ | ... | @@ -9,7 +9,8 @@ |
9 | # If the first option is -f attempt uninstall first. | 9 | # If the first option is -f attempt uninstall first. |
10 | [ "$1" = "-f" ] && shift && onos-uninstall ${1:-$OCI} | 10 | [ "$1" = "-f" ] && shift && onos-uninstall ${1:-$OCI} |
11 | 11 | ||
12 | -remote=$ONOS_USER@${1:-$OCI} | 12 | +node=${1:-$OCI} |
13 | +remote=$ONOS_USER@$node | ||
13 | 14 | ||
14 | scp -q $ONOS_TAR $remote:/tmp | 15 | scp -q $ONOS_TAR $remote:/tmp |
15 | 16 | ||
... | @@ -30,7 +31,10 @@ ssh $remote " | ... | @@ -30,7 +31,10 @@ ssh $remote " |
30 | 31 | ||
31 | # Remove any previous ON.Lab bits from ~/.m2 repo | 32 | # Remove any previous ON.Lab bits from ~/.m2 repo |
32 | rm -fr ~/.m2/repository/org/onlab | 33 | rm -fr ~/.m2/repository/org/onlab |
33 | - | ||
34 | - # Ignite the ONOS service. | ||
35 | - sudo service onos start | ||
36 | " | 34 | " |
35 | + | ||
36 | +# Configure the ONOS installation | ||
37 | +onos-config $node | ||
38 | + | ||
39 | +# Ignite the ONOS service. | ||
40 | +onos-service $node start | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment