From efb609af596a78718df540b9ae3871734242213d Mon Sep 17 00:00:00 2001 From: Lumir Balhar Date: Tue, 7 Jul 2026 14:13:38 +0200 Subject: [PATCH] Fix tests: Update expected output for IPv4-mapped IPv6 addresses Resolves: RHEL-183548 --- python3.12-psycopg2.spec | 4 ++++ test_ipaddress-ipv4-mapped-ipv6-format.patch | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 test_ipaddress-ipv4-mapped-ipv6-format.patch diff --git a/python3.12-psycopg2.spec b/python3.12-psycopg2.spec index ffb24dc..1f56197 100644 --- a/python3.12-psycopg2.spec +++ b/python3.12-psycopg2.spec @@ -61,6 +61,9 @@ Conflicts: python-psycopg2-zope < %{version} # Remove test 'test_from_tables' for s390 architecture # from ./tests/test_types_extras.py Patch0: test_types_extras-2.9.3-test_from_tables.patch +# Update expected output for IPv4-mapped IPv6 addresses: PostgreSQL 13.20+ +# returns dotted-decimal form (::ffff:1.2.3.0) instead of hex (::ffff:102:300) +Patch1: test_ipaddress-ipv4-mapped-ipv6-format.patch %description %{desc} @@ -142,6 +145,7 @@ Zope Database Adapter for PostgreSQL, called ZPsycopgDA %ifarch s390x s390 %patch0 -p0 %endif +%patch1 -p0 %build export CFLAGS=${RPM_OPT_FLAGS} LDFLAGS=${RPM_LD_FLAGS} diff --git a/test_ipaddress-ipv4-mapped-ipv6-format.patch b/test_ipaddress-ipv4-mapped-ipv6-format.patch new file mode 100644 index 0000000..6be9c6c --- /dev/null +++ b/test_ipaddress-ipv4-mapped-ipv6-format.patch @@ -0,0 +1,20 @@ +--- tests/test_ipaddress.py.orig 2026-07-07 00:00:00.000000000 +0000 ++++ tests/test_ipaddress.py 2026-07-07 00:00:00.000000000 +0000 +@@ -68,7 +68,7 @@ + self.assertEquals(cur.fetchone()[0], '127.0.0.1/24') + + cur.execute("select %s", [ip.ip_interface('::ffff:102:300/128')]) +- self.assertEquals(cur.fetchone()[0], '::ffff:102:300/128') ++ self.assertEquals(cur.fetchone()[0], '::ffff:1.2.3.0/128') + + @testutils.skip_if_crdb("cidr") + def test_cidr_cast(self): +@@ -109,7 +109,7 @@ + self.assertEquals(cur.fetchone()[0], '127.0.0.0/24') + + cur.execute("select %s", [ip.ip_network('::ffff:102:300/128')]) +- self.assertEquals(cur.fetchone()[0], '::ffff:102:300/128') ++ self.assertEquals(cur.fetchone()[0], '::ffff:1.2.3.0/128') + + + def test_suite():