Skip to content

Commit

Permalink
Fix test-suite under Fedora 40 modern C rules
Browse files Browse the repository at this point in the history
Multiple tests are failing on Fedora 40 due to their distro-wide
C modernization effort, which cause our ancient "hello world" package
to fail due to implicit printf() function usage.

There are two separate issues here:
- hello-autopatch.spec had off-by-one in its patch application, causing
  the modernization patch to not apply (see rpm-software-management#3093 for the reason)
- others were using the original hello-1.0-1.src.rpm from 2007 with
  some very outdated practises, code and md5 hashes

Update the src.rpm, removing silly fubar while we're at it. Regenerated
now on x86_64 so adjust the test-expectation, and update the python archive
test to calculate sha256 instead. And, fix the autopatch test numbers.
  • Loading branch information
pmatilai committed May 13, 2024
1 parent 8535694 commit 353cc1a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/data/SPECS/hello-autopatch.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Simple rpm demonstration.

%prep
%autosetup -N
%autopatch 1
%autopatch -m 2
%autopatch 0
%autopatch -m 1

%build
%make_build CFLAGS="$RPM_OPT_FLAGS"
Expand Down
Binary file modified tests/data/SRPMS/hello-1.0-1.src.rpm
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/rpmpython.at
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ for f in archive:
if not f.fflags & rpm.RPMFILE_SPECFILE:
continue
spec = archive.read()
hash = hashlib.md5(spec)
hash = hashlib.sha256(spec)
if f.digest != hash.hexdigest():
myprint('%s should be %s' % (hash.hexdigest(), f.digest))
break
Expand Down
2 changes: 1 addition & 1 deletion tests/rpmquery.at
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ runroot rpm \
-p /data/SRPMS/hello-1.0-1.src.rpm
],
[0],
[hello-1.0-1.i386
[hello-1.0-1.x86_64
],
[ignore])
RPMTEST_CLEANUP
Expand Down

0 comments on commit 353cc1a

Please sign in to comment.