Fixing checkstyle test hang with nc version >= 1.110

netcat (nc) 1.110 changed the behavior of how sockets are closed when
stdin is at EOF or closed. Previously, nc would call shutdown (TCP FIN
on the write side of the socket) when the end of stdin was reached.
Now, shutdown is only called if '-N' is passed as an argument.

This change was introduced into Ubuntu's fork of OpenBSD nc in Nov. 2016.
So, the affected versions were Ubuntu 17.04+ as well as any other
distribution that uses nc >= 1.110.

This change of behavior causes the call to ByteStreams.toByteArray()
to hang indefinietly, and thus checkstyle tests to hang indefinitely.

Rather than try to figure out which version of nc is present and set
the -N option, we will use an empty line as a sentinel and stop parsing
input when the first empty line is encountered. For this, we need two
changes: (1) send a newline when checking the socket in start-buck-daemon
and (2) send a newline at the end of the file list in onos.bucklet

We also set SO_TIMEOUT to 1 second and will return an exception if
the socket times out. This will prevent tests from hanging indefinitely.

Change-Id: If46b4b78ae89312e1afa0563f63100ae67762f0a
4 files changed
tree: e6ec7e9fe91af3f6cc1dc999aa61cd27e285ec80
  1. .buckconfig
  2. .dockerignore
  3. .gitignore
  4. .gitreview
  5. BUCK
  6. Dockerfile
  7. Jenkinsfile
  8. LICENSE.txt
  9. README.md
  10. apps/
  11. buck-tools/
  12. bucklets/
  13. cli/
  14. core/
  15. docs/
  16. drivers/
  17. features/
  18. incubator/
  19. lib/
  20. models/
  21. modules.defs
  22. onos.defs
  23. pipelines/
  24. pom.xml
  25. protocols/
  26. providers/
  27. tools/
  28. utils/
  29. web/
README.md

ONOS : Open Network Operating System

What is ONOS?

ONOS is a new SDN network operating system designed for high availability, performance, scale-out.

Top-Level Features

  • High availability through clustering and distributed state management.
  • Scalability through clustering and sharding of network device control.
  • Performance that is good for a first release, and which has an architecture that will continue to support improvements.
  • Northbound abstractions for a global network view, network graph, and application intents.
  • Pluggable southbound for support of OpenFlow and new or legacy protocols.
  • Graphical user interface to view multi-layer topologies and inspect elements of the topology.
  • REST API for access to Northbound abstractions as well as CLI commands.
  • CLI for debugging.
  • Support for both proactive and reactive flow setup.
  • SDN-IP application to support interworking with traditional IP networks controlled by distributed routing protocols such as BGP.
  • IP-Optical use case demonstration.

Checkout our website and our tools