testcase: gethostid: Check if hostid is available
PATCH 1/1 testcase: gethostid: Check if hostid is available
On some embedded systems, hostid may not be installed. Because of that, the test will fail with:
gethostid01 1 TFAIL : gethostid01.c:171: fgets failed
The test should return a TCONF instead.
This commit uses tst_get_path function to check if "hostid" is available in $PATH. Otherwise, it will return a TCONF.
--- testcases/kernel/syscalls/gethostid/gethostid01.c | 4 ++++ 1 file changed, 4 insertions(+)
testcases/kernel/syscalls/gethostid/gethostid01.c +4 -0
@@ -239,6 +239,10 @@ int main(int ac, char **av)void setup (void ) { +char path[2048 ]; + +if (tst_get_path ("hostid" , path,sizeof (path))) +tst_brkm (TCONF ,NULL ,"Couldn't find hostid in $PATH" );tst_sig (FORK ,DEF_HANDLER , cleanup);
Signature · 1 line
2.11.0
PATCH 1/1 testcase: gethostid: Check if hostid is available
----- Original Message -----
Quoted 10 lines
On some embedded systems, hostid may not be installed. Because of that, the test will fail with:
gethostid01 1 TFAIL : gethostid01.c:171: fgets failed
The test should return a TCONF instead.
This commit usestst_get_pathfunction to check if "hostid" is available in $PATH. Otherwise, it will return a TCONF.Signed-off-by Mylène Josserand <[email protected]>
Pushed.
Thanks,
Jan