Blame SOURCES/tests-Support-Debian-s-libfaketime.patch

8f2224
From 27f7ca84a5a05f65e6d113a8a6698c7f40fd66c6 Mon Sep 17 00:00:00 2001
8f2224
From: Robbie Harwood <rharwood@redhat.com>
8f2224
Date: Fri, 15 May 2020 15:51:19 -0400
8f2224
Subject: [PATCH] [tests] Support Debian's libfaketime
8f2224
8f2224
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
8f2224
(cherry picked from commit 367120a1c02641680a8f51bd59cc96d56cc9804b)
8f2224
---
8f2224
 tests/magtests.py | 13 ++++++++++---
8f2224
 1 file changed, 10 insertions(+), 3 deletions(-)
8f2224
8f2224
diff --git a/tests/magtests.py b/tests/magtests.py
8f2224
index da1cca7..6c38a8f 100755
8f2224
--- a/tests/magtests.py
8f2224
+++ b/tests/magtests.py
8f2224
@@ -692,9 +692,16 @@ def test_hostname_acceptor(testdir, testenv, logfile):
8f2224
 
8f2224
 
8f2224
 def faketime_setup(testenv):
8f2224
-    libfaketime = '/usr/lib64/faketime/libfaketime.so.1'
8f2224
-    # optional faketime
8f2224
-    if not os.path.isfile(libfaketime):
8f2224
+    # Wanted: an architecture- and distro-agnostic way to do this.
8f2224
+    # libfaketime is installed in a place where ld.so won't pick it up by
8f2224
+    # default, so...
8f2224
+    paths = ['/usr/lib64/faketime/libfaketime.so.1',
8f2224
+             '/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1']
8f2224
+    libfaketime = None
8f2224
+    for p in paths:
8f2224
+        if os.path.isfile(p):
8f2224
+            libfaketime = p
8f2224
+    if not libfaketime:
8f2224
         raise NotImplementedError
8f2224
 
8f2224
     # spedup x100