Selenium at London 2.0

I went to the regular London 2.0 meetup last night. Great people, interesting conversations and a little too much beer.

One of the Selenium developers, Jason Huggins demoed Selenium and Selenium-IDE on a Macbook notebook running the Parallels virtual machine software. He had several virtual machines running different platforms including Ubuntu Linux, Windows XP and Mac OS X with different browsers on each. Testing was triggered by checking in code to the SVN repository of Buildix virtual machine also running on the laptop.

When a check-in occurs the code is automagically tested on the browsers running on each of the browsers running on the different platforms in each virtual machine. The beauty of selenium is that the tests run inside the browser so your interface is tested just as it is used. All your JavaScript runs and works as for the end user. I loved the fact that all the browser sessions are captured to a Flash movie so that if a test fails you can watch the footage of the steps leading up to the failure.

The crux Jason's demo was that you could have a complete multiplatform web application test system running on a bottom level Macbook laptop (with extra RAM). The machine appeared to run very quickly despite the 5 or 6 VMs that were running. Jason mentioned that if you don't care about Mac browser testing (Safari) then you could set up a similar system using VMWare or Xen on Linux or Windows.

Selenium-IDE also looks seriously cool. It's a Firefox plugin that provides a complete environment for developing test cases. It can record your steps as you use a web interface and output to a variety of test script formats including a HTML stype sequential output, Python and Ruby. If using Python or Ruby scripts you can use all the features of the language such as conditions and loops. Selenium-IDE is going to make developing effective complete web tests so much easier (and fun!).

We need to start looking at this where I work. Our current web interface tests use Twill which works ok but has many shortcomings. Creating test cases is tedious, the JavaScript parts of the UI aren't tested at all and there's no testing of cross-browser support. Our UI is using more and more JavaScript so something like Selenium is going to become vital. I'm looking forward to using it.

Rockbox rocks

I discovered Rockbox today. It's a complete open source replacment for the firmware of several portable audio players include the iPod. It supports many audio formats including MP3, Ogg Vorbis and WMA and has cool stuff like gapless playback (great for mix CDs), themes, bookmarks and much more. I also love the fact that no special directory layout is required. Use your normal shell commands (eg. cp or rsync) or file management interface (eg. Nautilus) to copy tracks to your iPod.

I installed it on my iPod this afternoon; wow. It's not perfect (the tag cache system is fiddily) but it's stable and works as advertised. My main criticism is that there's too many options and features to fiddle with; great for geeks but not for the general consumer. But hey, it's open source so someone could create a friendlier version at some point. I love the idea that I can play with the code if I want to. It also has a plugin system for add-on apps which I'd love to check out at some point.

Rockbox is definitely staying on my iPod (yes, the process is reversible).

Hauppauge WinTV Nova-T USB2 on Fedora Core 4

I've spent a little more time getting the new TV tuner device working on FC4. Turns out I was using the wrong software to try and watch TV. I couldn't get tvtime to work it all. It looks for a /dev/videoN device node which the dvb-usb-nova-t-usb2 driver doesn't seem to expose. xine seemed to have the correct DVB support and worked well.

Instructions for Fedora Core 4

This is what I did with FC4. The is with kernel version 2.6.16-1.2069_FC4. I imagine other recent kernels will work as well but I haven't tried them.

  1. Extract the device firmware: The driver needs load the device firmware into the device. The device is useless without it. You may be able to find the firmware on the net somewhere. The firmware filename is dvb-usb-nova-t-usb2-01.fw for me. The firmware needs to be extracted from the Windows device driver files. I used the online extractor from Patrick Boettcher.
  2. Install the device firmware: Copy the fireware file to /lib/firmware. The hotplug daemon will pass it to the driver from that location.
  3. Plug in the TV tuner: Plug it in. You should see something like the following in your kernel logs or dmesg output.
    dvb-usb: found a 'Hauppauge WinTV-NOVA-T usb2' in cold state, will try to load a firmware
    dvb-usb: downloading firmware from file 'dvb-usb-nova-t-usb2-01.fw'
    usbcore: registered new driver dvb_usb_nova_t_usb2
    usb 4-2: USB disconnect, address 2
    dvb-usb: generic DVB-USB module successfully deinitialized and disconnected.
    usb 4-2: new high speed USB device using ehci_hcd and address 3
    usb 4-2: configuration #1 chosen from 1 choice
    dvb-usb: found a 'Hauppauge WinTV-NOVA-T usb2' in warm state.
    dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
    DVB: registering new adapter (Hauppauge WinTV-NOVA-T usb2).
    dvb-usb: MAC address: 00:0d:fe:07:17:ad
    dib3000: Found a DiBcom 3000P.
    DVB: registering frontend 0 (DiBcom 3000P/M-C DVB-T)...
    input: IR-receiver inside an USB DVB receiver as /class/input/input3
    dvb-usb: schedule remote query interval to 100 msecs.
    dvb-usb: Hauppauge WinTV-NOVA-T usb2 successfully initialized and connected.
    
    Check for a /dev/dvb/adaptor0 directory. It should contain several symlinks.
  4. dvb-apps: Install the dvb-apps package which should be in Fedora Extras (yum install dvb-apps)
  5. Scan channels: Ensure your TV antenna is connected. As root run something like dvbscan /usr/share/dvb-apps/dvb-t/uk-Oxford > channels.conf. You will need to pick a tuning file from /usr/share/dvb-apps/dvb-t that's close to your area. Check the output in channels.conf. There should be a line for each channel.
  6. Run Xine:As root, copy your new channels.conf to /root/.xine. Run xine and click the "DVB" button. You can select channels from the playlist functionality. You should see some TV.

It's unfortunate that the above doesn't work out of the box for non-root users. I'm sure a bit of udev configuration fiddling would provide the device nodes in /dev with more liberal permissions. I'll post details of that once I've played with this.

The remote control works partially. The volume controls work but the channel changing doesn't. I think this is a configuration issue. I'll need to figure this one out as well.

Hauppauge WinTV Nova-T USB2 TV tuner - First Impressions

Susanna and I don't watch a lot of TV and our new place doesn't have much space so we decided not to get a TV. My wonderful girlfriend does however suffer from chronic CSI addiction. Its about the only show she'd miss. I decided to investigate a TV tuner card for my notebook.

After a bit of research I decided to go with a free-to-air digital (DVB-T) tuner. The UK has quite a few free digital channels available and all the analog stations are also available on digital. Also, the reception will be much better being digital and all.

I ended up settling on the Hauppauge WinTV Nova-T USB2 because it's cheap (50 quid), easily available and has drivers in the mainline Linux kernel that ships with Fedora Core 4. Its a box that plugs in to the roof antenna cable and a USB port on your computer. It also an IR receiver for the included remote control.

I messed around trying to get it work for a little bit in Linux. The driver loaded fine once I put the device firmeware in the correct place but I wasn't able to figure out how to get tvtime to actually show anything. I'm close to having it work but I wanted to make sure the hardware was actually functioning so ...

... I booted into Windows. The drivers and software worked well. I was able to autoscan the channels immediately. They all get named nicely because (I assume) the name is transmitted as part of the channel. The watching software uses its own GUI toolkit so it took a little while to get used to but it works well. I tested remote and scheduling software. No problems there at all.

With a bit of luck CSI shall record properly tonight. We won't be around to watch it because are meeting one of Susanna's friends for dinner. Hopefully the resident CSI junkie will get her fix :)

I will try finishing the Linux/Fedora setup in the next couple of days and will post more detailed instructions then.

First post using Blogger

I've just transfered my blog to using Blogger after hearing from Stephen that you can host the blog on your own site. I haven't looked much yet at the customisation options but its pretty slick. Very quick to set up.

I've manually transfered the old entries that were remotely interesting, preserving the date.

I'm going to try and be a little more consistent about my posting frequency. There'll be plenty top blog about with the upcoming move to the UK.

Much Yum progress

Stayed up late last night working on the yum sqlite integration. Hacked out a new iterator style parser so yum doesn't load all the metadata into memory (and dump to a pickle) when importing into sqlite. I'm quite happy with it.

Also cleaned up a few other parts of Gijs' TODOs (and then added more of my own) :). All in all a productive and fun night although I'm more than a little tired this morning. In an effort to regain some fitness I've been walking every morning but I'm thinking that might not happen today :)

Seth emailed Gijs and me this morning in order to get CVS commit access organised. Sweet.

Yum plugins?

Reasonable amount of activity on yum-devel recently. Some arguing about how/if new features should be done and lots of bits and pieces being worked on. The arguing is mainly people proposing new features and Seth fighting against them. I see where Seth's coming from: he's got to make sure that not any old thing gets into yum creating a maintenance and usability nightmare. Still, he seems to be fighting awfully hard... Sometimes I think its better just to write some proof of concept code to show how the proposal might work. This gets everyone on the same page and makes the arguments more productive.

To help resolve some of the discussions I brought up the idea of maybe doing plugins for yum so that people can do external hacks for the more wierd shit without them making it into the main yum codebase. Funnily enough Panu and Gijs piped up straight away; they'd been thinking the same thing. Seth initially wasn't too keen on the idea but then gave a little ground. Seth now wants us to solidify the idea somewhat. I've got some rough ideas but haven't had the energy to put them to the list. Maybe tomorrow.

Kernel hacking, Software Suspend (Suspend2) and other coolness

Lots of interesting stuff in yesterday's sessions. Did the full day kernel hacking tutorial with Rusty Russell and Robert Love which despite the disorganisation and the fact that we ran out of time was a great intro and a lot of fun. Although they might not realise it, Rusty and Robert have a good dynamic that stops things from getting boring.

The open source quiz was great to watch. Some fairly crazy madness.

I hung around until late for some of the Birds of a Feather (BOF) sessions. The most interesting for me was the Software Suspend "installfest". This stuff is seriously cool. Fully featured suspend to hard disk with no special hardware/power management support required. You really don't ever need to shutdown your Linux system again. I was lucky enough to have all the Suspend2 developers helping me get it working on my notebook. It was suprisingly easy. I'm planning on contributing a cleaner kernel Fedora RPM with the Suspend2 patches. The guys are pushing to get this into the mainline kernel soon which should make this a lot more accessible.

At around 10pm we were kicked out by the organisers and some of us headed down to the Wig and Pen (again!). Drank too much (again!) and chatted to lots of cool people. Finally managed to track down Colin Charles who Seth Vidal told me to look out for at the conference. I should really easy up on the drinking one of these days...