]> pere.pagekite.me Git - homepage.git/blobdiff - blog/archive/2010/06/06.rss
Generated.
[homepage.git] / blog / archive / 2010 / 06 / 06.rss
index aadd4e6fc732bef036d5020c9ba284da625a52f3..0d217020852b7dece2dfa1cf23b14470c12e5c00 100644 (file)
@@ -246,5 +246,133 @@ minner.</p>
 </description>
        </item>
        
+       <item>
+               <title>Automatic upgrade testing from Lenny to Squeeze</title>
+               <link>http://people.skolelinux.org/pere/blog/Automatic_upgrade_testing_from_Lenny_to_Squeeze.html</link>        
+               <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Automatic_upgrade_testing_from_Lenny_to_Squeeze.html</guid>
+                <pubDate>Fri, 11 Jun 2010 22:50:00 +0200</pubDate>
+               <description>
+&lt;p&gt;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
+(&lt;a href=&quot;http://bugs.debian.org/585410&quot;&gt;#585410&lt;/a&gt; in nagios3-cgi,
+&lt;a href=&quot;http://bugs.debian.org/584879&quot;&gt;#584879&lt;/a&gt; already fixed in
+enscript and &lt;a href=&quot;http://bugs.debian.org/584861&quot;&gt;#584861&lt;/a&gt; in
+kdebase-workspace-data), and to get a more regular testing going on, I
+am working on a script to automate the test.&lt;/p&gt;
+
+&lt;p&gt;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).&lt;/p&gt;
+
+&lt;p&gt;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
+&lt;a href=&quot;http://bugs.debian.org/566000&quot;&gt;#566000&lt;/a&gt; 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
+&lt;a href=&quot;http://www.linuxquestions.org/questions/debian-26/failed-dist-upgrade-due-to-udev-config_sysfs_deprecated-nonsense-804130/&quot;&gt;known
+issue&lt;/a&gt; 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.&lt;/p&gt;
+
+&lt;p&gt;Anyway, back to the task at hand, testing upgrades.  This test
+script, which I call &lt;tt&gt;upgrade-test&lt;/tt&gt; for now, is doing the
+trick:&lt;/p&gt;
+
+&lt;blockquote&gt;&lt;pre&gt;
+#!/bin/sh
+set -ex
+
+if [ &quot;$1&quot; ] ; then
+    desktop=$1
+else
+    desktop=gnome
+fi
+
+from=lenny
+to=squeeze
+
+exec &amp;lt; /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 &gt; $tmpdir/usr/sbin/policy-rc.d &amp;lt;&amp;lt;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 &gt; $tmpdir/usr/lib/tasksel/tests/$test &amp;lt;&amp;lt;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 &gt; $tmpdir/etc/apt/sources.list
+chroot $tmpdir aptitude update
+touch $tmpdir/etc/udev/kernel-upgrade
+chroot $tmpdir aptitude -y dist-upgrade
+fuser -mv
+&lt;/pre&gt;&lt;/blockquote&gt;
+
+&lt;p&gt;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&lt;/p&gt;
+
+&lt;p&gt;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&lt;/p&gt;
+
+&lt;p&gt;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.&lt;/p&gt;
+</description>
+       </item>
+       
         </channel>
 </rss>