25 Commits

Author SHA1 Message Date
jaegonkim
a1988f3fdf [ONOS-7600] Supporting debug mode in onos.py
Change-Id: I388114bfd2419181cca6e137a9cc9b84c62c90de
2018-04-10 18:37:35 +00:00
jaegonkim
4e360499cc [ONOS-7489] onos.py - killing onos, and restarting onos for onos cluster failover test.
Change-Id: I111ccc72ac5d7ae826973e613b2073e96099f3f9
2018-03-13 17:37:54 +00:00
Carmelo Cascone
c3baa4cad9 Fixed onos.py
It now works also when no OpenFlow subsytem is loaded

Change-Id: If51f1ab654dad7c02a3f8744b53f4029abf1bd9f
2017-11-21 19:05:43 +00:00
Lyndon Fawcett
fbad2e75f8 ONOS-7040 added java options for configuring maximum and initial memory pool for JVM.
Change-Id: I87246759ffcd063497e2b522686f2028fe2c150a
2017-11-10 20:05:14 +00:00
Carmelo Cascone
c52a4b1b46 Run an ONOS cluster inside Mininet (via onos.py) with any demo script.
E.g. $ sudo -E python attmpls.py --cluster-size 3

Also, added option (--netcfg) to auto set netcfg at Mininet startup, and
added command to bring onos instances up/down to Mininet CLI.

Change-Id: Id02917fd5181af496b7d954da0ef3d5f2cbb970d
2016-11-30 21:19:47 +00:00
Jon Hall
2548559590 Add HA.py
A set of mininet based HA tests based on onos.py
Currently includes the following tests:
    - a control network partitioning test
    - A dynamic cluster scaling test

Change-Id: I9a8e1019dcc51666fee1d933afd66ff390592525
2016-09-12 17:56:20 +00:00
Bob Lantz
503a402e89 Multiple ONOSCluster support for ONOSCLI
Previously we were only passing the first ONOSCluster
into MininetFacade, but lo and behold it supports as
many networks as you like! So we pass them all in the
case where we have multiple ONOSClusters.

Change-Id: If848886b958aa47d3e4834c44adc98fffd90453c
2016-08-29 18:08:37 -07:00
Bob Lantz
8e576256fb Enable --custom files to import ONOSCLI
Since --custom files are execed, subsequently importing them
actually creates duplicate classes. This wouldn't be a problem
except that we depend on isinstance(). As a workaround, we allow
the class name to match if isinstance() fails, assuming it will
be a class that is compatible with ONOSCluster or ONOSNode.

Example: env PYTHONPATH=. mn --custom onos.py,mytest.py

where mytest.py imports onos

Change-Id: Ib4cda82fbdd612420de1e113ab768e2f137d5213
2016-08-29 17:56:11 -07:00
Bob Lantz
5763516eb6 Add portOffset for multiple ONOSCluster port forwarding
With multiple ONOS clusters, we want to make sure that the
forwarded port numbers don't collide. We add a portOffset
which is automatically incremented appropriately as more
ONOSClusters are created. It can also be specified explicitly.

Change-Id: I62977c3d4141668d9f541067db1a20ec0035489b
2016-08-30 00:55:39 +00:00
Jon Hall
a43d0334aa Add check for node status to onos.py startup
Change-Id: I8e6b103ef46a5bc5877507a7adef3eb6117adf64
2016-08-16 22:32:34 +00:00
Jon Hall
9b238aef36 Pass alertActions cli option to ONOSNode class in onos.py
Change-Id: I534cc0e22ac11018e6c5ec6f73a2f7259392b9e0
2016-08-16 22:30:35 +00:00
Bob Lantz
a2ccaa5672 unpackONOS: check for failure when extracting tar archive
Change-Id: Iad44ac863449afdbf21d8766479af569f9ba9b6e
2016-06-30 20:58:13 +00:00
Bob Lantz
930138e306 Enable global port forwarding in root namespace
This should fix the problem seen in VirtualBox where you
may have some random interface which is host-only which needs
to have port forwarding set up on it.

Change-Id: Iacdbb129d52529783bdab1c3d768131f6eaf0364
2016-06-30 01:16:53 +00:00
Bob Lantz
55562ea677 Unpack/install all nodes before startup
Madan suggested that this might help vs. the pipelined
startup we were doing before, so let's try it.

We will unpack/install all nodes before we start up,
so that we can start the whole cluster at about the same
instant.

Note that this is probably closer to what we'd see in hardware.

The disadvantage is that we don't get a "clean" environment
with each invocation of start().

Change-Id: I0a45984f50e1ef25a7d8a836e46978fdbdff0bd0
2016-06-17 18:21:08 -07:00
Bob Lantz
c3de5152b3 Correctly print message if arping isn't installed
Change-Id: Ia8e6a305bebb51556974b72c83d86b472b6918e5
2016-06-17 17:14:46 -07:00
Bob Lantz
92d8e0510f Use ip route to determine default intf for port forwarding
We were using eth0 by default before, but this doesn't work if
your default interface isn't eth0.

Fixes port forwarding on Ubuntu 16.04.

Change-Id: I55baed7fd8952a9f6cab364e20e31a0632ddda6d
2016-06-17 23:34:51 +00:00
Bob Lantz
9ba19dce8f Use netstat for waitListening; client -h h1 "apps -a"
And fix do_log()

Change-Id: I04402fda9c409fa4cb41ae20cf1c551369b7669d
2016-06-17 14:13:44 -07:00
Bob Lantz
c96e25824a add arp cmd; always return lists from checkLog
The arp CLI command sends gratuitous ARPs from all hosts - this
makes it easier for ONOS to discover hosts.

Previously checkLog returned None, None if the log file didn't
exist; now we return an empty list, to avoid breaking when we
take the len() of errors or warnings (which was happening before)
and to avoid having to check for None, None, which didn't seem to
add a lot of value to justify its complexity.

Change-Id: I84847fcf70525c82ac037d8a84cf40d21ab2a106
2016-06-13 21:40:25 -07:00
Bob Lantz
6438242617 Add status/error checks during ONOS startup
We check for:
- process exits
- log ERRORs
- log WARNings
- low memory

Also added a "status" CLI command to check for exits
and errors.

Change-Id: I6e65fe49619e338f1827fc616ca52a82de7ba470
2016-06-13 22:43:32 +00:00
Bob Lantz
569bbec710 Unset empty vars; pass IPs to onos-gen-partitions
We really don't need the OCx variables, but for now at
least we are unsetting the ones that are incorrect and
calling onos-gen-partitions with the explicit IP
addresses.

Change-Id: I8bd3d69bee4857e00070288b586255455c9c8adf
2016-06-06 15:28:12 +00:00
Bob Lantz
4b51d5c32e Various minor fixes and improvements
- enable parameters for onos cli commands (e.g. onos:apps -a)
- don't depend on onos1's name
- reduce dependencies on unnecessary variables
- enable running if karaf isn't installed elsewhere
- make NAT an option

Change-Id: I3e8abd51aa8d3f5c7afab1c6b86e50707de20ef6
2016-05-31 22:26:58 +00:00
Bob Lantz
1451d7241b Run onos as ONOS_USER rather than root (!)
Change-Id: Ibe87b89a71d12665eb932b40a843c691c4cfa584
2016-05-17 14:44:14 -07:00
Bob Lantz
bb37d87ac7 Add port forwarding using iptables
By default, we now forward the following ports from
port on eth0 to port+N on onosN:

8101 (KarafPort)
8181 (GUIPort) (also REST)
6643 (OpenFlowPort)

Note: this will not work if your default interface is
called something other than eth0.

Also: added null topology so we can use onos.py to control
an external/hardware network.

Bugs: it seems that iptables isn't cleaned up completely -
Mininet's NAT element may be to blame.

Change-Id: I2197194100a77ebfddd0d38ad5194ad7569ceba3
2016-05-17 17:14:57 +00:00
Bob Lantz
1125848f95 Fix ipBase option misspelling
It's arguable that maybe might want to support 'ipbase' as well
since it's used in --ipbase and it's easier to type. However,
ipBase is the spelling used in Mininet, so we should be
consistent.

Change-Id: I2f61df0d2d09abf652c5f06ef9c734a55159a7de
2016-05-11 19:09:34 -07:00
Bob Lantz
087b5d93f2 onos.py: ONOS cluster and control network modeling in Mininet
This is intended to facilitate ONOS development and testing when
you require an ONOS cluster and a modeled control network. More
information is available in the file comments/module docstring.

Change-Id: I8a7338b61bd21eb82ea4e27adbf3cea15be312ee
2016-05-12 22:03:48 +00:00