test: add some unit tests for channel passing

One of the tests currently fails.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
test: improve the proxy code and unit test

The test still doesn't pass: this particular method of channel
passing shouldn't be used.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>