1 <!DOCTYPE html PUBLIC 
"-//W3C//DTD XHTML 1.0 Strict//EN" 
   2         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
   5   <title>Petter Reinholdtsen: Automatic upgrade testing from Lenny to Squeeze
</title> 
   6   <link rel=
"stylesheet" type=
"text/css" media=
"screen" href=
"http://people.skolelinux.org/pere/blog/style.css"> 
  12        <a href=
"http://people.skolelinux.org/pere/blog/">Petter Reinholdtsen
</a> 
  20   <div class=
"title">Automatic upgrade testing from Lenny to Squeeze
</div> 
  21   <div class=
"date">2010-
06-
11 22:
50</div> 
  23 <p>The last few days I have done some upgrade testing in Debian, to
 
  24 see if the upgrade from Lenny to Squeeze will go smoothly.  A few bugs
 
  25 have been discovered and reported in the process
 
  26 (
<a href=
"http://bugs.debian.org/585410">#
585410</a> in nagios3-cgi,
 
  27 <a href=
"http://bugs.debian.org/584879">#
584879</a> already fixed in
 
  28 enscript and 
<a href=
"http://bugs.debian.org/584861">#
584861</a> in
 
  29 kdebase-workspace-data), and to get a more regular testing going on, I
 
  30 am working on a script to automate the test.
</p> 
  32 <p>The idea is to create a Lenny chroot and use tasksel to install a
 
  33 Gnome or KDE desktop installation inside the chroot before upgrading
 
  34 it.  To ensure no services are started in the chroot, a policy-rc.d
 
  35 script is inserted.  To make sure tasksel believe it is to install a
 
  36 desktop on a laptop, the tasksel tests are replaced in the chroot
 
  37 (only acceptable because this is a throw-away chroot).
</p> 
  39 <p>A naive upgrade from Lenny to Squeeze using aptitude dist-upgrade
 
  40 currently always fail because udev refuses to upgrade with the kernel
 
  41 in Lenny, so to avoid that problem the file /etc/udev/kernel-upgrade
 
  42 is created.  The bug report
 
  43 <a href=
"http://bugs.debian.org/566000">#
566000</a> make me suspect
 
  44 this problem do not trigger in a chroot, but I touch the file anyway
 
  45 to make sure the upgrade go well.  Testing on virtual and real
 
  46 hardware have failed me because of udev so far, and creating this file
 
  47 do the trick in such settings anyway.  This is a
 
  48 <a href=
"http://www.linuxquestions.org/questions/debian-26/failed-dist-upgrade-due-to-udev-config_sysfs_deprecated-nonsense-804130/">known
 
  49 issue
</a> and the current udev behaviour is intended by the udev
 
  50 maintainer because he lack the resources to rewrite udev to keep
 
  51 working with old kernels or something like that.  I really wish the
 
  52 udev upstream would keep udev backwards compatible, to avoid such
 
  53 upgrade problem, but given that they fail to do so, I guess
 
  54 documenting the way out of this mess is the best option we got for
 
  57 <p>Anyway, back to the task at hand, testing upgrades.  This test
 
  58 script, which I call 
<tt>upgrade-test
</tt> for now, is doing the
 
  76 mirror=http://ftp.skolelinux.org/debian
 
  77 tmpdir=chroot-$from-upgrade-$to-$desktop
 
  79 debootstrap $from $tmpdir $mirror
 
  80 chroot $tmpdir aptitude update
 
  81 cat 
> $tmpdir/usr/sbin/policy-rc.d 
<<EOF
 
  85 chmod a+rx $tmpdir/usr/sbin/policy-rc.d
 
  89 mount -t proc proc $tmpdir/proc
 
  90 # Make sure proc is unmounted also on failure
 
  91 trap exit_cleanup EXIT INT
 
  93 chroot $tmpdir aptitude -y install debconf-utils
 
  95 # Make sure tasksel autoselection trigger.  It need the test scripts
 
  96 # to return the correct answers.
 
  97 echo tasksel tasksel/desktop multiselect $desktop | \
 
  98     chroot $tmpdir debconf-set-selections
 
 100 # Include the desktop and laptop task
 
 101 for test in desktop laptop ; do
 
 102     echo 
> $tmpdir/usr/lib/tasksel/tests/$test 
<<EOF
 
 106     chmod a+rx $tmpdir/usr/lib/tasksel/tests/$test
 
 109 DEBIAN_FRONTEND=noninteractive
 
 110 DEBIAN_PRIORITY=critical
 
 111 export DEBIAN_FRONTEND DEBIAN_PRIORITY
 
 112 chroot $tmpdir tasksel --new-install
 
 114 echo deb $mirror $to main 
> $tmpdir/etc/apt/sources.list
 
 115 chroot $tmpdir aptitude update
 
 116 touch $tmpdir/etc/udev/kernel-upgrade
 
 117 chroot $tmpdir aptitude -y dist-upgrade
 
 121 <p>I suspect it would be useful to test upgrades with both apt-get and
 
 122 with aptitude, but I have not had time to look at how they behave
 
 123 differently so far.  I hope to get a cron job running to do the test
 
 124 regularly and post the result on the web.  The Gnome upgrade currently
 
 125 work, while the KDE upgrade fail because of the bug in
 
 126 kdebase-workspace-data
</p> 
 128 <p>I am not quite sure what kind of extract from the huge upgrade logs
 
 129 (KDE 
167 KiB, Gnome 
516 KiB) it make sense to include in this blog
 
 130 post, so I will refrain from trying.  I can report that for Gnome,
 
 131 aptitude report 
760 packages upgraded, 
448 newly installed, 
129 to
 
 132 remove and 
1 not upgraded and 
1024MB need to be downloaded while for
 
 133 KDE the same numbers are 
702 packages upgraded, 
507 newly installed,
 
 134 193 to remove and 
0 not upgraded and 
1117MB need to be downloaded
</p> 
 136 <p>I am very happy to notice that the Gnome desktop + laptop upgrade
 
 137 is able to migrate to dependency based boot sequencing and parallel
 
 138 booting without a hitch.  Was unsure if there were still bugs with
 
 139 packages failing to clean up their obsolete init.d script during
 
 140 upgrades, and no such problem seem to affect the Gnome desktop+laptop
 
 144   <div class=
"tags">Tags: 
<a href=
"http://people.skolelinux.org/pere/blog/tags/bootsystem">bootsystem
</a>, 
<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> 
 161 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/01/">January (
2)
</a></li> 
 163 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/02/">February (
1)
</a></li> 
 165 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/03/">March (
3)
</a></li> 
 167 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/04/">April (
3)
</a></li> 
 169 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/05/">May (
9)
</a></li> 
 171 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/06/">June (
14)
</a></li> 
 173 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/07/">July (
12)
</a></li> 
 175 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/08/">August (
13)
</a></li> 
 177 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/09/">September (
7)
</a></li> 
 179 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/10/">October (
9)
</a></li> 
 181 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/11/">November (
13)
</a></li> 
 183 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/12/">December (
5)
</a></li> 
 190 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/01/">January (
8)
</a></li> 
 192 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/02/">February (
8)
</a></li> 
 194 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/03/">March (
12)
</a></li> 
 196 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/04/">April (
10)
</a></li> 
 198 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/05/">May (
9)
</a></li> 
 200 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/06/">June (
3)
</a></li> 
 202 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/07/">July (
4)
</a></li> 
 204 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/08/">August (
3)
</a></li> 
 206 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/09/">September (
1)
</a></li> 
 208 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/10/">October (
2)
</a></li> 
 210 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/11/">November (
3)
</a></li> 
 212 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/12/">December (
3)
</a></li> 
 219 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2008/11/">November (
5)
</a></li> 
 221 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2008/12/">December (
7)
</a></li> 
 232  <li><a href=
"http://people.skolelinux.org/pere/blog/tags/3d-printer">3d-printer (
13)
</a></li> 
 234  <li><a href=
"http://people.skolelinux.org/pere/blog/tags/amiga">amiga (
1)
</a></li> 
 236  <li><a href=
"http://people.skolelinux.org/pere/blog/tags/aros">aros (
1)
</a></li> 
 238  <li><a href=
"http://people.skolelinux.org/pere/blog/tags/bitcoin">bitcoin (
1)
</a></li> 
 240  <li><a href=
"http://people.skolelinux.org/pere/blog/tags/bootsystem">bootsystem (
10)
</a></li> 
 242  <li><a href=
"http://people.skolelinux.org/pere/blog/tags/debian">debian (
45)
</a></li> 
 244  <li><a href=
"http://people.skolelinux.org/pere/blog/tags/debian edu">debian edu (
53)
</a></li> 
 246  <li><a href=
"http://people.skolelinux.org/pere/blog/tags/english">english (
76)
</a></li> 
 248  <li><a href=
"http://people.skolelinux.org/pere/blog/tags/fiksgatami">fiksgatami (
1)
</a></li> 
 250  <li><a href=
"http://people.skolelinux.org/pere/blog/tags/fildeling">fildeling (
11)
</a></li> 
 252  <li><a href=
"http://people.skolelinux.org/pere/blog/tags/kart">kart (
5)
</a></li> 
 254  <li><a href=
"http://people.skolelinux.org/pere/blog/tags/ldap">ldap (
8)
</a></li> 
 256  <li><a href=
"http://people.skolelinux.org/pere/blog/tags/lenker">lenker (
4)
</a></li> 
 258  <li><a href=
"http://people.skolelinux.org/pere/blog/tags/ltsp">ltsp (
1)
</a></li> 
 260  <li><a href=
"http://people.skolelinux.org/pere/blog/tags/multimedia">multimedia (
11)
</a></li> 
 262  <li><a href=
"http://people.skolelinux.org/pere/blog/tags/norsk">norsk (
93)
</a></li> 
 264  <li><a href=
"http://people.skolelinux.org/pere/blog/tags/nuug">nuug (
114)
</a></li> 
 266  <li><a href=
"http://people.skolelinux.org/pere/blog/tags/opphavsrett">opphavsrett (
18)
</a></li> 
 268  <li><a href=
"http://people.skolelinux.org/pere/blog/tags/personvern">personvern (
29)
</a></li> 
 270  <li><a href=
"http://people.skolelinux.org/pere/blog/tags/reprap">reprap (
11)
</a></li> 
 272  <li><a href=
"http://people.skolelinux.org/pere/blog/tags/robot">robot (
4)
</a></li> 
 274  <li><a href=
"http://people.skolelinux.org/pere/blog/tags/rss">rss (
1)
</a></li> 
 276  <li><a href=
"http://people.skolelinux.org/pere/blog/tags/sikkerhet">sikkerhet (
21)
</a></li> 
 278  <li><a href=
"http://people.skolelinux.org/pere/blog/tags/sitesummary">sitesummary (
3)
</a></li> 
 280  <li><a href=
"http://people.skolelinux.org/pere/blog/tags/standard">standard (
16)
</a></li> 
 282  <li><a href=
"http://people.skolelinux.org/pere/blog/tags/stavekontroll">stavekontroll (
1)
</a></li> 
 284  <li><a href=
"http://people.skolelinux.org/pere/blog/tags/video">video (
16)
</a></li> 
 286  <li><a href=
"http://people.skolelinux.org/pere/blog/tags/vitenskap">vitenskap (
1)
</a></li> 
 288  <li><a href=
"http://people.skolelinux.org/pere/blog/tags/web">web (
14)
</a></li>