For some time now I’ve been working in the background on watirgrid which allows for distributed testing across a grid network using Watir. The engine (gem) itself is open source and you can get it as follows:
gem install watirgrid
One of the questions I often get asked (via email) are what ports / network communications are required by Watirgrid, especially in the setup and establishment of a grid. Watirgrid uses both UDP and TCP to establish comms between the providers and a controller as such. Consider the following bounce diagram.
- First we set up a controller listening on a public WAN IP of 150.133.123.51. We tell the controller that the ring server should listen on this IP with the -h flag. We also tell the controller to start its DRb server on the same IP with the -H flag. If we don’t specify a port for the ring server or the DRb server (using -r and -d flags) then the controller will use the defaults; 12358 and 11235 respectively.
- Next we start up a provider and point it to the Ring server IP of 150.133.123.51 with the -h flag. We also tell the provider to start its DRb server on its own public IP with the -H flag, which in this case is 150.133.123.8
- When the provider starts in the previous step, it will broadcast using UDP to all hosts on the controller’s subnet, on port 12358 asking if there are any Ring servers available.
- The controller will subsequently respond, letting the provider know which port its own DRb server can be be contacted on using TCP. In this case it will send a TCP packet to the provider’s port 11236 after which the provider will respond back via TCP to the controller’s port of 11235.
Essentially the ports you need open on the controller, are UDP (default 12358) which is the Ring server and TCP (default 11235) which is the controller’s DRb server. The ports you need open on the provider are TCP (default 11236) which is the provider’s DRb server.
All communications between controller and provider are first marshalled via the Ring server (using UDP) and then directed between controller and provider(s) via the DRb servers (using TCP). If you have established a grid out in the wild, or on your own intranet, you should be using the external WAN or LAN IP of your host machines (not local / loopback addresses).
I’ll be posting more information on using watirgrid, including how to execute tests via different testing frameworks such as cucumber in the near future. I’ll also make an effort to monitor watir-general for any questions related to watirgrid.
Happy bot’netting!
Read More
