[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 <verjovkin@cloudera.com>
Reviewed-by: Grant Henke <granthenke@apache.org>
Tested-by: Alexey Serbin <aserbin@cloudera.com>
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 @@
   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) ...