TestDrive

Ubuntu Opportunistic Developers Week March 2010 - Testdrive - DustinKirkland - Mar 5 2010

Launchpad Project

(11:01:12 AM) kirkland: howdy all
(11:01:31 AM) kirkland: anyone here to hear about Testdrive for the Opportunistic Developer Week?
(11:02:10 AM) kirkland: alrighty
(11:02:17 AM) kirkland: couple people, good enough for me
(11:02:35 AM) kirkland: so my name is Dustin Kirkland, an Ubuntu Core Developer on the Server Team
(11:02:50 AM) kirkland: in particular, I look after Ubuntu's virtualization and cloud computing packages
(11:03:07 AM) kirkland: but I'd also like to think of myself as an opportunistic developer too ;-)
(11:03:28 AM) kirkland: this session is about Testdrive, which I hope is interesting to you for two reasons ...
(11:03:39 AM) kirkland: 1) it was totally developed opportunistically ;-)
(11:03:53 AM) kirkland: 2) it can be used to help you test/develop your own opportunistic apps
(11:04:19 AM) kirkland: so who here has some helper scripts that they wrote or borrowed from someone else, living in their $HOME/bin dir?
(11:04:47 AM) kirkland: well, those are often good targets of opportunity for sharing, IMHO
(11:04:57 AM) kirkland: and that's sort of how Testdrive came about
(11:05:09 AM) kirkland: kvm is a really powerful program
(11:05:15 AM) kirkland: with lots and lots and lots of options
(11:05:32 AM) kirkland: http://manpages.ubuntu.com/manpages/lucid/en/man1/kvm.1.html
(11:05:45 AM) kirkland: but i tended to use the same ones over and over again
(11:05:51 AM) kirkland: for a few reasons ...
(11:05:58 AM) kirkland: they made my VMs run faster, better, etc.
(11:06:18 AM) kirkland: so i wrote a little shell script i called mykvm that added those options automatically for me
(11:06:47 AM) kirkland: as turned out, though, this could be really useful for other people
(11:07:06 AM) kirkland: particularly people who don't terribly want to learn lots and lots about virtualization and kvm
(11:07:16 AM) kirkland: but just want to quickly launch a throwaway VM
(11:07:25 AM) kirkland: perhaps boot a live cd in a vm, test something, then discard it
(11:07:41 AM) kirkland: about the same time, lots and lots of people started complaining about karmic
(11:07:57 AM) kirkland: "omg the colors are ugly... this is broken... that is broken... etc. etc. etc."
(11:08:09 AM) kirkland: but this stuff had been in the pipeline for months
(11:08:36 AM) kirkland: anyone of those very vocal individuals could have tried Ubuntu any time in the last 6 months
(11:08:39 AM) kirkland: reported bugs
(11:08:46 AM) kirkland: and perhaps gotten some of them fixed
(11:08:58 AM) kirkland: so Testdrive was born
(11:09:12 AM) kirkland: as a way to "testdrive" the latest daily Ubuntu ISOs
(11:09:25 AM) kirkland: using rsync/zsync to incrementally download the day's image
(11:09:28 AM) kirkland: run it in a vm
(11:09:32 AM) kirkland: perhaps install, perhaps not
(11:09:40 AM) kirkland: and throw it away when done!
(11:10:07 AM) kirkland: what started out as a way to scratch my own itch ended up helping lots of people
(11:10:11 AM) kirkland: and solving a different problem
(11:10:41 AM) kirkland: and after Lucid releases, you'll be able to continue testdriving MM, OO, PP, etc. while still running Lucid ;-)
(11:11:03 AM) kirkland: so there's a couple of steps along the way ...
(11:11:14 AM) kirkland: of course i created a project and a team in Launchpad
(11:11:20 AM) kirkland: http://launchpad.net/testdrive
(11:11:24 AM) kirkland: http://launchpad.net/~testdrive
(11:11:32 AM) kirkland: loaded the source code up into bzr
(11:11:41 AM) kirkland: pushed to a public branch, GPLv3
(11:11:58 AM) kirkland: packaged it (this is important if you want people to install your program!)
(11:12:16 AM) kirkland: pushed to PPAs (backported to Hardy, Intrepid, Jaunty, Karmic, Lucid)
(11:12:32 AM) kirkland: and eventually got it into Ubuntu universe for Lucid
(11:12:36 AM) kirkland: (PPAs for the rest)
(11:12:50 AM) kirkland: now, shortly after I released the initial version working with KVM, people came along and said
(11:12:57 AM) kirkland: "I like it, but I can't use KVM ..."
(11:13:05 AM) kirkland: and thus it grew arms and legs
(11:13:41 AM) kirkland: to use VirtualBox and Parallels
(11:13:47 AM) kirkland: and there's a VMWare patch under development
(11:13:56 AM) kirkland: this is community driven efforts, now
(11:14:12 AM) kirkland: with people like popey and others contributing bugs, features, patches, fixes, etc.
(11:14:45 AM) kirkland: so that's a bit about the history of the development of testdrive so far
(11:14:51 AM) kirkland: i see a question ....
(11:14:59 AM) kirkland: <tgalati4> QUESTION: What % of Karmic bugs were hardware support vs strictly software?
(11:15:16 AM) kirkland: I have no idea what the percentage is, but I'll address the spirit of your question ....
(11:15:29 AM) kirkland: obviously there are limitations to what can be tested in a VM
(11:15:41 AM) kirkland: but there are tons of things that still can be tested in a VM!
(11:16:05 AM) kirkland: actually, when I demo'd testdrive at UDS Dallas, sconklin of the Ubuntu kernel team said ...
(11:16:31 AM) kirkland: "crap dude, if this testdrive thing takes off, people aren't going to test on their real hardware as much any more"
(11:16:40 AM) kirkland: i reckon that's true to some extent
(11:16:55 AM) kirkland: so at the end of running testdrive, there's now a question that ask you:
(11:17:09 AM) kirkland: Launch USB Startup Disk Creator for further testing of this ISO? [y/N]
(11:17:23 AM) kirkland: :-)  which was sconklin's suggestion
(11:17:45 AM) kirkland: <enli_> QUESTION: "...testdriving MM, OO, PP etc." what those stand for?
(11:18:00 AM) kirkland: MM, OO, PP are whatever the releases after Lucid Lynx might be ;-)
(11:18:22 AM) kirkland: multimorphing minataur
(11:18:26 AM) kirkland: um
(11:18:42 AM) kirkland: meh, whatever mark comes up with :-)
(11:19:08 AM) kirkland: <tgalati4> QUESTION: How successful is a VM for testing strictly hardware bugs?
(11:19:22 AM) kirkland: a VM can be used for some things
(11:19:26 AM) kirkland: like USB devices
(11:19:40 AM) kirkland: you can "passthrough" USB devices to VMs
(11:19:46 AM) kirkland: like a web cam
(11:19:49 AM) kirkland: or a 3G modem
(11:20:04 AM) kirkland: i often pass my Palm Pre cell phone through to a vm
(11:20:33 AM) kirkland: so ... using Testdrive to do your development/testing ...
(11:20:57 AM) kirkland: if you're already on Lucid, it's just "sudo apt-get install testdrive"
(11:21:23 AM) kirkland: if you're on Jaunty/Karmic, grab it from the PPA at http://launchpad.net/testdrive
(11:21:36 AM) kirkland: if you're on Hardy/Intrepid, well, it'll work, but there's a few limitations
(11:21:58 AM) kirkland: basically, the linux virtualization stack has evolved rapidly in the last ~1 year
(11:22:15 AM) kirkland: so ... get testdrive installed
(11:22:23 AM) kirkland: you'll need run either kvm or virtualbox
(11:22:33 AM) kirkland: i tend to recommend kvm if you have hardware that can run kvm
(11:22:42 AM) kirkland: and fall back to VB only if you have to
(11:23:06 AM) kirkland: once testdrive is installed, you can run either from the command line or from the Applications -> System Tools -> Testdrive menu
(11:23:32 AM) kirkland: if you run with no options, you should be prompted with a menu of Ubuntu releases
(11:23:47 AM) kirkland: this is just a concise list of perhaps the most popular ISOs
(11:23:52 AM) kirkland: (arguably)
(11:23:56 AM) kirkland: you can choose one of these
(11:24:03 AM) kirkland: or enter your own url
(11:24:11 AM) kirkland: actually, from the command line, you can use:
(11:24:18 AM) kirkland: testdrive -u any_iso
(11:24:28 AM) kirkland: where any_iso can be a local path
(11:24:32 AM) kirkland: or http, ftp, or rsync
(11:24:37 AM) kirkland: and it doesn't have to be ubuntu
(11:24:50 AM) kirkland: it can be debian, fedora, windows, whatever
(11:25:05 AM) kirkland: well, i don't much about windows
(11:25:14 AM) kirkland: but it should theoretically work :-)
(11:25:28 AM) kirkland: <tgalati4> QUESTION: How much RAM is recommended for VM to use testdrive?
(11:26:18 AM) kirkland: if you have >1G of memory, testdrive will give 512M to the guest
(11:26:34 AM) kirkland: else if you have > 750MB, testdrive will give 384M to the guest
(11:26:51 AM) kirkland: else it will give 256M to the guest
(11:26:59 AM) kirkland: which is basically what's required to run a live cd iso
(11:27:08 AM) kirkland: so i'd say you need >256M of memory :-)
(11:27:36 AM) kirkland: actually, this was one of the first reasons i created that old mykvm script
(11:27:42 AM) kirkland: kvm defaults to 128M of memory
(11:27:45 AM) kirkland: which ain't much :-)
(11:27:54 AM) kirkland: i *always* gave my VM's 512M
(11:28:18 AM) kirkland: so i created a bash alias, which eventually turned into a script to add virtio networking and virtio disk
(11:28:26 AM) kirkland: oh, another thing about the evolution of that code ...
(11:28:30 AM) kirkland: it started out as shell script
(11:28:36 AM) kirkland: which is fine and dandy for prototyping
(11:28:44 AM) kirkland: but if you want to do something more complex
(11:28:51 AM) kirkland: and you want to work with other people on the code
(11:28:55 AM) kirkland: ie, "collaborate"
(11:29:03 AM) kirkland: shell can be difficult ;-)
(11:29:08 AM) kirkland: so I re-wrote it in python
(11:29:16 AM) kirkland: i'm sure you've heard a lot about python this week
(11:29:27 AM) kirkland: i'm no expert, but it's easy to learn, and a very friendly language
(11:29:42 AM) kirkland: <w1nGNUtz> QUESTION: What exactly do you expect users to test?
(11:29:51 AM) kirkland: well, it's both a test and a development tool, actually
(11:30:00 AM) kirkland: from a test perspective ...
(11:30:32 AM) kirkland: some of you probably saw the new ubuntu theme posts this week?
(11:30:38 AM) kirkland: new colors and windows and stuff like that?
(11:30:43 AM) kirkland: great for testdriving
(11:31:11 AM) kirkland: or perhaps packages in ppas
(11:31:19 AM) kirkland: that you're not willing to put on your primary desktop
(11:31:25 AM) kirkland: which might even be running Lucid, as in my case
(11:31:45 AM) kirkland: there's some stuff that even core developers are risk adverse too :-)
(11:32:04 AM) kirkland: but  you can also install to the vm's disk
(11:32:07 AM) kirkland: reboot the vm, etc.
(11:32:18 AM) kirkland: we use that for server testing all the time
(11:32:29 AM) kirkland: i'd say software wise, you should be able to test almost anything
(11:32:43 AM) kirkland: you know, the stuff people are going to complain about after release :-)
(11:32:57 AM) kirkland: its actually *really* easy to test it now, before release, in a vm
(11:33:11 AM) kirkland: <w1nGNUtz> kirkland: I thought testdrive was meant to test hardware, drivers and other stuff
(11:33:15 AM) kirkland: not really ....
(11:33:21 AM) kirkland: are you thinking of checkbox?
(11:33:44 AM) kirkland: <tgalati4> QUESTION: When updating a testdrive snapshot, is the entire distro downloaded or diff files?
(11:33:57 AM) kirkland: testdrive tries its best to download incrementally
(11:34:14 AM) kirkland: if the url is a rsync:// url (all of the ones in the default menu are), it uses rsync against the iso
(11:34:32 AM) kirkland: which can really improve your download by incrementally downloading the parts of the iso that have changed
(11:34:41 AM) kirkland: if you use http or ftp, it tries to use zsync
(11:34:48 AM) kirkland: which requires a zsync file on the server end
(11:34:57 AM) kirkland: ubuntu images are typically published with a zsync file
(11:35:07 AM) kirkland: but if you're pulling images from else, they may or may not be there
(11:35:29 AM) kirkland: <w1nGNUtz> kirkland: as a programmer i thought it would have some automated tests included in testdrive, like in grid computing, use users' computing power to run more tests quickier.. I didn't realize it would be used to test virtually anything.
(11:35:38 AM) kirkland: possibly a flaw in the naming of the package ...
(11:35:53 AM) kirkland: it's really meant as an easy way to "take the next ubuntu release out for a test drive"
(11:36:16 AM) kirkland: in the same way you might roll up to the chevy dealership and ask to take the new Corvette out for a spin ;-)
(11:36:47 AM) kirkland: so from a development perspective, i often use testdrive for a pristine environment
(11:36:57 AM) kirkland: of course there are other ways of doing this
(11:37:00 AM) kirkland: chroots, etc.
(11:37:12 AM) kirkland: but for various reasons, a VM can be advantageous
(11:37:20 AM) kirkland: it more closely mimics the end user's environment
(11:37:39 AM) kirkland: <yellabelly24> QUESTION: How much KVM do we need to know? Can you recommend a quick start guide for KVM?
(11:37:55 AM) kirkland: to use testdrive?  none at all, hopefully
(11:38:09 AM) kirkland: that's the goal of testdrive, to mask the creation and tear down of the VM from you entirely
(11:38:27 AM) kirkland: you just tell testdrive where your target ISO is, and it puts that into a VM for you to play with
(11:38:40 AM) kirkland: if you want to learn about KVM, well that's a different story
(11:38:41 AM) kirkland: :-)
(11:39:01 AM) kirkland: https://help.ubuntu.com/community/KVM
(11:39:07 AM) kirkland: that's as good of a starter as anywhere
(11:39:15 AM) kirkland: http://manpages.ubuntu.com/manpages/lucid/en/man1/kvm.1.html
(11:39:23 AM) kirkland: manpages are good too
(11:39:34 AM) kirkland: but, for instance ...
(11:39:41 AM) kirkland: i'm testdriving an iso right now
(11:39:46 AM) kirkland: ps -ef | grep kvm
(11:40:03 AM) kirkland: kirkland 31434 31433 78 10:38 pts/11   00:00:54 kvm -m 1024 -cdrom /home/kirkland/.cache/testdrive/iso/lucid-desktop-amd64.iso -drive file=/home/kirkland/.cache/testdrive/img/testdrive-disk-Aw769k.img,if=virtio,index=0,boot=on -usb -usbdevice tablet -net nic,model=virtio -net user -soundhw es1370
(11:40:19 AM) kirkland: if you know the kvm magic, you could easily construct that line yourself
(11:40:27 AM) kirkland: -m 1024 -> give the vm a gig of memory
(11:40:36 AM) kirkland: -cdrom is the path to the locally cachced iso image
(11:40:48 AM) kirkland: -drive ...virtio... loads a virtio disk
(11:40:53 AM) kirkland: which is really fast, by the way
(11:40:58 AM) kirkland: this is a sparse qcow2 image
(11:41:04 AM) kirkland: created by kvm-img create -f qcow2
(11:41:09 AM) kirkland: which testdrive also did for you
(11:41:29 AM) kirkland: -usbdevice tablet improves the mouse experience, letting you move in and out of the window a bit better
(11:41:35 AM) kirkland: virtio networking
(11:41:42 AM) kirkland: and a sound card, so that you can hear the vm's sound
(11:41:57 AM) kirkland: there's similar work done for virtualbox too
(11:42:01 AM) kirkland: makes the experience similar
(11:42:18 AM) kirkland: <enli_> QUESTION: When somebody has installed with Testdrive to virtual HDD and there is a new image available. So is that possible to extract the image and place binaries at their respective locations without going through the whole setup thing again? (probably stupid but sounds good to me)
(11:42:52 AM) kirkland: hmm, it would be much better to just boot the existing installed virtual HDD and sudo apt-get dist-upgrade ;-)
(11:43:12 AM) kirkland: <tgalati4> QUESTION: Can testdrive be used for testing/benchmarking server edition and server applications?
(11:43:17 AM) kirkland: absolutely!
(11:43:21 AM) kirkland: well, testing
(11:43:28 AM) kirkland: benchmarking is a little tougher in a vm
(11:43:36 AM) kirkland: though it can be done, with certain caveats
(11:44:09 AM) kirkland: <tgalati4> QUESTION: For instance, if I want to test apps from Hardy to Lucid?
(11:44:13 AM) kirkland: well, a couple of things ...
(11:44:23 AM) kirkland: you could start by testdriving a Hardy server iso
(11:44:35 AM) kirkland: install to the virtual hard disk, add your apps
(11:44:43 AM) kirkland: verify that they install there
(11:44:50 AM) kirkland: then live upgrade from Hardy -> Lucid in the vm
(11:44:59 AM) kirkland: (that'll take a while, depending on your bandwidth)
(11:45:13 AM) kirkland: then see if your apps are still working as they were in Hardy
(11:45:21 AM) kirkland: oh, and you could save your hardy image off to the side
(11:45:25 AM) kirkland: or use qemu snapshot
(11:45:35 AM) kirkland: so that you can roll back and forth
(11:46:15 AM) kirkland: <tgalati4> Almost like cloud computing.
(11:46:21 AM) kirkland: well, similar, i suppose
(11:46:29 AM) kirkland: in that cloud computing builds on virtualization
(11:46:40 AM) w1nGNUtz is now known as w1ngnutt
(11:46:46 AM) kirkland: Ubuntu Enterprise Cloud is really just a collection of KVM vm's
(11:46:54 AM) kirkland: (and a lot of management software that makes that work)
(11:47:01 AM) w1ngnutt is now known as w1ngnut
(11:47:03 AM) kirkland: stuff much more complicated than testdrive, I assure you ;-)
(11:47:06 AM) kirkland: and it's good for that
(11:47:36 AM) kirkland: so you can branch the testdrive source code very easily
(11:47:41 AM) kirkland: bzr branch lp:testdrive
(11:47:49 AM) kirkland: it's just a relatively simple python script
(11:48:08 AM) kirkland: you're welcome to hack on it, submit bugs, and branches and patches :-)
(11:48:12 AM) kirkland: scratch your itch
(11:48:25 AM) kirkland: or model your own project on bits and pieces of testdrive if you like
(11:48:34 AM) kirkland: <yellabelly24> QUESTION: Can you save state in a snapshot? (like a suspend/hibernate)
(11:48:39 AM) kirkland: you sure can!
(11:48:42 AM) kirkland: here's how ...
(11:48:47 AM) kirkland: if you're running a kvm
(11:49:04 AM) kirkland: click inside of it
(11:49:08 AM) kirkland: and press
(11:49:11 AM) kirkland: ctrl-alt-2
(11:49:33 AM) kirkland: this will put you into the qemu monitor
(11:49:42 AM) kirkland: it's like a little shell running below the vm
(11:49:47 AM) kirkland: you can talk to the hypervisor here
(11:50:04 AM) kirkland: in there, type:
(11:50:19 AM) kirkland: savevm /tmp/path_to_snapshot.img
(11:50:27 AM) w1ngnut is now known as w1ngnutt
(11:50:32 AM) kirkland: this will take a few minutes to complete
(11:50:47 AM) kirkland: well, depending on the size of your memory and delta from the last state
(11:51:48 AM) kirkland: <tgalati4> QUESTION: I want to experiment with XEN VM on one of my machines.  Will testdrive work with XEN?
(11:51:52 AM) kirkland: not currently
(11:52:00 AM) kirkland: no plans to do so (by me)
(11:52:08 AM) kirkland: good patches accepted :-)
(11:52:26 AM) kirkland: <quappa1> QUESTION: (not a question) you should also advertise Testdrive to developers as a way to test their apps on OLDER releases which many end users use :)
(11:52:29 AM) kirkland: thanks
(11:53:33 AM) kirkland: guys, i think that's about all from me
(11:53:43 AM) kirkland: scratch your itch ;-)

MeetingLogs/OpWeek1003/TestDrive (last edited 2010-03-05 19:26:12 by pool-71-182-100-128)