Implementation based on this:
HAProxy should be able to create multiple pools and frontends
A partial fix for this is on https://github.com/opscode-cookbooks/haproxy/pull/27
Does this still pass all the tests? Are there additional tests that need to be added for the new feature?
Yes it still pass the test.
I have added a more complex test case in my fork (https://github.com/criteo-cookbooks/haproxy/commit/6dfc1865767e0510419b1130338c51c060e0d4cb) but this is only testing that chef run without error. If you want, I can add a full test case for the lwrp.
The test case could create 2 apps (simple netcat), configure haproxy to loadbalance between them and verify that netcats get connection.
The test is better than nothing. You can see some test examples in the hostsfile cookbook. Seth Vargo would be happy to help you if you have any questions about testing LWRPs with test-kitchen.
I have added one integration test using netcat: it starts two netcat listening on port 5001 and 5002. Haproxy is configured by attributes to use the lwrp to roundrobin between these two ports. We check that both of them have received a message sent through haproxy.
is it ok for you?
Bryan McLellan [btm-opscode] do you need another kind of test?
We need to change the 'p' variable to something else, since ruby has a p method.
Grégoire Seux I've merged this to master, with a rebase, and changed the p variable to pool.
Released in 1.5.0