system-test: enable faketime optionally per test

This commit is contained in:
André Roth
2025-06-08 20:55:23 +02:00
parent 601c8e9d52
commit 1566e193f6
4 changed files with 13 additions and 3 deletions
+4
View File
@@ -130,6 +130,7 @@ class BaseTest(object):
sortOutput = False
debugOutput = False
EtcdServer = None
faketime = False
aptlyDir = ".aptly"
aptlyConfigFile = ".aptly.conf"
@@ -311,6 +312,9 @@ class BaseTest(object):
aptly_testing_bin = Path(__file__).parent / ".." / "aptly.test"
command = [str(aptly_testing_bin), f"-test.coverprofile={Path(self.coverage_dir) / self.__class__.__name__}-{uuid4()}.out", *command[1:]]
if self.faketime:
command = ["faketime", os.environ.get("TEST_FAKETIME", "2025-01-02 03:04:05")] + command
environ = os.environ.copy()
environ["LC_ALL"] = "C"
environ.update(self.environmentOverride)