ClusterHQ/flocker — pull request #183 by wallrj (2014-06-30 18:48:16+00:00)
Title: Add a links argument to `GearClient.add`

* I've added a `links` argument to `GearClient.add` which,
* accepts a list of `PortMap` instances.
* The links are currently fixed to point to the host's loopback address,...
* which `geard` will actually (confusingly / understandably) route to the host's non-loopback addresses.
* My functional test for this starts a twisted server on an ephemeral port and then starts a custom Docker image (via `gear`) which attempts to connect and send bytes to its localhost.
* Gear.add creates the links necessary to get route the connection from the loopback port in the container to the listening port on one of the non-loopback addresses of the host.

I had a notion that the tests would only work if you first run `setenforce 0` on the host machine. But actually I may have misread the output of that command. It's not saying that "SELinux has been disabled", it's saying that "SELinux is disabled altogether, so setenforce has no effect".

```
$ setenforce 0
setenforce: SELinux is disabled

$ setenforce 1
setenforce: SELinux is disabled
```

See https://github.com/openshift/geard/issues/110#issuecomment-44869432