cloudfoundry/cf-acceptance-tests

Feature Request: use HTTP Status codes on internetless tests

Closed this issue · 3 comments

Whilst running the internetless tests with found an interesting edge case.

Currently the tests only check if a connection was successful or not:

Expect(catnipCurlResponse.ReturnCode).ToNot(Equal(0), "Expected traffic to be denied from app containers to external addresses.")

This has been fine for us so far as our connection is completely firewalled off. We're now moving to a transparent proxy though. Now when connecting to google.com the proxy actually returns a 503 status code (as the proxy is blocking it), the tests still class this as a success though as a connection was made, but in reality the connection never made it to google.com.

Is there any way the tests can take into account http status codes? maybe looking for a 200, rather than a complete unsuccessful event? Or a combination of checking for success and a 200 code back?

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/174924182

The labels on this github issue will be updated when the story is started.

Hey alibowl,

Thanks for the issue submission! Given the nature of the use case, it will be difficult for the team to prioritize the feature request. We'd be happy to merge a PR if you find a good solution that covers your use case and the more typical firewall use case you described.

Thanks,
Andrew and @jamespollard8

Hi, @alibowl

The team looked at this issue, and we've decided it doesn't belong in CATs, the mandate of which is to test core Cloud Foundry. At some point this test is going to be dropped from CATs. Products that are built on top of the open-source framework are welcome to include something like it that's appropriate to their particular situation.

Thanks,
Eric