[LTP] [PATCH] syscalls/execve06: Add test for argv[0] = NULL

Petr Vorel pvorel@suse.cz
Tue Jun 14 15:34:27 CEST 2022


Hi Cyril,

> > I wonder why this does not work:
> > 	.needs_cmds = (const char *[]) {
> > 		"execve06_child",
> > 		NULL
> > 	},

> > tst_test.c:1526: TINFO: Timeout per run is 0h 00m 30s
> > execve06.c:33: TFAIL: Failed to execute execl01_child: ENOENT (2)
> > tst_test.c:395: TBROK: Invalid child (23451) exit value 1

> The difference is because the test library adds current directory and
> test start directory into $PATH before a test is executed, see
> add_paths() in the tst_test.c.

> The .needs_cmds is for binaries installed on the system in /usr/bin/
> etc. so it does not make much sense to call the add_paths() before we
> process the array.
Thx!

...
> > Testing matches the description from kernel commit.
> > Maybe also test for argv[0] being empty string (to make sure behavior does not
> > change, although unlikely it'd change)?

> It should be safe either way but I decided to be less specific and only
> check that something have been added there.
Sure.

> > I tested it on various kernels, works as expected.

> > Reviewed-by: Petr Vorel <pvorel@suse.cz>
> > Tested-by: Petr Vorel <pvorel@suse.cz>

> I will push it with the added runtest entries and fixed copyright then.
Thx!

Kind regards,
Petr


More information about the ltp mailing list