Wed, 08 Apr 2009
New Laptop? New job?
Is it just me or does everybody seem to go and buy a new laptop just
before they leave their current job? Is it the techie version of buying
new work shoes?
Like this post? - Digg Me! | Add to del.icio.us! | reddit this!
Posted: 2009/04/08 11:37 | /geekstuff | Permanent link to this entry | This entry and same date
2009 Q2 PiP
I've been quiet on the PiP front for a while now. While the day to day stuff
has kept me busy it hasn't exactly helped move my career along, I spend
most of my time doing things I already know how to do but with a little
twist on them.
In an attempt to stop myself from further stagnation I've put a short list of goals below that should be my bare minimum for the next three months.
- Attend one technical conference / training course
- Attend two technical user group meetings
- Read and review 3 books.
- Write and publish a Perl modules.
- Write and package a Python or Ruby module
- Write and publish a technical article.
- Create a personal Debian repo
- Create 3 Debian packages, at least one of which should contain other peoples code.
- Write 30 blog posts - at least 15 of which should be technical.
I'll do a follow up post at the end of the quarter so see how far I got.
Like this post? - Digg Me! | Add to del.icio.us! | reddit this!
Posted: 2009/04/08 10:20 | /geekstuff | Permanent link to this entry | This entry and same date
Mon, 06 Apr 2009
Ruby DNS Testing - First Glance
DNS is one of those 'small config change here, errors a long way over there
later' technologies that always leaves me a little worried about the
knock on effect of my changes. As a simple, coarse, safeguard at work we
use Nagios to check that a canary record in each zone can be resolved
from each DNS server. It's far from a perfect solution but it does catch
some of the bigger errors and typos.
In order to beef up this safety net (and encourage me
to spend time using a language other than Perl) I've been
investigating some of the testing options available in ruby, namely
RSpec and Cucumber. I have to say the testing libraries themselves are
actually nice to use and easy to pick up even for a
non-rubyists like me. On the other hand I quickly developed a strong
dislike of the ruby resolv library that actually does the
DNS queries. The lack of decent tutorials or documentation for
anything beyond the very basic uses and the (to me) very awkward API
nearly had me running back to the safety of
Net::DNS
, a mature and widely used perl module. There is a ruby port that I'll
have a look at in the future
For the testing itself I started writing RSpec stories against my own DNS and found the API easy to use. Testing existing configs against local policies is simple - for example all our domains should list at least three name servers -
it "should have at least 3 NS records" do
@resolver = Resolv::DNS.new
@nameservers = @resolver.getresources( domain, Resolv::DNS::Resource::IN::NS)
@nameservers.should have_at_least(3).items
end
After doing some more scut work and testing other record types I moved onwards and upwards to Cucumber. I'm not sure I'd be able to gift someone else with writing the scenarios but they'll be easier to show business people than raw rspec stories. They'll also be very handy in migration meetings (an executable todo list), if it's not on the page it's not getting done.
Feature: Mass DNS Resolution
In order to present a consistent brand image
As a System Administrator
I want to ensure no domains point away from our main IP
Scenario Outline: Resolve a name to a number
Given a hostname of <hostname>
Then I should see the IP address 266.266.266.266
Examples:
| hostname |
| example.org |
| www.example.org |
Next time I work somewhere with ISO 27xxx compliance requirements I'll see if the controls can be written like this and have automatic verification run from them. Cucumber is a little wordy for my tastes but I can see where that could be a strength when presenting to the right audience (such as compliance auditors).
Next time we have a set of DNS migrations I'll be using at least one of these tools to write before and after test cases to ensure nothing gets missed or slips through the cracks. Once I've been through a couple I'll write up in more detail what we end up with.
Like this post? - Digg Me! | Add to del.icio.us! | reddit this!
Posted: 2009/04/06 15:46 | /ruby | Permanent link to this entry | This entry and same date

