[Hawkular-dev] Mocking HTTP Server

mike thompson mithomps at redhat.com
Fri Jun 5 10:17:14 EDT 2015


Peter,
Based on our needs, QE has created one. A web-fixture to simulate down sites so we can test availability.

Thanks Viet!

Attaching the recent message from Viet...



I'm pleased to announce first version of the Web Test Fixture is up and running.  It's a web server (nginx) running inside Docker that can simulate a specific HTTP response code as well simple cron-like availability.  

Please let me know whether this is useful for Hawkular URL monitoring and what you want to see next. For example, a. simulate slow response time, b. cycle between http status codes, etc. 

Viet Nguyen

-----

Example usage:

[1] Launch a web fixture
docker run -d -p 8999:8080 hawkularqe/web-fixture

# get custom http code (replace 503 with any valid status code)
curl -I http://localhost:8999/http?return=503 <http://localhost:8999/http?return=503>
--> HTTP/1.1 503 Service Temporarily Unavailable

[2] Launch a mostly-available fixture - server goes offline for 10 seconds every minute
docker run -p 8999:8080 -e "DURATION=50s" -e "CRON_EXP=* * * * *" hawkularqe/web-fixture


[1] and [2] in the example above are also running on public OS1:
1. http://209.132.179.82:50001 <http://209.132.179.82:50001/>
2. http://209.132.179.82:50002 <http://209.132.179.82:50002/>


Github:
https://github.com/Hawkular-QE/web-fixture <https://github.com/Hawkular-QE/web-fixture>



> On 5 Jun 2015, at 07:09, Peter Palaga <ppalaga at redhat.com> wrote:
> 
> Hi *,
> 
> it happened today: http://perfcake.org/ - one of the sites we unit-test 
> Pinger against is down and therefore the tests are failing.
> 
> Can anybody recommend a solution for mocking an HTTP Server?
> 
> http://wiremock.org/ is the first result on Google and I am going to 
> have a look at it.
> 
> Thanks,
> 
> Peter
> _______________________________________________
> hawkular-dev mailing list
> hawkular-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hawkular-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hawkular-dev/attachments/20150605/a2e36f1d/attachment.html 


More information about the hawkular-dev mailing list