allow s3 test in docker

read AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY from ./aws.creds when running:

  make docker-system-tests
This commit is contained in:
André Roth
2024-07-17 23:38:25 +02:00
parent a7690c375e
commit 48a0bca35e
3 changed files with 6 additions and 1 deletions

2
.gitignore vendored
View File

@@ -48,3 +48,5 @@ build/
pgp/keyrings/aptly2*.gpg
pgp/keyrings/aptly2*.gpg~
pgp/keyrings/.#*
*.creds

View File

@@ -66,6 +66,7 @@ docker-test: install
@rm -f aptly.test
go test -v -coverpkg="./..." -c -tags testruncli
@echo Running python tests ...
@test -e aws.creds && . ./aws.creds; \
export PATH=$(BINPATH)/:$(PATH); \
export APTLY_VERSION=$(VERSION); \
$(PYTHON) system/run.py --long $(TESTS) --coverage-dir $(COVERAGE_DIR) $(CAPTURE) $(TEST)

View File

@@ -8,7 +8,7 @@ try:
if 'AWS_SECRET_ACCESS_KEY' in os.environ and 'AWS_ACCESS_KEY_ID' in os.environ:
s3_conn = boto.connect_s3()
else:
print("S3 tests disabled: AWS creds not found in the environment")
print("S3 tests disabled: AWS creds not found in the environment (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)")
s3_conn = None
except ImportError as e:
print("S3 tests disabled: can't import boto", e)
@@ -32,6 +32,8 @@ class S3Test(BaseTest):
"test1": {
"region": "us-east-1",
"bucket": self.bucket_name,
"awsAccessKeyID": os.environ["AWS_ACCESS_KEY_ID"],
"awsSecretAccessKey": os.environ["AWS_SECRET_ACCESS_KEY"]
}
}}