Everything is a Freaking DNS problem - cucumber http://127.0.0.1:8080/blog/taxonomy/term/1453/0 en Beyond Configuration Mgmt http://127.0.0.1:8080/blog/beyond-configuration-mgmt <p>(This post has been sitting in the drafts folder for way to long, I decided to push the publish button anyhow .. some people might get ideas from it..)</p> <p>We've all run in to the problem, you've puppetized, or euh .. cooked , about every part of your infrastructure and then there's this one service which has no config files, a broken api that doesn't allow you to configure antyhing, but a magnificent web gui to configure all aspects of the service. Magnificent for the eye , full of AJAX and other fancy stuff which wget isn't really keen on. Off course before it even starts working you need to set it's password , from that webgui.</p> <p>Sometimes when you are lucky they store al their config in a database, which you can dump, parse and replace all the host specific parameters for other deployments, but is that an approach you like ? As for each new version you'll need to reanalyze the db layout. But no matter how you look at it ,dumping the DB and restoring it is an ugly hack you don't want.</p> <p>Other alternatives like sniffing the traffic and replaying the POSTS etc were considered ... but fancy AJAX stuff and SSL make that less trivial than it seems </p> <p>Wo while discussing with an upstream project they proposed to actually screenscrape their config webgui .</p> <p>So screenscraping the config gui it is .. but how ... I started looking at tools that are typically used for testing rather than for automation, with the purpose of replaying the scenarios one needs to configure the services.</p> <p>My first attempt was Selenium, it plugs into a browser , so it's easy to acraully record what it has to do, and it saves it's scenarios in a somewhat readable/ editable format.<br /> Having found the export to perl function it alll looked promising. However the export to perl isn't really an export to perl as I epxected .. I assumed it would just generate the perl code to run the same scneario which would be awesome .. it however generates a perl script that instructs a selenium server to run the script.</p> <p>One of the annoyancies I ran into with Selenium is that a browser<br /> doesn't accept self signed certificates , and one can't preprovision a browser easyily with those freshly created certificates. (Yes Karl I already read about certutil ... )</p> <p>I had heard good things about Cucumber so I was pretty eager to start testing it ... In short Cucumber lack documentation ,<br /> I tried a couple of things but I couldn't get beyond testing if a certain string was on a page.. couldn't figure out how to fill in a form etc ...<br /> Maybe if anyone could point me to some great documentation on how you should write recipe's here ... I didn't find the documentation all to easy to find ..<br /> Bummer as it really really looks promisiung .. specially since it is so lightweight ..</p> <p>IP played with JMeter and Sahi too .. but still</p> <p>So apart from filing bugs to the upstream project/product and hoping they understand your problem and are willing to oopen up their API , what other options do you folks suggest ?</p> <p>I gave a short talk about this at Puppetcamp in Amsterdam and the audience came up with a bunch of other potential projects to look at .</p> <ul> <li> <a href="http://hpricot.com/" rel="nofollow">Hpricot</a> </li><li><a href="http://www.webinject.org/" rel="nofollow">WebInject</a> </li><li><a href="http://sikuli.org/" rel="nofollow">Project Sikuli</a> </li><li><a href="http://watir.com/" rel="nofollow">Watir</a> and </li></ul> <p>The main problem still is that all these are tools to automate testing , they don't provide you with a general purpose approach to solve the configuration mgmt problem, each time the upstream vendor modifies the layout of his page you hav e to do the work again and that .. really doesn't sound promising ..</p> http://127.0.0.1:8080/blog/beyond-configuration-mgmt#comments chef cucumber devops jmeter puppet puppetcamp selenium shai testing Wed, 25 May 2011 21:18:08 +0000 Kris Buytaert 1042 at http://127.0.0.1:8080/blog