I would like to test a scenario where server A cannot reach server B. To establish this, I will add iptables rules on server A so ssh connections fail. After some research (basically reading this article) I managed to come up with the rules I need. Before doing anything it is good to know the state of the system. Use
iptables -S
to find out existing rules on your system. To block connections to ssh, use:
iptables -A OUTPUT -p tcp --dport ssh -d 192.168.124.82 -j REJECT
removing the rule is simple, list the rules with iptables -S and replace -A with -D:
iptables -D OUTPUT -d 192.168.124.82/32 -p tcp -m tcp --dport 22 -j REJECT --reject-with icmp-port-unreachable
Showing posts with label testing. Show all posts
Showing posts with label testing. Show all posts
Tuesday, 25 April 2017
Friday, 2 March 2012
Javascript headless testing
Just a note, so that I won't forget. Use rhino and EnvJs to run jQuery code without a browser. In this way I would be able to test Unobtrusive Javascript code, to see it finds all elements on a rendered page.
BDD testdrive
I gave a try to BDD: looks really good. Fluent textual assertions. I tried out Lettuce. Fine vi syntax highlight stolen from the Cucumber project, see here: gvim syntax file for Gherkin. These are "heavy" functional tests, accessing the depolyed application. Mechanize was used to act as a browser. While I tried to write some assertions, I thought I need the power of jQuery. I asked an old friend of mine, PyQuery to help me. All the stuff was put together very quickly. Ask lettuce to create xUnit output, set up a Jenkins job, run after application deploy - I really like it.
Subscribe to:
Posts (Atom)