From 4f85efee844639b65f7e47ac678529c229163de1 Mon Sep 17 00:00:00 2001 From: Swikriti Tripathi <41103328+SwikritiT@users.noreply.github.com> Date: Thu, 22 Jun 2023 09:55:58 +0545 Subject: [PATCH] [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 --- .drone.star | 29 +++-------------------- tests/acceptance/docker/src/antivirus.yml | 5 ---- tests/acceptance/docker/src/ocis-base.yml | 8 +------ 3 files changed, 4 insertions(+), 38 deletions(-) diff --git a/.drone.star b/.drone.star index cefd1492da..dcfe945ad0 100644 --- a/.drone.star +++ b/.drone.star @@ -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(): diff --git a/tests/acceptance/docker/src/antivirus.yml b/tests/acceptance/docker/src/antivirus.yml index 33e2a8259f..f84765ac6d 100644 --- a/tests/acceptance/docker/src/antivirus.yml +++ b/tests/acceptance/docker/src/antivirus.yml @@ -6,9 +6,4 @@ services: command: clamav:3310 clamav: image: owncloudci/clamavd - volumes: - - clamavSocket:/var/run/clamav/ - -volumes: - clamavSocket: diff --git a/tests/acceptance/docker/src/ocis-base.yml b/tests/acceptance/docker/src/ocis-base.yml index 6694dee935..8924ca5c46 100644 --- a/tests/acceptance/docker/src/ocis-base.yml +++ b/tests/acceptance/docker/src/ocis-base.yml @@ -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