Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 947030 - sys-apps/dcfldd: add smoke test to src_test
Summary: sys-apps/dcfldd: add smoke test to src_test
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Sebastian Pipping
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-27 16:21 UTC by Sam James
Modified: 2025-01-12 13:17 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-12-27 16:21:00 UTC
AFAICT sys-apps/dcfldd doesn't have a testsuite upstream, so src_test doesn't currently achieve anything.

If we had a small smoketest to compute a hash for some known test file and compare the result, we may have been able to find bug 930996 sooner when keywording on e.g. ppc64.

so, something like (just psuedocode):
```
src_test() {
    # Just in case upstream add tests in future
    default

    # Smoke test for bug #930996
    # Borrowed from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114698#c0
    expected_cksum=8021973df8498a650e444fd84c705d9168639a246bc6024066e4091b2b450da6
    obtained_cksum=$(echo TestInput | ./dclfdd ... | sha256sum | cut ...)
    [[ ${expected_cksum} != ${obtained_cksum} ]] && die "uh oh"
}
```
Comment 1 Sebastian Pipping gentoo-dev 2024-12-27 16:47:46 UTC
No objections, would you be alright with adding it to the ebuild yourself?
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-12-28 16:35:39 UTC
Sure, happily! (Did you mean to make this bug private?)
Comment 3 Sebastian Pipping gentoo-dev 2024-12-28 19:00:13 UTC
(In reply to Sam James from comment #2)
> Sure, happily!

Cool!

> (Did you mean to make this bug private?)

No, I didn't notice, thanks for the remark, reverting…
Comment 4 Larry the Git Cow gentoo-dev 2025-01-11 21:57:20 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e0b583e63f9c846d1c99359f7f3940e3b209fcf6

commit e0b583e63f9c846d1c99359f7f3940e3b209fcf6
Author:     Sebastian Pipping <sping@gentoo.org>
AuthorDate: 2025-01-11 21:53:42 +0000
Commit:     Sebastian Pipping <sping@gentoo.org>
CommitDate: 2025-01-11 21:56:55 +0000

    sys-apps/dcfldd: Add simple test to detect miscompilation
    
    Closes: https://bugs.gentoo.org/947030
    Suggested-by: Sam James <sam@gentoo.org>
    Signed-off-by: Sebastian Pipping <sping@gentoo.org>

 sys-apps/dcfldd/dcfldd-1.9.2-r1.ebuild | 53 ++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)
Comment 5 Sebastian Pipping gentoo-dev 2025-01-11 21:58:43 UTC
I have gone forward adding a test myself now. Does it look alright?
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-01-12 11:48:58 UTC
Thanks!