diff --git a/tests/posix/common/src/uname.c b/tests/posix/common/src/uname.c new file mode 100644 index 000000000000000..b414c78850aabbc --- /dev/null +++ b/tests/posix/common/src/uname.c @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2023 meta + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +ZTEST(posix_apis, test_posix_uname) +{ + int rc; + + rc = uname(NULL); + zassert_equal(rc, -1, "rc expected to be -1, but got %d", rc); + + struct utsname info; + + zassert_ok(uname(&info)); + zassert_ok(strncmp(info.sysname, "Zephyr", sizeof(info.sysname))); + zassert_ok(strncmp(info.machine, CONFIG_ARCH, sizeof(info.machine))); +}