Automated testing in Perl
Testing ! Is there anything sexier than program testing ? Apart from 3D gaming development, cloud computing, automated Kickstart installation, high-performance clustering, Rails development, etc ? Okay, testing is even more boring than writing documentation, but fact is that we, humans, don't like testing, but computers love this type of bandwork. And testing is necessary : adding little changes to other people's programs, break them in the most horrible ways.
I've learnt this the hard way.
A serious bug in one of our backup clients forced me to upgrade the package. No problem, just dropping the new binary in the package, relabel everything, and build the thing. Not a good idea for a package that wasn't released for over 18 months, and passed through 4 different responsible teams. The postinstall was a 300 line spaghetti mess, which in the end I ended up rewriting half of it. And still more and more bugs kept popping up, which left me terribly ashamed.
I needed a way to test automatically all of the outputs of the postinstall, and at the same time to check if all configuration files were created correctly, and if the program was able to connect automagically to the backup server.
So I decided to have a look at Test::More, and delve into the documentation, and try to write some test scripts myself. Boy, was I pleasantly surprised (as allways with Perl, but this aside) ! Within one hour, I had a test written which checked all of this stuff automatically, and even discovered 4 more bugs in the output. Needless to say that since now, I'm addicted to testing my programs.
I've learnt this the hard way.
A serious bug in one of our backup clients forced me to upgrade the package. No problem, just dropping the new binary in the package, relabel everything, and build the thing. Not a good idea for a package that wasn't released for over 18 months, and passed through 4 different responsible teams. The postinstall was a 300 line spaghetti mess, which in the end I ended up rewriting half of it. And still more and more bugs kept popping up, which left me terribly ashamed.
I needed a way to test automatically all of the outputs of the postinstall, and at the same time to check if all configuration files were created correctly, and if the program was able to connect automagically to the backup server.
So I decided to have a look at Test::More, and delve into the documentation, and try to write some test scripts myself. Boy, was I pleasantly surprised (as allways with Perl, but this aside) ! Within one hour, I had a test written which checked all of this stuff automatically, and even discovered 4 more bugs in the output. Needless to say that since now, I'm addicted to testing my programs.
IBEX time
Disgrace ! Why wasn't this mentioned anywhere on the Ubuntu blogs ? As Intrepid Ibex is the current Ubuntu version, today, at 11:04:56 GMT, the Unix time_t value was "IBEX", that being the ASCII representation of the 32bit number of seconds since New Year 1970.
Other interesting upcoming dates :
Fear not, dear Ubuntu supporters, the ubuntu teams get another chance, as the lowercase numbers still yet have to come :
Other interesting upcoming dates :
IBEX Fri Dec 12 11:04:56 2008 GMT
ICON Sat Dec 13 05:59:42 2008 GMT
IDLE Sat Dec 13 23:59:01 2008 GMT
IDOL Sun Dec 14 00:11:56 2008 GMT
IEEE Sun Dec 14 17:41:25 2008 GMT
INCH Sun Dec 21 13:23:20 2008 GMT
INDY Sun Dec 21 13:27:53 2008 GMT
INFO Sun Dec 21 13:36:15 2008 GMT
IRAN Wed Dec 24 14:03:58 2008 GMT
IRAQ Wed Dec 24 14:04:01 2008 GMT
Fear not, dear Ubuntu supporters, the ubuntu teams get another chance, as the lowercase numbers still yet have to come :
Ibex Mon Jan 5 19:54:32 2009 GMT
Ibis Mon Jan 5 20:11:31 2009 GMT
Idea Wed Jan 7 08:18:41 2009 GMT
Idle Wed Jan 7 08:48:37 2009 GMT
Idol Wed Jan 7 09:01:32 2009 GMT
Iran Sat Jan 17 22:53:34 2009 GMT
Iraq Sat Jan 17 22:53:37 2009 GMT
Linux on a potato
"Hackers from the LinuxOnAnything.nl Web site successfully installed Linux on a potato. It's the first time the operating system has been successfully installed on a root vegetable."
Interesting howto for storing bites on the chipset of such a mashine ;)
Linux apparently can be installed on anything, here's a howto for installing Linux on a dead badger.
Classic notes.
Interesting howto for storing bites on the chipset of such a mashine ;)
Linux apparently can be installed on anything, here's a howto for installing Linux on a dead badger.
Classic notes.
10 years of Linux
Memorable dates : it must be 10 years now since I ditched Windows95, and started using Linux exclusively on my home computer. I actually installed Linux mid 96, but it took another 2 years for XFree to support my SiS video card for more than 640x480x50Hz, and for KDE to offer a nice enjoyable desktop environment.
Puppy school
Onze nieuwe hond mag sinds begin december naar de hondeschool. Tweemaal per week een uurtje gehoorzaamheidstraining, waarbij de basis commando's aangeleerd worden. Na de eerste training al een serieuze verandering in het wandelgedrag gemerkt : de pup trekt en sleurt minder aan de lijn, en blijft beter volgen. Onwaarschijnlijk hoe snel zo'n beest iets aanleert.
En het baasje kan na iedere les natuurlijk het nuttige aan het aangename paren in de kantine. Daarnet kwam de sint nog alle honden een cadeautje brengen, en ook de brave baasjes werden met jenever à volonté beloond. Plezant jong, zo'n hondeschool ;)
Gesmurft !
Crap . Verleden maand mijn eerste snelheidsboete gehad. Ik heb altijd wel een zware voet gehad, maar om één of andere reden altijd uit het vizier van de snelheidscamera's kunnen blijven. Nu is het ook wel zo dat ik in de bebouwde kom ook wel me probeer aan de 50 km te houden, maar deze keer zat ik met mijn hoofd compleet elders. En dan krijg je midden in de dag natuurlijk een vriendelijk verzoek om je naast de combi te parkeren.
Bon, met 63km/h in de bebouwde kom, en met een minnelijke schikking van 50 euro besef ik dat ik er goedkoop vanaf kom. En dat ik devolgende keer wat minder snel moet rijden, natuurlijk...
Bon, met 63km/h in de bebouwde kom, en met een minnelijke schikking van 50 euro besef ik dat ik er goedkoop vanaf kom. En dat ik devolgende keer wat minder snel moet rijden, natuurlijk...
Perladvent 2008
It's december, so time again for the Perl advent calendar 2008 !
MediaPortal 1.0 RC3
I already told you about my HTPC problems : TVXB nuked my Windows install, so I had to start a Windows repair session. After the Windows repair, I still experienced lots of problems : not only was my C: drive completely full, but MediaPortal 0.2.3 kept crashing as if it was a test car in one of the Top Gear episodes. I upgraded MediaPortal to 1.0.0 RC3 (version 0.2.3 was nowhere to find), but it complained heavily that it needed Windows XP SP3.
I decided to bite the bullet, and reinstall everything from scratch : I increased the C: drive to 40GB, reinstalled Windows with SP3, and reinstalled MediaPortal including TVServer. So, now that the dust has settled, you might ask if MP 1.0 was worth all the trouble. I must say I have mixed feelings :
- the stability of MediaPortal 1.0 RC3 is not up to the point of 0.2.3. Even RC versions of 0.2.3 were more stable. It's not that its very crash prone, but once in an evening, the TV image goes black. Could be related to the Hauppauge MPEG2 demuxer that I'm using now. Will need to investigate with other MPEG2 codecs.
- the MediaPortal team has decided that timeshifting is a allways-on feature. This means a hard disk which is continuously working. Lots of users complained about this feature, but the MP team refuses to revert this. Only option left is to remove TV Server, and use the internal TVserver in MediaPortal. But that means less hardware support...
- As MediaPortal needs to wait for TV Server to start, it takes longer for MP to start up also.
- MediaPortal doesn't play xvid content anymore (only audio)
- MediaPortal 1.0 is a major upgrade, but without any user feature enhancements. From the view of the end user, this is a major problem, and also explains the remaining popularity of 0.2.3.
I decided to bite the bullet, and reinstall everything from scratch : I increased the C: drive to 40GB, reinstalled Windows with SP3, and reinstalled MediaPortal including TVServer. So, now that the dust has settled, you might ask if MP 1.0 was worth all the trouble. I must say I have mixed feelings :
- the stability of MediaPortal 1.0 RC3 is not up to the point of 0.2.3. Even RC versions of 0.2.3 were more stable. It's not that its very crash prone, but once in an evening, the TV image goes black. Could be related to the Hauppauge MPEG2 demuxer that I'm using now. Will need to investigate with other MPEG2 codecs.
- the MediaPortal team has decided that timeshifting is a allways-on feature. This means a hard disk which is continuously working. Lots of users complained about this feature, but the MP team refuses to revert this. Only option left is to remove TV Server, and use the internal TVserver in MediaPortal. But that means less hardware support...
- As MediaPortal needs to wait for TV Server to start, it takes longer for MP to start up also.
- MediaPortal doesn't play xvid content anymore (only audio)
- MediaPortal 1.0 is a major upgrade, but without any user feature enhancements. From the view of the end user, this is a major problem, and also explains the remaining popularity of 0.2.3.
The lost toolbox
Last week, astronaut Heidemarie Stefanyshyn-Piper lost grip on a toolbox during a spacewalk; she and fellow astronaut Steve Bowen were on a space walk to clean and lubricate gears on a space station mechanism. Grease had oozed from a grease gun in her tool bag and slimed over other tools. In the process of trying to clean up the mess, she lost her grip on the 100 000 $ tool bag which would have weighed 30 pounds on Earth but floated away weightlessly in space. Even in space, women lose their purses...
NASA's runaway toolbag can now be seen through binoculars as it orbits Earth. Europeans are favored with a series of flybys in the nights ahead. The backpack-sized bag is drifting away from the ISS and it now leads the station by about eight minutes.
Here are the data for the ISS for the next couple of days :
Here is the data for the toolbox:
NASA's runaway toolbag can now be seen through binoculars as it orbits Earth. Europeans are favored with a series of flybys in the nights ahead. The backpack-sized bag is drifting away from the ISS and it now leads the station by about eight minutes.
Here are the data for the ISS for the next couple of days :
28 Nov -1.3 16:56:55 10 SW 16:59:41 39 SSE 17:02:28 10 E
28 Nov -2.4 18:32:02 10 W 18:34:58 81 N 18:35:30 56 ENE
29 Nov -2.2 17:24:06 10 WSW 17:27:01 75 SSE 17:29:58 10 E
29 Nov -1.5 18:59:31 10 W 19:01:51 51 WNW 19:01:51 51 WNW
30 Nov -2.3 17:51:37 10 W 17:54:34 78 N 17:56:39 18 E
30 Nov 0.2 19:27:04 10 W 19:28:19 23 W 19:28:19 23 W
1 Dec -2.4 18:19:16 10 W 18:22:14 79 NNE 18:23:13 37 E
1 Dec 1.4 19:54:43 10 W 19:54:53 11 W 19:54:53 11 W
2 Dec -2.3 17:11:31 10 W 17:14:28 77 N 17:17:24 10 E
2 Dec -2.3 18:46:58 10 W 18:49:55 73 SSW 18:49:55 73 SSW
3 Dec -2.3 17:39:19 10 W 17:42:15 81 N 17:45:06 11 E
3 Dec -0.4 19:14:48 10 W 19:16:47 30 WSW 19:16:47 30 WSW
4 Dec -2.1 18:07:11 10 W 18:10:07 67 SSW 18:12:09 18 ESE
4 Dec 1.0 19:43:06 10 W 19:43:51 14 WSW 19:43:51 14 WSW
Here is the data for the toolbox:
Friday 28 November 2008 Time Object (Link) Event
Ground trackStar chart Appears 18h20m34s 13.5mag az:261.0° W
Culmination 18h25m30s 5.9mag az:351.6° N h:87.7°
distance: 354.1km height above Earth: 353.9km elevation of sun: -15°
Disappears 18h26m25s 6.3mag az: 79.8° E h:39.9°
Saturday 29 November 2008 Time Object (Link) Event
Ground track Star chart Appears 18h46m12s 12.8mag az:272.5° W
Disappears 18h51m00s 6.0mag az:320.0° NW h:76.0°
Monday 1 December 2008 Time Object (Link) Event
Ground track Star chart Appears 18h01m59s 12.5mag az:273.3° W
Culmination 18h06m55s 5.9mag az: 2.7° N h:79.9°
distance: 358.7km height above Earth: 353.5km elevation of sun: -13°
Disappears 18h08m34s 7.2mag az: 88.1° E h:23.3°
TVXB is a virus
There are days that my old friend Murphy pays me a visit. Yesterday was such a day : a collegue accidentally reinstalled a test server where I almost completed a rewrite of a complex configuration script. Three days of work down the drain. Yay.
That'll teach me of not taking backups of my work.
At home, I use a Home Theater PC (HTPC) to control my TV. At the time of installation, the choice of media center software forced me to use Windows as the underlying platform, of which I knew this would lead down the road to hate, suffering and self-abuse. Anyhow, the thing worked without many problems for a year, which is quite a success.
Uptill now.
I use a program to fetch the Electronic Program Guide (EPG) from the internet. EPG is a real treat when using a HTPC, or a TV altogether. Once you're used to it, you'll never want to go back. Some weeks ago, the program used to get the EPG from the internet, WebEPG, stopped working. Apparently, the website teveblad.be blocked all WebEPG user-agents, and as this is hardcoded into WebEPG, I had to look out for another solution. I thought to find this in TVXB, which I installed and configured, and ran without problems. For a few days. After that, it also stopped working. It seemed that there was a problem with write permissions (the thing wanted to write in "C:Documents and SettingsApplication DataAll Users"). So I decided to uninstall & reinstall as the program offered this location as a choice during installation. However, the reinstallation program started a repair session, which decided to remove some important Windows files. Like NTLDR and such, which I only discovered after a reboot, off course... Programs which exhibit such behaviour are called a virus.
That'll teach me of not taking OS backups of my only Windows PC.
So the difficult process of copying the missing files from another PC, and with the help of a slow-starting Ubuntu live CD, was running, up to the point where Windows could load its kernel again, and offered me to repair the Windows install using the Windows setup CD. Cool, I thought. So Windows rebooted from its hard disk, but when it presented me a 640x480 window with a setup program, I knew Windows had blown it, and I had to go through the process of reinstalling every program on it, just to let Windows register these programs.
Hate, suffering and self-abuse indeed.
That'll teach me of not taking backups of my work.
At home, I use a Home Theater PC (HTPC) to control my TV. At the time of installation, the choice of media center software forced me to use Windows as the underlying platform, of which I knew this would lead down the road to hate, suffering and self-abuse. Anyhow, the thing worked without many problems for a year, which is quite a success.
Uptill now.
I use a program to fetch the Electronic Program Guide (EPG) from the internet. EPG is a real treat when using a HTPC, or a TV altogether. Once you're used to it, you'll never want to go back. Some weeks ago, the program used to get the EPG from the internet, WebEPG, stopped working. Apparently, the website teveblad.be blocked all WebEPG user-agents, and as this is hardcoded into WebEPG, I had to look out for another solution. I thought to find this in TVXB, which I installed and configured, and ran without problems. For a few days. After that, it also stopped working. It seemed that there was a problem with write permissions (the thing wanted to write in "C:Documents and SettingsApplication DataAll Users"). So I decided to uninstall & reinstall as the program offered this location as a choice during installation. However, the reinstallation program started a repair session, which decided to remove some important Windows files. Like NTLDR and such, which I only discovered after a reboot, off course... Programs which exhibit such behaviour are called a virus.
That'll teach me of not taking OS backups of my only Windows PC.
So the difficult process of copying the missing files from another PC, and with the help of a slow-starting Ubuntu live CD, was running, up to the point where Windows could load its kernel again, and offered me to repair the Windows install using the Windows setup CD. Cool, I thought. So Windows rebooted from its hard disk, but when it presented me a 640x480 window with a setup program, I knew Windows had blown it, and I had to go through the process of reinstalling every program on it, just to let Windows register these programs.
Hate, suffering and self-abuse indeed.