[LTP] [PATCH 1/2] syscalls/uname{01, 03}: Convert to new API and cleanup

Cyril Hrubis chrubis@suse.cz
Wed Nov 11 15:54:41 CET 2020


Hi!
Pushed with diff:

diff --git a/testcases/kernel/syscalls/uname/uname01.c b/testcases/kernel/syscalls/uname/uname01.c
index 37722947f..bd3b05303 100644
--- a/testcases/kernel/syscalls/uname/uname01.c
+++ b/testcases/kernel/syscalls/uname/uname01.c
@@ -24,6 +24,12 @@ static void verify_uname(void)
                return;
        }
 
+       if (TST_RET != 0) {
+               tst_res(TFAIL | TTERRNO,
+                       "uname() returned invalid value %ld", TST_RET);
+               return;
+       }
+
        if (strcmp(un.sysname, "Linux")) {
                tst_res(TFAIL, "sysname is not Linux");
                return;


Also I guess that we can check the hostname against gethostname(), but that can
be added in follow up patch, thanks.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list