[tests-only][full-ci] use tcp for antivirus service in ci (#6573)

* Test antivirus service in ci with different config

* enable other tests and update docker compose files
This commit is contained in:
Swikriti Tripathi
2023-06-22 09:55:58 +05:45
committed by GitHub
parent 68393150df
commit 4f85efee84
3 changed files with 4 additions and 38 deletions
+3 -26
View File
@@ -144,7 +144,7 @@ config = {
"antivirusNeeded": True,
"extraServerEnvironment": {
"ANTIVIRUS_SCANNER_TYPE": "clamav",
"ANTIVIRUS_CLAMAV_SOCKET": "/var/run/clamav/clamd.sock",
"ANTIVIRUS_CLAMAV_SOCKET": "tcp://clamav:3310",
"POSTPROCESSING_STEPS": "virusscan",
"OCIS_ASYNC_UPLOADS": True,
"OCIS_ADD_RUN_SERVICES": "antivirus",
@@ -197,22 +197,6 @@ pipelineVolumeGo = \
"temp": {},
}
# volume for pipeline to share clamav socket between steps of a pipeline
# to be used in combination with stepVolumeClamav
pipelineVolumeClamav = \
{
"name": "sockets",
"temp": {},
}
# volume for steps to share clamav socket between steps of a pipeline
# socket path must be set to /var/run/clamav/ inside the image, which is the case
stepVolumeClamav = \
{
"name": "sockets",
"path": "/var/run/clamav/",
}
# minio mc environment variables
MINIO_MC_ENV = {
"CACHE_BUCKET": {
@@ -815,13 +799,12 @@ def localApiTestPipeline(ctx):
},
"steps": skipIfUnchanged(ctx, "acceptance-tests") +
restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin") +
(clamavService() if params["antivirusNeeded"] else []) +
ocisServer(storage, params["accounts_hash_difficulty"], extra_server_environment = params["extraServerEnvironment"], with_wrapper = True) +
(waitForClamavService() if params["antivirusNeeded"] else []) +
ocisServer(storage, params["accounts_hash_difficulty"], extra_server_environment = params["extraServerEnvironment"], with_wrapper = True, volumes = [stepVolumeClamav] if params["antivirusNeeded"] else []) +
(waitForEmailService() if params["emailNeeded"] else []) +
localApiTests(suite, storage, params["extraEnvironment"]) +
failEarly(ctx, early_fail),
"services": emailService() if params["emailNeeded"] else [],
"services": emailService() if params["emailNeeded"] else [] + clamavService() if params["antivirusNeeded"] else [],
"depends_on": getPipelineNames([buildOcisBinaryForTesting(ctx)]),
"trigger": {
"ref": [
@@ -829,7 +812,6 @@ def localApiTestPipeline(ctx):
"refs/pull/**",
],
},
"volumes": [pipelineVolumeClamav] if params["antivirusNeeded"] else [],
}
pipelines.append(pipeline)
return pipelines
@@ -2960,11 +2942,6 @@ def clamavService():
return [{
"name": "clamav",
"image": OC_CI_CLAMAVD,
"volumes": [{
"name": "sockets",
"path": "/var/run/clamav/",
}],
"detach": True,
}]
def waitForClamavService():
@@ -6,9 +6,4 @@ services:
command: clamav:3310
clamav:
image: owncloudci/clamavd
volumes:
- clamavSocket:/var/run/clamav/
volumes:
clamavSocket:
+1 -7
View File
@@ -38,16 +38,10 @@ services:
# antivirus
ANTIVIRUS_SCANNER_TYPE: "clamav"
ANTIVIRUS_CLAMAV_SOCKET: "/var/run/clamav/clamd.sock"
ANTIVIRUS_CLAMAV_SOCKET: tcp://clamav:3310
# postprocessing step
POSTPROCESSING_STEPS: $POSTPROCESSING_STEPS
volumes:
- ../../../config:/drone/src/tests/config
- ../../../ociswrapper/bin/ociswrapper:/usr/bin/ociswrapper
- clamavSocket:/var/run/clamav/
volumes:
clamavSocket:
external:
name: ocis-acceptance-tests_clamavSocket