mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-01-11 03:11:50 +00:00
system-test: enable faketime optionally per test
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -24,7 +24,9 @@ class S3Test(BaseTest):
|
||||
s3Overrides = {}
|
||||
|
||||
def fixture_available(self):
|
||||
return super(S3Test, self).fixture_available() and s3_conn is not None
|
||||
return super(S3Test, self).fixture_available() and \
|
||||
'AWS_SECRET_ACCESS_KEY' in os.environ and 'AWS_ACCESS_KEY_ID' in os.environ and \
|
||||
os.environ['AWS_SECRET_ACCESS_KEY'] != "" and os.environ['AWS_ACCESS_KEY_ID'] != ""
|
||||
|
||||
def prepare(self):
|
||||
self.bucket_name = "aptly-sys-test-" + str(uuid.uuid1())
|
||||
|
||||
@@ -416,6 +416,7 @@ class CreateMirror31Test(BaseTest):
|
||||
runCmd = "aptly mirror create --keyring=aptlytest-gpg1.gpg mirror11 http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/ stretch"
|
||||
configOverride = {"gpgProvider": "internal", "max-tries": 1}
|
||||
fixtureGpg = True
|
||||
faketime = True
|
||||
|
||||
def outputMatchPrepare(self, s):
|
||||
return re.sub(r'Signature made .* using', '', s)
|
||||
|
||||
Reference in New Issue
Block a user