tests: Reduce risk of port collision and remove bash dependency.
authorBen Pfaff <blp@nicira.com>
Fri, 3 Feb 2012 00:37:31 +0000 (16:37 -0800)
committerBen Pfaff <blp@nicira.com>
Fri, 3 Feb 2012 00:37:31 +0000 (16:37 -0800)
commit37b694e7a76ca6abc62c78eceae26f655cf6bccf
tree287a56fa8dcb35fc08bd686a23ab5d3b66aaf1a5
parent7d0c5973d5165f3cc6099de326ad0dfc326bac33
tests: Reduce risk of port collision and remove bash dependency.

A few tests need a random TCP port on which to listen for connections.
Until now, the tests have used the $RANDOM bash extension to do this, but
this runs the risk of occasionally colliding with an in-use port.  This
commit removes the bash dependency by switching to using a small Perl
program to pick random ports and reduces the risk of collision by
attempting to bind the port that it chooses.

Reported-by: Timothy Chen <tchen@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
AUTHORS
tests/automake.mk
tests/choose-port.pl [new file with mode: 0644]
tests/ofproto-dpif.at
tests/ovsdb-server.at