+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+ <head>
+ <title>Petter Reinholdtsen: Automatic upgrade testing from Lenny to Squeeze</title>
+ <link rel="stylesheet" type="text/css" media="screen" href="http://people.skolelinux.org/pere/blog/style.css">
+ </head>
+ <body>
+
+ <div class="title">
+ <h1>
+ <a href="http://people.skolelinux.org/pere/blog/">Petter Reinholdtsen</a>
+
+ </h1>
+
+ </div>
+
+
+ <div class="entry">
+ <div class="title">Automatic upgrade testing from Lenny to Squeeze</div>
+ <div class="date">2010-06-11 22:50</div>
+ <div class="body">
+<p>The last few days I have done some upgrade testing in Debian, to
+see if the upgrade from Lenny to Squeeze will go smoothly. A few bugs
+have been discovered and reported in the process
+(<a href="http://bugs.debian.org/585410">#585410</a> in nagios3-cgi,
+<a href="http://bugs.debian.org/584879">#584879</a> already fixed in
+enscript and <a href="http://bugs.debian.org/584861">#584861</a> in
+kdebase-workspace-data), and to get a more regular testing going on, I
+am working on a script to automate the test.</p>
+
+<p>The idea is to create a Lenny chroot and use tasksel to install a
+Gnome or KDE desktop installation inside the chroot before upgrading
+it. To ensure no services are started in the chroot, a policy-rc.d
+script is inserted. To make sure tasksel believe it to install a
+desktop on a laptop, the tasksel tests are replaced in the chroot
+(only acceptable because this is a throw-away chroot).</p>
+
+<p>A naive upgrade from Lenny to Squeeze using aptitude dist-upgrade
+currently always fail because udev refuses to upgrade with the kernel
+in Lenny, so to avoid that problem the file /etc/udev/kernel-upgrade
+is created. The bug report
+<a href="http://bugs.debian.org/566000">#566000</a> make me suspect
+this problem do not trigger in a chroot, but I touch the file anyway
+to make sure the upgrade go well. Testing on virtual and real
+hardware have failed me because of udev so far, and creating this file
+do the trick in such settings anyway. This is a
+<a href="http://www.linuxquestions.org/questions/debian-26/failed-dist-upgrade-due-to-udev-config_sysfs_deprecated-nonsense-804130/">known
+issue</a> and the current udev behaviour is intended by the udev
+maintainer because he lack the resources to rewrite udev to keep
+working with old kernels or something like that. I really wish the
+udev upstream would keep udev backwards compatible, to avoid such
+upgrade problem, but given that they fail to do so, I guess
+documenting the way out of this mess is the best option we got for
+Debian Squeeze.</p>
+
+<p>Anyway, back to the task at hand, testing upgrades. This test
+script, which I call <tt>upgrade-test</tt> for now, is doing the
+trick:</p>
+
+<blockquote><pre>
+#!/bin/sh
+set -ex
+
+if [ "$1" ] ; then
+ desktop=$1
+else
+ desktop=gnome
+fi
+
+from=lenny
+to=squeeze
+
+exec < /dev/null
+unset LANG
+mirror=http://ftp.skolelinux.org/debian
+tmpdir=chroot-$from-upgrade-$to-$desktop
+fuser -mv .
+debootstrap $from $tmpdir $mirror
+chroot $tmpdir aptitude update
+cat > $tmpdir/usr/sbin/policy-rc.d <<EOF
+#!/bin/sh
+exit 101
+EOF
+chmod a+rx $tmpdir/usr/sbin/policy-rc.d
+exit_cleanup() {
+ umount $tmpdir/proc
+}
+mount -t proc proc $tmpdir/proc
+# Make sure proc is unmounted also on failure
+trap exit_cleanup EXIT INT
+
+chroot $tmpdir aptitude -y install debconf-utils
+
+# Make sure tasksel autoselection trigger. It need the test scripts
+# to return the correct answers.
+echo tasksel tasksel/desktop multiselect $desktop | \
+ chroot $tmpdir debconf-set-selections
+
+# Include the desktop and laptop task
+for test in desktop laptop ; do
+ echo > $tmpdir/usr/lib/tasksel/tests/$test <<EOF
+#!/bin/sh
+exit 2
+EOF
+ chmod a+rx $tmpdir/usr/lib/tasksel/tests/$test
+done
+
+DEBIAN_FRONTEND=noninteractive
+DEBIAN_PRIORITY=critical
+export DEBIAN_FRONTEND DEBIAN_PRIORITY
+chroot $tmpdir tasksel --new-install
+
+echo deb $mirror $to main > $tmpdir/etc/apt/sources.list
+chroot $tmpdir aptitude update
+touch $tmpdir/etc/udev/kernel-upgrade
+chroot $tmpdir aptitude -y dist-upgrade
+fuser -mv
+</pre></blockquote>
+
+<p>I suspect it would be useful to test upgrades with both apt-get and
+with aptitude, but I have not had time to look at how they behave
+differently so far. I hope to get a cron job running to do the test
+regularly and post the result on the web. The Gnome upgrade currently
+work, while the KDE upgrade fail because of the bug in
+kdebase-workspace-data</p>
+
+<p>I am not quite sure what kind of extract from the huge upgrade logs
+(KDE 167 KiB, Gnome 516 KiB) it make sense to include in this blog
+post, so I will refrain from trying. I can report that for Gnome,
+aptitude report 760 packages upgraded, 448 newly installed, 129 to
+remove and 1 not upgraded and 1024MB need to be downloaded while for
+KDE the same numbers are 702 packages upgraded, 507 newly installed,
+193 to remove and 0 not upgraded and 1117MB need to be downloaded</p>
+
+<p>I am very happy to notice that the Gnome desktop + laptop upgrade
+is able to migrate to dependency based boot sequencing and parallel
+booting without a hitch. Was unsure if there were still bugs with
+packages failing to clean up their obsolete init.d script during
+upgrades, and no such problem seem to affect the Gnome desktop+laptop
+packages.</p>
+</div>
+
+ <div class="tags">Tags: <a href="http://people.skolelinux.org/pere/blog/tags/debian">debian</a>, <a href="http://people.skolelinux.org/pere/blog/tags/debian edu">debian edu</a>, <a href="http://people.skolelinux.org/pere/blog/tags/english">english</a>.</div>
+
+ </div>
+
+
+
+
+
+
+<div id="sidebar">
+
+<h2>Archive</h2>
+<ul>
+
+<li>2010
+<ul>
+
+<li><a href="http://people.skolelinux.org/pere/blog/archive/2010/01/">January (2)</a></li>
+
+<li><a href="http://people.skolelinux.org/pere/blog/archive/2010/02/">February (1)</a></li>
+
+<li><a href="http://people.skolelinux.org/pere/blog/archive/2010/03/">March (3)</a></li>
+
+<li><a href="http://people.skolelinux.org/pere/blog/archive/2010/04/">April (3)</a></li>
+
+<li><a href="http://people.skolelinux.org/pere/blog/archive/2010/05/">May (9)</a></li>
+
+<li><a href="http://people.skolelinux.org/pere/blog/archive/2010/06/">June (7)</a></li>
+
+</ul></li>
+
+<li>2009
+<ul>
+
+<li><a href="http://people.skolelinux.org/pere/blog/archive/2009/01/">January (8)</a></li>
+
+<li><a href="http://people.skolelinux.org/pere/blog/archive/2009/02/">February (8)</a></li>
+
+<li><a href="http://people.skolelinux.org/pere/blog/archive/2009/03/">March (12)</a></li>
+
+<li><a href="http://people.skolelinux.org/pere/blog/archive/2009/04/">April (10)</a></li>
+
+<li><a href="http://people.skolelinux.org/pere/blog/archive/2009/05/">May (9)</a></li>
+
+<li><a href="http://people.skolelinux.org/pere/blog/archive/2009/06/">June (3)</a></li>
+
+<li><a href="http://people.skolelinux.org/pere/blog/archive/2009/07/">July (4)</a></li>
+
+<li><a href="http://people.skolelinux.org/pere/blog/archive/2009/08/">August (3)</a></li>
+
+<li><a href="http://people.skolelinux.org/pere/blog/archive/2009/09/">September (1)</a></li>
+
+<li><a href="http://people.skolelinux.org/pere/blog/archive/2009/10/">October (2)</a></li>
+
+<li><a href="http://people.skolelinux.org/pere/blog/archive/2009/11/">November (3)</a></li>
+
+<li><a href="http://people.skolelinux.org/pere/blog/archive/2009/12/">December (3)</a></li>
+
+</ul></li>
+
+<li>2008
+<ul>
+
+<li><a href="http://people.skolelinux.org/pere/blog/archive/2008/11/">November (5)</a></li>
+
+<li><a href="http://people.skolelinux.org/pere/blog/archive/2008/12/">December (7)</a></li>
+
+</ul></li>
+
+</ul>
+
+
+
+<h2>Tags</h2>
+<ul>
+
+ <li><a href="http://people.skolelinux.org/pere/blog/tags/3d-printer">3d-printer (11)</a></li>
+
+ <li><a href="http://people.skolelinux.org/pere/blog/tags/amiga">amiga (1)</a></li>
+
+ <li><a href="http://people.skolelinux.org/pere/blog/tags/aros">aros (1)</a></li>
+
+ <li><a href="http://people.skolelinux.org/pere/blog/tags/bootsystem">bootsystem (4)</a></li>
+
+ <li><a href="http://people.skolelinux.org/pere/blog/tags/debian">debian (25)</a></li>
+
+ <li><a href="http://people.skolelinux.org/pere/blog/tags/debian edu">debian edu (25)</a></li>
+
+ <li><a href="http://people.skolelinux.org/pere/blog/tags/english">english (36)</a></li>
+
+ <li><a href="http://people.skolelinux.org/pere/blog/tags/fiksgatami">fiksgatami (1)</a></li>
+
+ <li><a href="http://people.skolelinux.org/pere/blog/tags/fildeling">fildeling (6)</a></li>
+
+ <li><a href="http://people.skolelinux.org/pere/blog/tags/kart">kart (2)</a></li>
+
+ <li><a href="http://people.skolelinux.org/pere/blog/tags/lenker">lenker (1)</a></li>
+
+ <li><a href="http://people.skolelinux.org/pere/blog/tags/ltsp">ltsp (1)</a></li>
+
+ <li><a href="http://people.skolelinux.org/pere/blog/tags/multimedia">multimedia (5)</a></li>
+
+ <li><a href="http://people.skolelinux.org/pere/blog/tags/norsk">norsk (67)</a></li>
+
+ <li><a href="http://people.skolelinux.org/pere/blog/tags/nuug">nuug (75)</a></li>
+
+ <li><a href="http://people.skolelinux.org/pere/blog/tags/opphavsrett">opphavsrett (12)</a></li>
+
+ <li><a href="http://people.skolelinux.org/pere/blog/tags/personvern">personvern (11)</a></li>
+
+ <li><a href="http://people.skolelinux.org/pere/blog/tags/reprap">reprap (10)</a></li>
+
+ <li><a href="http://people.skolelinux.org/pere/blog/tags/rss">rss (1)</a></li>
+
+ <li><a href="http://people.skolelinux.org/pere/blog/tags/sikkerhet">sikkerhet (8)</a></li>
+
+ <li><a href="http://people.skolelinux.org/pere/blog/tags/sitesummary">sitesummary (3)</a></li>
+
+ <li><a href="http://people.skolelinux.org/pere/blog/tags/standard">standard (12)</a></li>
+
+ <li><a href="http://people.skolelinux.org/pere/blog/tags/stavekontroll">stavekontroll (1)</a></li>
+
+ <li><a href="http://people.skolelinux.org/pere/blog/tags/video">video (10)</a></li>
+
+ <li><a href="http://people.skolelinux.org/pere/blog/tags/vitenskap">vitenskap (1)</a></li>
+
+ <li><a href="http://people.skolelinux.org/pere/blog/tags/web">web (6)</a></li>
+
+</ul>
+
+</div>
+ </body>
+</html>