diff --git a/.azure-pipelines/build-template.yml b/.azure-pipelines/build-template.yml index 0d87de889f05..104ab8965f16 100644 --- a/.azure-pipelines/build-template.yml +++ b/.azure-pipelines/build-template.yml @@ -135,6 +135,8 @@ jobs: displayName: "Install gcovr 5.0 with recursive fix" - script: | set -ex + # Add SYS_TIME capability for settimeofday ok in syncd test + sudo setcap "cap_sys_time=eip" syncd/.libs/tests make check gcovr --version find SAI/meta -name "*.gc*" | xargs rm -vf diff --git a/syncd/Makefile.am b/syncd/Makefile.am index cea5baeff55e..ddcdd04fcf3f 100644 --- a/syncd/Makefile.am +++ b/syncd/Makefile.am @@ -86,6 +86,7 @@ syncd_request_shutdown_LDADD = libSyncdRequestShutdown.a $(top_srcdir)/lib/libSa tests_SOURCES = tests.cpp tests_CXXFLAGS = $(DBGFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS_COMMON) +tests_LDFLAGS = -Wl,-rpath,$(top_srcdir)/lib/.libs -Wl,-rpath,$(top_srcdir)/meta/.libs tests_LDADD = libSyncd.a -lhiredis -lswsscommon -lpthread -L$(top_srcdir)/lib/.libs -lsairedis \ -L$(top_srcdir)/meta/.libs -lsaimetadata -lsaimeta -lzmq $(CODE_COVERAGE_LIBS) diff --git a/syncd/tests.cpp b/syncd/tests.cpp index d281697931c4..56558b88aaf4 100644 --- a/syncd/tests.cpp +++ b/syncd/tests.cpp @@ -820,12 +820,6 @@ void test_watchdog_timer_clock_rollback() { SWSS_LOG_ENTER(); - if (getuid() != 0) - { - SWSS_LOG_WARN("this test requires root for set time"); - return; - } - const int64_t WARN_TIMESPAN_USEC = 30 * 1000000; const uint8_t ROLLBACK_TIME_SEC = 5; const uint8_t LONG_RUNNING_API_TIME_SEC = 3;