[PATCH] tests/stat: use find -follow for busybox compatibility
Mike Frysinger
vapier at gentoo.org
Wed May 8 18:22:37 UTC 2013
On Wednesday 08 May 2013 12:08:14 Dmitry V. Levin wrote:
> On Wed, May 08, 2013 at 11:48:26AM -0400, Mike Frysinger wrote:
> > On Wednesday 08 May 2013 05:00:31 James Hogan wrote:
> > > Use the -follow argument to find instead of -L for compatibility with
> > > busybox which doesn't have the -L option.
> >
> > so fix busybox. the -L option is part of POSIX and assuming at least a
> > POSIX base is perfectly fair game. anything else is a nightmare of
> > random unmaintainable changes.
> > http://pubs.opengroup.org/onlinepubs/9699919799/utilities/find.html
>
> I'm inclined to rewrite that part of the test in C,
> so that more "long long" syscalls could be tested.
so i've been maintaining a testsuite specifically designed to exercise specific
C lib funcs and syscalls. it's a framework that makes poking funcs from the
command line dirt simple. i wonder if it wouldn't find a good home in strace.
i've been adding helpers for funcs i care about, but the framework isn't
limited to just those at all, so adding more should be very straight forward.
http://git.overlays.gentoo.org/gitweb/?p=proj/sandbox.git;a=tree;f=tests
for example, this produces binaries like:
$ ./mkdirat-0
usage: mkdirat <tests>
test: < <ret> <dirfd> <path> <mode> >
<ret> := #[,<errno>]; # is a decimal and errno can be symbolic
<dirfd> := AT_FDCWD | fd # | path[:<flags>[:<mode>]]
<mode> := 0x# (for hex) | 0# (for octal) | # (for decimal)
which you can then easily run from the command line like so:
$ strace -emkdirat ./mkdirat-0 0 AT_FDCWD dir 0777
mkdirat(AT_FDCWD, "dir", 0777) = 0
$ ls -ld dir
drwxr-xr-x 2 vapier users 4096 May 8 14:20 dir
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20130508/27561f88/attachment.bin>
More information about the Strace-devel
mailing list