diff --git a/test/test_vpe_api.py b/test/test_vpe_api.py
index 81c9d9a..54f7e41 100644
--- a/test/test_vpe_api.py
+++ b/test/test_vpe_api.py
@@ -11,10 +11,13 @@
 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
+import datetime
 import time
 import unittest
 from framework import VppTestCase
 
+enable_print = False
+
 
 class TestVpeApi(VppTestCase):
     """TestVpeApi"""
@@ -22,25 +25,31 @@
     def test_log_dump_default(self):
         rv = self.vapi.cli('test log notice fib entry this is a test')
         rv = self.vapi.log_dump()
-        # print('\n'.join([str(v) for v in rv]))
+        if enable_print:
+            print('\n'.join([str(v) for v in rv]))
         self.assertTrue(rv)
 
     def test_log_dump_timestamp_0(self):
         rv = self.vapi.cli('test log notice fib entry this is a test')
         rv = self.vapi.log_dump(start_timestamp=0.0)
-        # print('\n'.join([str(v) for v in rv]))
+        if enable_print:
+            print('\n'.join([str(v) for v in rv]))
         self.assertTrue(rv)
 
-    @unittest.skip('Requires https://gerrit.fd.io/r/#/c/19581/ '
-                   'to use timestamp_ticks.')
     def test_log_dump_timestamp_future(self):
         rv = self.vapi.cli('test log debug fib entry test')
         rv = self.vapi.log_dump(start_timestamp=time.time() + 60.0)
-        # print('\n'.join([str(v) for v in rv]))
+        if enable_print:
+            print('\n'.join([str(v) for v in rv]))
         self.assertFalse(rv)
 
-    @unittest.skip('Requires https://gerrit.fd.io/r/#/c/19581/ '
-                   'to use timestamp_ticks.')
-    def test_show_vpe_system_time_ticks(self):
-        rv = self.vapi.show_vpe_system_time_ticks()
-        self.assertTrue(rv.vpe_system_time_ticks > 1.0)
+    def test_show_vpe_system_time(self):
+        local_start_time = datetime.datetime.now()
+        rv = self.vapi.show_vpe_system_time()
+        self.assertTrue(rv.vpe_system_time > local_start_time -
+                        datetime.timedelta(hours=1.0),
+                        'system times differ by more than an hour.')
+        if enable_print:
+            print('\n'.join([str(v) for v in rv]))
+            print('%r %s' % (rv.vpe_system_time,
+                             rv.vpe_system_time))
