CESNET / libyang

YANG data modeling language library
BSD 3-Clause "New" or "Revised" License
368 stars 292 forks source link

Libyang utest_plugins failed, while all remaining ones pass. #1971

Closed mus19f1a closed 1 year ago

mus19f1a commented 1 year ago

There are a failed test case "utest_plugins" where the libyang "devel" branch directly cloned into a arm based device and build with cmake 3.18.2 and gcc 10.2.0

Any idea for the reason of the error or to solve the issue?

Thank you in advance.

Here is the test log:

31/58 Testing: utest_plugins
31/58 Test: utest_plugins
Command: "/home/st/libyang/build/tests/utest_plugins"
Directory: /home/st/libyang/build/tests/utests
"utest_plugins" start time: Jan 10 18:33 UTC
Output:
----------------------------------------------------------
[==========] tests: Running 3 test(s).
[ RUN      ] test_add_invalid
[       OK ] test_add_invalid
[ RUN      ] test_add_simple
[  ERROR   ] --- 0 != 2
[   LINE   ] --- /home/st/libyang/tests/utests/basic/test_plugins.c:50: error: Failure!
[  FAILED  ] test_add_simple
[ RUN      ] test_not_implemented
[       OK ] test_not_implemented
[==========] tests: 3 test(s) run.
[  PASSED  ] 2 test(s).
[  FAILED  ] tests: 1 test(s), listed below:
[  FAILED  ] test_add_simple

 1 FAILED TEST(S)
<end of output>
Test time =   0.18 sec
----------------------------------------------------------
Test Failed.
"utest_plugins" end time: Jan 10 18:33 UTC
"utest_plugins" time elapsed: 00:00:00
----------------------------------------------------------
michalvasko commented 1 year ago

Command: "/home/??/libyang/build/tests/utest_plugins" Directory: /home/??/libyang/build/tests/utests

I am guessing the plugin is not found because of those ?? in the path. Can you paste the paths in build/tests/tests_config.h? Can you post the output of running cmake from scratch?

mus19f1a commented 1 year ago

sorry for the inconvenience, ?? marks is not error or bug, I just replace the username with "??", I fixed it now.

Paths in the ../build/tests/test_config.h is as follows:

#ifndef LYTEST_CONFIG_H_
#define LYTEST_CONFIG_H_

#define TESTS_SRC "/home/st/libyang/tests"
#define TESTS_BIN "/home/st/libyang/build/tests"

#define TESTS_DIR_MODULES_YANG TESTS_SRC"/modules/yang"

/**
 * @brief Macro for support of callgrind header and macros.
 */
/* #undef HAVE_CALLGRIND */

#endif /* LYTEST_CONFIG_H_ */

There are no path related issue I think.

Here is the cmake output from scratch;

root@t1:/home/test/libyang/build# cmake ..
-- The C compiler identification is GNU 10.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMake Warning at CMakeLists.txt:279 (message):
  valgrind executable not found! Disabling memory leak tests.

-- Found CMocka: /usr/local/lib/libcmocka.so (Required is at least version "1.0.1") 
-- Could NOT find Uncrustify (missing: UNCRUSTIFY) (Required is at least version "0.76")
-- Looking for vdprintf
-- Looking for vdprintf - found
-- Looking for asprintf
-- Looking for asprintf - found
-- Looking for vasprintf
-- Looking for vasprintf - found
-- Looking for getline
-- Looking for getline - found
-- Looking for strndup
-- Looking for strndup - found
-- Looking for strnstr
-- Looking for strnstr - not found
-- Looking for strdupa
-- Looking for strdupa - found
-- Looking for strchrnul
-- Looking for strchrnul - found
-- Looking for get_current_dir_name
-- Looking for get_current_dir_name - found
-- Looking for pthread_mutex_timedlock
-- Looking for pthread_mutex_timedlock - found
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
CMake Warning (dev) at /usr/share/cmake-3.18/Modules/CheckIncludeFile.cmake:80 (message):
  Policy CMP0075 is not set: Include file check macros honor
  CMAKE_REQUIRED_LIBRARIES.  Run "cmake --help-policy CMP0075" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  CMAKE_REQUIRED_LIBRARIES is set to:

    pthread

  For compatibility with CMake 3.11 and below this check is ignoring it.
Call Stack (most recent call first):
  /usr/share/cmake-3.18/Modules/CheckTypeSize.cmake:230 (check_include_file)
  /usr/share/cmake-3.18/Modules/TestBigEndian.cmake:33 (CHECK_TYPE_SIZE)
  CMakeModules/UseCompat.cmake:46 (TEST_BIG_ENDIAN)
  CMakeLists.txt:335 (use_compat)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Searching 16 bit integer - Using unsigned short
-- Check if the system is big endian - little endian
-- Looking for stdatomic.h
-- Looking for stdatomic.h - found
-- Performing Test HAVE_TM_GMTOFF
-- Performing Test HAVE_TM_GMTOFF - Success
-- Looking for timezone
-- Looking for timezone - found
-- Looking for realpath
-- Looking for realpath - found
-- Looking for localtime_r
-- Looking for localtime_r - found
-- Looking for gmtime_r
-- Looking for gmtime_r - found
-- Looking for strptime
-- Looking for strptime - found
-- Looking for mmap
-- Looking for mmap - found
-- Looking for dirname
-- Looking for dirname - found
-- Looking for setenv
-- Looking for setenv - found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found PCRE2: /usr/local/lib/libpcre2-8.a (found suitable version "10.42", minimum required is "10.21") 
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2") 
CMake Warning at CMakeLists.txt:430 (message):
  pkg-config will not detect the new package after installation, adjust
  PKG_CONFIG_PATH using "export
  PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/usr/local/lib/pkgconfig".

CMake Warning at tools/lint/CMakeLists.txt:75 (message):
  'shunit2' not found! The yanglint(1) non-interactive tests will not be
  available.

CMake Warning at tools/lint/CMakeLists.txt:84 (message):
  'expect' not found! The yanglint(1) interactive tests will not be
  available.

-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/test/libyang/build
michalvasko commented 1 year ago

Right, try changing this macro to 0 and rerun the test, you should see the actual error message.

mus19f1a commented 1 year ago

I switched to another setup, as I going back to the one that error exist I will add the actual error messages as you suggest.

is it possible utest_plugins to need libsystemd which are not exists in the running operating system?

michalvasko commented 1 year ago

is it possible utest_plugins to need libsystemd which are not exists in the running operating system?

No, I do not think so.