PatchTesting

Differences between revisions 5 and 6
Revision 5 as of 2009-03-12 20:27:47
Size: 3630
Editor: c-24-21-50-133
Comment:
Revision 6 as of 2009-03-13 17:01:58
Size: 3640
Editor: c-24-21-50-133
Comment:
Deletions are marked like this. Additions are marked like this.
Line 48: Line 48:
    {{{ dpkg -i iperf_2.0.4-3ubuntu1_amd64.deb }}}     {{{
   
dpkg -i iperf_2.0.4-3ubuntu1_amd64.deb
   
}}}

Once you've found a bug with a patch you can help out by testing that patch!

Recreating the bug report

The first step in testing a bug report with a patch is being able to recreate the original bug! This should ideally be done in the development release of Ubuntu and can be done in a virtual machine. The virtual machine could be a chroot, a kvm image or a VMware image.

1) Install the affected software 2) Recreate the bug following the test case

Building a patched package

After you've recreated the bug report its time to test the fix that's been included in the bug report!

1) get the source package for the affected software

  •  apt-get source iperf 

2) Download the patch from the bug report

  •  wget http://launchpadlibrarian.net/23018796/iperf-die-on-bind-fail.patch 

3) Apply the patch to the source package. The '-p' option tells patch how many / to strip from the patch file. In this case the first line of that patch looks like --- /tmp/iperf-2.0.4/src/Listener.cpp and I'm in a directory with an iperf-2.0.4 folder. (This was created by step 1). So for patch to be able to find the Listener.cpp file, which is being changed, I need to strip off the first 2 /. This is done via:

  •  patch -p2 < iperf-die-on-bind-fail.patch 

Each patch can different so you'll need to examine them carefully to find out how many / to strip.

The next step of testing the patch involve creating a new version of the package that you can install and test. This can either be done on your local build system or using a PPA.

4) Change directories into the source

  •  cd iperf-2.0.4 

5) We'll edit the debian changelog primarily to increment the package version number to something like iperf-2.0.4-3ubuntu1~ppa1

  •  dch -i 

6) Create files necessary for creating a new version of the package

  • a) local
    •  debuild -S -uc -us 

    b) PPA
    •  debuild -S -sd 

7) Upload to ppa or build locally

  • a) local
    •  sbuild -d jaunty iperf_2.0.4-3ubuntu1.dsc  or  sudo pbuilder build iperf_2.0.4-3ubuntu1.dsc 

    b) PPA
    •  dput my-ppa iperf_2.0.4-3ubuntu1\~ppa1_source.changes 

Testing the patched package

Now that we've created a new version of the package containing the patch we need to test it to ensure that it resolves the original bug report.

8) Enter the virtual machine and install the new version of the package

  • a) local
    •     dpkg -i iperf_2.0.4-3ubuntu1_amd64.deb
    b) PPA
    • update /etc/apt/sources.list

    • install PPA version of the package

9) Try to recreate the bug following the test case again

Bug report actions

Now that testing of the patch has been completed the bug report should be updated so that the patch can be acted on. If the patch fixed the bug tag:

  • add a comment indicating steps taken and results
  • tag the bug as patch-test-passed
  • set the status to Triaged
  • subscribe the relevant sponsors team to the bug report

If the patch did not fix the bug:

  • add a comment indicating steps taken and results
  • tag the bug as patch-test-failed
  • set the status to Incomplete

For bonus points you could add the patch the packages patch system and then prepare a debdiff, which you've nearly done already and add that to the bug report.

Bugs/PatchTesting (last edited 2009-03-17 15:42:41 by c-24-21-50-133)