You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by al...@apache.org on 2020/04/22 15:14:49 UTC

[kudu] branch branch-1.12.x updated: [HybridClockTest] update TestNtpDiagnostics scenario

This is an automated email from the ASF dual-hosted git repository.

alexey pushed a commit to branch branch-1.12.x
in repository https://gitbox.apache.org/repos/asf/kudu.git


The following commit(s) were added to refs/heads/branch-1.12.x by this push:
     new 5d77f79  [HybridClockTest] update TestNtpDiagnostics scenario
5d77f79 is described below

commit 5d77f794a5f30a15d8422b6b89c164b5fa162629
Author: Alexey Serbin <al...@apache.org>
AuthorDate: Tue Apr 21 11:21:01 2020 -0700

    [HybridClockTest] update TestNtpDiagnostics scenario
    
    This changelist updates HybridClockTest.TestNtpDiagnostics scenario
    to work even if the NTP diagnostic tools are absent.  The idea is
    to verify that appropriate tools are run or attempted to run, and
    that's already enough.
    
    The motivation for this changelist was the absence of 'ntptime', 'ntpq',
    and other NTP-related tools in macOS Catalina and newer.  As for the
    deprecation of 'ntpd' on macOS, it's replaced with 'timed' [1] starting
    macOS HighSierra (10.13).  The 'ntpd' and legacy NTP tools are still
    there in macOS HighSierra, but 'ntpd' is longer running ('timed' is used
    instead).  It seems starting with Catalina they removed 'ntpd' and the
    legacy NTP tools such as 'ntptime', 'ntpq', 'ntpdc', etc.
    
    [1] https://forums.developer.apple.com/thread/83240
    
    Change-Id: I6fb3467ce289eaaf394add0a72fbf5022a96fd70
    Reviewed-on: http://gerrit.cloudera.org:8080/15774
    Reviewed-by: Volodymyr Verovkin <ve...@cloudera.com>
    Reviewed-by: Grant Henke <gr...@apache.org>
    Tested-by: Alexey Serbin <as...@cloudera.com>
    (cherry picked from commit ec3e5307590cdd69172b20a5304dc316e95a70ff)
    Reviewed-on: http://gerrit.cloudera.org:8080/15776
    Tested-by: Kudu Jenkins
---
 src/kudu/clock/hybrid_clock-test.cc | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/kudu/clock/hybrid_clock-test.cc b/src/kudu/clock/hybrid_clock-test.cc
index 3a94fdd..de74d35 100644
--- a/src/kudu/clock/hybrid_clock-test.cc
+++ b/src/kudu/clock/hybrid_clock-test.cc
@@ -511,8 +511,16 @@ TEST_F(HybridClockTest, TestNtpDiagnostics) {
   clock.time_service()->DumpDiagnostics(&log);
   string s = JoinStrings(log, "\n");
   SCOPED_TRACE(s);
-  ASSERT_STR_MATCHES(s, "(ntp_gettime\\(\\) returns code |chronyc -n tracking)");
-  ASSERT_STR_MATCHES(s, "(ntpq -n |chronyc -n sources)");
+  // This is to verify that appropriate diagnostic tools are run or at least
+  // attempted to run. The tools might not be available, and that's expected
+  // pre-condition as well. The output either contains report from the tools or
+  // error messages that corresponding binaries cannot be found. In either case
+  // it proves the tools were attempted to run to collect NTP-related diagnostic
+  // information.
+  ASSERT_STR_CONTAINS(s, "ntptime");
+  ASSERT_STR_CONTAINS(s, "ntpq");
+  ASSERT_STR_CONTAINS(s, "ntpdc");
+  ASSERT_STR_CONTAINS(s, "chronyc");
 }
 #endif // #if defined(KUDU_HAS_SYSTEM_TIME_SOURCE) ...