...
To get the source code and build ONOS, all you need to do it run the following commands from Unix-like terminal (e.g. Linux, MacOS):
Code Block |
---|
language | bash |
---|
title | Download ONOS code & Build ONOS |
---|
|
git clone https://gerrit.onosproject.org/onos
cd onos
export ONOS_ROOT=$(pwd)
tools/build/onos-buck build onos --show-output |
...
To run ONOS locally on the development machine, simply run the following command:
Code Block |
---|
language | bash |
---|
title | Run ONOS |
---|
|
tools/build/onos-buck run onos-local -- clean debug # 'clean' to delete all previous status; 'debug' to enable Remote Debug function |
The above command will create a local installation from the onos.tar.gz
file (re-building it if necessary) and will start the ONOS server in the background. In the foreground, it will display a continuous view of the ONOS (Apache Karaf) log file. Options following the double-dash (–) are passed through to the ONOS Apache Karaf and can be omitted. Here, the clean
option forces a clean installation of ONOS and the debug
option means that the default debug port 5005 will be available for attaching a remote debugger.
To attach to the ONOS CLI console, run:
Code Block |
---|
language | bash |
---|
title | Login into ONOS CLI |
---|
|
tools/test/bin/onos localhost |
Once connected, you can run various ONOS CLI and Apache Karaf commands. For example, to start up OpenFlow and reactive forwarding, you could do the following:
Code Block |
---|
language | bash |
---|
title | Activate applications by ONOS CLI |
---|
|
onos> app activate org.onosproject.openflow
onos> app activate org.onosproject.fwd |
To open your default browser on the ONOS GUI page, simply type:
Code Block |
---|
language | bash |
---|
title | Open ONOS web page |
---|
|
tools/test/bin/onos-gui localhost |
...
To execute ONOS unit tests, including code Checkstyle validation, run the following command:
Code Block |
---|
language | bash |
---|
title | Run unit tests for ONOS |
---|
|
tools/build/onos-buck test |
...