Page MenuHomeFreeBSD

netbsd-tests: Update a test case to chase grep symlink handling changes
ClosedPublic

Authored by markj on Thu, Sep 5, 1:51 PM.
Tags
None
Referenced Files
F95413195: D46544.diff
Fri, Sep 20, 5:11 PM
Unknown Object (File)
Fri, Sep 20, 12:48 PM
Unknown Object (File)
Thu, Sep 19, 11:11 PM
Unknown Object (File)
Thu, Sep 19, 8:11 AM
Unknown Object (File)
Wed, Sep 18, 10:29 AM
Unknown Object (File)
Wed, Sep 18, 2:01 AM
Unknown Object (File)
Tue, Sep 17, 8:57 PM
Unknown Object (File)
Mon, Sep 16, 10:08 PM
Subscribers

Details

Summary

This test case verifies that grep detects symlink loops when traversing
a directory hierarchy.

Fixes: fc12c191c087 ("grep: Default to -p instead of -S.")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.Thu, Sep 5, 1:51 PM

Would it make sense to create another testcase specific for -S vs non--S?
Not a huge deal.. just thinking ahead (and yes, I need to rebase netbsd-tests sometime soon...).

This revision is now accepted and ready to land.Fri, Sep 6, 5:25 PM
jhb added inline comments.
contrib/netbsd-tests/usr.bin/grep/t_grep.sh
75

Note that the old test wouldn't have passed with most other grep's either FWIW including BSD grep on macOS.

I actually had created a directory tree with various helps and symlinks (including broken symlinks) for my own local testing. I then tested all of -p, -S, and -O against the tree. I documented much of this in the PR and in the review. Should maybe add those tests, but they aren't NetBSD tests at that point. I guess they could go in a grep/tests/ directory in the tree?

contrib/netbsd-tests/usr.bin/grep/t_grep.sh
75

Indeed, I think I can remove this FreeBSD block.

There is already a usr.bin/grep/tests/grep_freebsd_test.sh, which seems like a good place for your tests to live.