** Description changed:

  [ Impact ]
  
  The jc package for Noble currently fails to build from source or fails its
  internal test suite because of a behavior change backported into Python 3.12's
  standard library (ipaddress module) for 6to4 addresses [0].
  
  The fix backports two upstream commits [1][2] to evaluate the test output
  flexibly against both old-style and new-style variants. This SRU is needed to
  fix unit tests for the original bug (LP: #2153146).
  
  [ Test Plan ]
  
- 1. On an Ubuntu Noble system, fetch the source code and run the test suite:
+ The test can be performed in a standard Ubuntu Noble environment.
+ 
+ ** Set Up Testing Environment **
+ 
+ 1. Get the jc source and set up a virtual environment:
     $ pull-lp-source jc noble
     $ cd jc-1.25.1/
-    $ pytest3
+    $ python3 -m venv .venv
+    $ source .venv/bin/activate
  
- 2. Observe the failure trace:
- AssertionError: {'ver[768 chars]te': True, 'is_global': False, 
'is_link_local'[1797 chars]10'}} != {'ver[768 chars]te': False, 'is_global': 
True, 'is_link_local'[1797 chars]10'}}
- tests/test_ip_address.py:102: AssertionError
+ ** Verify the Bug **
+ 
+ 2. Install requirements and run the test suite:
+    $ pip install -r requirements.txt
+    $ ./runtests.sh
+ 
+ 3. Confirm the failure:
+    FAIL: test_ip_address_ipv6_6to4 
(tests.test_ip_address.MyTests.test_ip_address_ipv6_6to4)
+    Test ipv6 6to4 address string
+    ----------------------------------------------------------------------
+    Traceback (most recent call last):
+      File 
"/home/[email protected]/munir/canonical/cases/jc-00438145/test/jc-1.25.1/tests/test_ip_address.py",
 line 102, in test_ip_address_ipv6_6to4
+        self.assertEqual(jc.parsers.ip_address.parse(data, quiet=True), 
expected)
+    AssertionError: {'ver[768 chars]te': True, 'is_global': False, 
'is_link_local'[1797 chars]10'}} != {'ver[768 chars]te': False, 'is_global': 
True, 'is_link_local'[1797 chars]10'}}
+  
+ ** Verify the Fix **
+ 
+ 4. Get the source for the patched version of jc:
+    $ cd jc-1.25.1/
+ 
+ 5. Re-run tests:
+    $ ./runtests.sh
+ 
+ 6. Confirm the fix:
+    Verify the terminal output displays no errors observed
  
  [ Where Problems Could Occur ]
  
  The fix modifies the test suite framework logic via a try/except handler to
  dynamically pass whether the system's underlying Python interpreter presents
  the legacy or modernized IPv6 structural schema block. If the new test logic 
is
  flawed, it might fail to catch a real IPv6 regression during future package
  updates or builds.
  
  [ Other Info ]
  
  The fix for this bug will be bundled with the fix for LP: #2153146 into a
  single package upload. The debdiff will be uploaded and attached to the main
  bug report.
  
  Since the change was introduced in Python 3.13 and backported to 3.12, Jammy 
is
  not affected by this bug as it ships with Python 3.10.
  
  Packages in Questing and later releases already have the fix.
  
  [0] - 
https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv4Address.is_private
  [1] - 
https://github.com/kellyjonbrazil/jc/commit/9eb4df34b190c57d020b70153ef3faa8984c02ca
  [2] - 
https://github.com/kellyjonbrazil/jc/commit/5c855e40c6cb9432b630cdf22f20ccf3285b24d7

** Changed in: jc (Ubuntu)
       Status: In Progress => Fix Released

** Changed in: jc (Ubuntu)
     Assignee: Munir Siddiqui (munirsid) => (unassigned)

** Description changed:

  [ Impact ]
  
  The jc package for Noble currently fails to build from source or fails its
  internal test suite because of a behavior change backported into Python 3.12's
  standard library (ipaddress module) for 6to4 addresses [0].
  
  The fix backports two upstream commits [1][2] to evaluate the test output
  flexibly against both old-style and new-style variants. This SRU is needed to
  fix unit tests for the original bug (LP: #2153146).
  
  [ Test Plan ]
  
  The test can be performed in a standard Ubuntu Noble environment.
  
  ** Set Up Testing Environment **
  
  1. Get the jc source and set up a virtual environment:
-    $ pull-lp-source jc noble
-    $ cd jc-1.25.1/
-    $ python3 -m venv .venv
-    $ source .venv/bin/activate
+    $ pull-lp-source jc noble
+    $ cd jc-1.25.1/
+    $ python3 -m venv .venv
+    $ source .venv/bin/activate
  
  ** Verify the Bug **
  
  2. Install requirements and run the test suite:
-    $ pip install -r requirements.txt
-    $ ./runtests.sh
+    $ pip install -r requirements.txt
+    $ ./runtests.sh
  
  3. Confirm the failure:
-    FAIL: test_ip_address_ipv6_6to4 
(tests.test_ip_address.MyTests.test_ip_address_ipv6_6to4)
-    Test ipv6 6to4 address string
-    ----------------------------------------------------------------------
-    Traceback (most recent call last):
-      File 
"/home/[email protected]/munir/canonical/cases/jc-00438145/test/jc-1.25.1/tests/test_ip_address.py",
 line 102, in test_ip_address_ipv6_6to4
-        self.assertEqual(jc.parsers.ip_address.parse(data, quiet=True), 
expected)
-    AssertionError: {'ver[768 chars]te': True, 'is_global': False, 
'is_link_local'[1797 chars]10'}} != {'ver[768 chars]te': False, 'is_global': 
True, 'is_link_local'[1797 chars]10'}}
-  
+    FAIL: test_ip_address_ipv6_6to4 
(tests.test_ip_address.MyTests.test_ip_address_ipv6_6to4)
+    Test ipv6 6to4 address string
+    ----------------------------------------------------------------------
+    Traceback (most recent call last):
+      File 
"/home/[email protected]/munir/canonical/cases/jc-00438145/test/jc-1.25.1/tests/test_ip_address.py",
 line 102, in test_ip_address_ipv6_6to4
+        self.assertEqual(jc.parsers.ip_address.parse(data, quiet=True), 
expected)
+    AssertionError: {'ver[768 chars]te': True, 'is_global': False, 
'is_link_local'[1797 chars]10'}} != {'ver[768 chars]te': False, 'is_global': 
True, 'is_link_local'[1797 chars]10'}}
+ 
  ** Verify the Fix **
  
  4. Get the source for the patched version of jc:
-    $ cd jc-1.25.1/
+    $ cd jc-1.25.1/
  
  5. Re-run tests:
-    $ ./runtests.sh
+    $ ./runtests.sh
  
  6. Confirm the fix:
-    Verify the terminal output displays no errors observed
+    Verify the terminal output displays no errors observed
  
  [ Where Problems Could Occur ]
  
  The fix modifies the test suite framework logic via a try/except handler to
  dynamically pass whether the system's underlying Python interpreter presents
  the legacy or modernized IPv6 structural schema block. If the new test logic 
is
  flawed, it might fail to catch a real IPv6 regression during future package
  updates or builds.
  
  [ Other Info ]
  
  The fix for this bug will be bundled with the fix for LP: #2153146 into a
  single package upload. The debdiff will be uploaded and attached to the main
- bug report.
+ bug report in LP: #2153146.
  
  Since the change was introduced in Python 3.13 and backported to 3.12, Jammy 
is
  not affected by this bug as it ships with Python 3.10.
  
  Packages in Questing and later releases already have the fix.
  
  [0] - 
https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv4Address.is_private
  [1] - 
https://github.com/kellyjonbrazil/jc/commit/9eb4df34b190c57d020b70153ef3faa8984c02ca
  [2] - 
https://github.com/kellyjonbrazil/jc/commit/5c855e40c6cb9432b630cdf22f20ccf3285b24d7

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2153428

Title:
  test_ip_address_ipv6_6to4 fails due to Python 3.12 ipaddress module
  behavior change

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/jc/+bug/2153428/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to