Package: pyparted
Severity: normal
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu mantic ubuntu-patch

Dear Maintainer,

Running the pyparted test-suite against parted 3.6 leads to the
following exception:

  399s ======================================================================
  399s FAIL: runTest (tests.test__ped_disktype.DiskTypeStrTestCase.runTest)
  399s ----------------------------------------------------------------------
  399s Traceback (most recent call last):
  399s File 
"/tmp/autopkgtest.kQxzZO/build.bFs/src/tests/test__ped_disktype.py", line 78, 
in runTest
  399s self.assertEqual(str(self.disktype['msdos']), '_ped.DiskType instance 
--\n name: msdos features: 1')
  399s AssertionError: '_ped.DiskType instance --\n name: msdos features: 5' != 
'_ped.DiskType instance --\n name: msdos features: 1'
  399s _ped.DiskType instance --
  399s - name: msdos features: 5? ^
  399s + name: msdos features: 1? ^

The failure is visible in the following autopkgtest report.

https://ci.debian.net/data/autopkgtest/unstable/amd64/p/pyparted/34699773/log.gz

A patch exists upstream: https://github.com/dcantrell/pyparted/pull/100

In Ubuntu, the attached patch was applied to achieve the following:

  * Apply upstream patch to fix test-suite against parted 3.6 (LP: #2024678)

Thanks for considering the patch.


-- System Information:
Debian Release: bookworm/sid
  APT prefers lunar-updates
  APT policy: (500, 'lunar-updates'), (500, 'lunar-security'), (500, 'lunar'), 
(100, 'lunar-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.1.0-16-generic (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
diff -Nru 
pyparted-3.12.0/debian/patches/0001-tests-Remove-feature-values-from-DiskTypeStrTestCase.patch
 
pyparted-3.12.0/debian/patches/0001-tests-Remove-feature-values-from-DiskTypeStrTestCase.patch
--- 
pyparted-3.12.0/debian/patches/0001-tests-Remove-feature-values-from-DiskTypeStrTestCase.patch
      1970-01-01 01:00:00.000000000 +0100
+++ 
pyparted-3.12.0/debian/patches/0001-tests-Remove-feature-values-from-DiskTypeStrTestCase.patch
      2023-06-22 18:08:47.000000000 +0200
@@ -0,0 +1,43 @@
+Description: tests: Remove feature values from DiskTypeStrTestCase
+ These inevitably cause pyparted to fail when built against a new version
+ of parted. They don't provide any additional validation, other tests
+ already check for the expected features.
+Author: "Brian C. Lane" <b...@redhat.com>
+Origin: upstream, https://github.com/dcantrell/pyparted/pull/100
+Bug-Ubuntu: https://launchpad.net/bugs/2024678
+Last-Update: 2023-06-22
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: pyparted-3.12.0/tests/test__ped_disktype.py
+===================================================================
+--- pyparted-3.12.0.orig/tests/test__ped_disktype.py   2023-06-22 
18:02:36.965289725 +0200
++++ pyparted-3.12.0/tests/test__ped_disktype.py        2023-06-22 
18:05:14.716398913 +0200
+@@ -75,13 +75,18 @@
+ 
+ class DiskTypeStrTestCase(RequiresDiskTypes):
+     def runTest(self):
+-        self.assertEqual(str(self.disktype['msdos']), '_ped.DiskType instance 
--\n  name: msdos  features: 1')
+-        self.assertEqual(str(self.disktype['aix']), '_ped.DiskType instance 
--\n  name: aix  features: 0')
+-        self.assertEqual(str(self.disktype['sun']), '_ped.DiskType instance 
--\n  name: sun  features: 0')
+-        self.assertEqual(str(self.disktype['amiga']), '_ped.DiskType instance 
--\n  name: amiga  features: 2')
+-        self.assertEqual(str(self.disktype['gpt']), '_ped.DiskType instance 
--\n  name: gpt  features: 2')
+-        self.assertEqual(str(self.disktype['mac']), '_ped.DiskType instance 
--\n  name: mac  features: 2')
+-        self.assertEqual(str(self.disktype['bsd']), '_ped.DiskType instance 
--\n  name: bsd  features: 0')
+-        self.assertEqual(str(self.disktype['pc98']), '_ped.DiskType instance 
--\n  name: pc98  features: 2')
+-        self.assertEqual(str(self.disktype['loop']), '_ped.DiskType instance 
--\n  name: loop  features: 0')
+-        self.assertEqual(str(self.disktype['dvh']), '_ped.DiskType instance 
--\n  name: dvh  features: 3')
++        types = {
++            "msdos": '_ped.DiskType instance --\n  name: msdos  features:',
++            'aix':   '_ped.DiskType instance --\n  name: aix  features: ',
++            'sun':   '_ped.DiskType instance --\n  name: sun  features: ',
++            'amiga': '_ped.DiskType instance --\n  name: amiga  features: ',
++            'gpt':   '_ped.DiskType instance --\n  name: gpt  features: ',
++            'mac':   '_ped.DiskType instance --\n  name: mac  features: ',
++            'bsd':   '_ped.DiskType instance --\n  name: bsd  features: ',
++            'pc98':  '_ped.DiskType instance --\n  name: pc98  features: ',
++            'loop':  '_ped.DiskType instance --\n  name: loop  features: ',
++            'dvh':   '_ped.DiskType instance --\n  name: dvh  features: ',
++        }
++
++        for t, expected in types.items():
++            self.assertIn(expected, str(self.disktype[t]))
diff -Nru pyparted-3.12.0/debian/patches/series 
pyparted-3.12.0/debian/patches/series
--- pyparted-3.12.0/debian/patches/series       2023-03-03 19:56:44.000000000 
+0100
+++ pyparted-3.12.0/debian/patches/series       2023-06-22 18:02:15.000000000 
+0200
@@ -1,2 +1,3 @@
 skip_0gt0.patch
 skip_for_deb_ci.patch
+0001-tests-Remove-feature-values-from-DiskTypeStrTestCase.patch

Reply via email to