@@ -127,14 +127,14 @@ config = {
127127 "suites" : [
128128 "apiGraphUser" ,
129129 ],
130- "skip" : False ,
131130 "withRemotePhp" : [True ],
132131 },
133132 "spaces" : {
134133 "suites" : [
135134 "apiSpaces" ,
136135 ],
137- "skip" : False ,
136+ "skip" : True ,
137+ "k8s" : False ,
138138 },
139139 "spacesShares" : {
140140 "suites" : [
@@ -186,8 +186,8 @@ config = {
186186 "suites" : [
187187 "apiSharingNgAdditionalShareRole" ,
188188 ],
189- "skip" : False ,
190- "k8s" : True ,
189+ "skip" : True ,
190+ "k8s" : False ,
191191 "withRemotePhp" : [True ],
192192 },
193193 "sharingNgShareInvitation" : {
@@ -302,8 +302,8 @@ config = {
302302 "coreApiShareManagementBasicToShares" ,
303303 "coreApiShareManagementToShares" ,
304304 ],
305- "skip" : False ,
306- "k8s" : True ,
305+ "skip" : True ,
306+ "k8s" : False ,
307307 "withRemotePhp" : [True ],
308308 },
309309 "3" : {
@@ -323,8 +323,7 @@ config = {
323323 "coreApiShareCreateSpecialToShares2" ,
324324 "coreApiShareUpdateToShares" ,
325325 ],
326- "skip" : False ,
327- "k8s" : True ,
326+ "skip" : True ,
328327 "withRemotePhp" : [True ],
329328 },
330329 "5" : {
@@ -343,7 +342,7 @@ config = {
343342 "coreApiWebdavOperations" ,
344343 "coreApiWebdavMove2" ,
345344 ],
346- "skip" : False ,
345+ "skip" : True ,
347346 },
348347 "7" : {
349348 "suites" : [
@@ -1104,19 +1103,19 @@ def localApiTestPipeline(ctx):
11041103 restoreBuildArtifactCache (ctx , "ocis-binary-amd64" , "ocis/bin" ) +
11051104 (tikaService () if params ["tikaNeeded" ] else []) +
11061105 (waitForServices ("online-offices" , ["collabora:9980" , "onlyoffice:443" , "fakeoffice:8080" ]) if params ["collaborationServiceNeeded" ] else []) +
1107- (waitK3sCluster () + deployOcis () + waitForOcis (ocis_url = ocis_url ) + ociswrapper () + waitForOciswrapper () if run_on_k8s else ocisServer (storage , extra_server_environment = params ["extraServerEnvironment" ], with_wrapper = True , tika_enabled = params ["tikaNeeded" ], volumes = ([stepVolumeOcisStorage ]))) +
1108- (waitForClamavService () if params ["antivirusNeeded" ] else []) +
1109- (waitForEmailService () if params ["emailNeeded" ] else []) +
1106+ (waitK3sCluster () + ( clamavServiceK8s () if params [ "antivirusNeeded" ] and run_on_k8s else []) + ( emailServiceK8s () if params [ "emailNeeded" ] and run_on_k8s else []) + deployOcis () + waitForOcis (ocis_url = ocis_url ) + ociswrapper () + waitForOciswrapper () if run_on_k8s else ocisServer (storage , extra_server_environment = params ["extraServerEnvironment" ], with_wrapper = True , tika_enabled = params ["tikaNeeded" ], volumes = ([stepVolumeOcisStorage ]))) +
1107+ (waitForClamavService () if params ["antivirusNeeded" ] and not run_on_k8s else []) +
1108+ (waitForEmailService () if params ["emailNeeded" ] and not run_on_k8s else exposeEmailServiceK8s () if params [ "emailNeeded" ] and run_on_k8s else []) +
11101109 (ocisServer (storage , deploy_type = "federation" , extra_server_environment = params ["extraServerEnvironment" ]) if params ["federationServer" ] else []) +
11111110 ((wopiCollaborationService ("fakeoffice" ) + wopiCollaborationService ("collabora" ) + wopiCollaborationService ("onlyoffice" )) if params ["collaborationServiceNeeded" ] else []) +
11121111 (ocisHealthCheck ("wopi" , ["wopi-collabora:9304" , "wopi-onlyoffice:9304" , "wopi-fakeoffice:9304" ]) if params ["collaborationServiceNeeded" ] else []) +
11131112 localApiTests (name , params ["suites" ], storage , params ["extraEnvironment" ], run_with_remote_php , ocis_url = ocis_url , k8s = run_on_k8s ) +
11141113 apiTestFailureLog () +
11151114 (generateCoverageFromAPITest (ctx , name ) if not run_on_k8s else []),
1116- "services" : (emailService () if params [ "emailNeeded" ] else []) +
1117- (clamavService () if params ["antivirusNeeded" ] else []) +
1118- (( fakeOffice () + collaboraService () + onlyofficeService ()) if params ["collaborationServiceNeeded" ] else []) +
1119- (k3sCluster () if run_on_k8s else []),
1115+ "services" : (k3sCluster () if run_on_k8s else []) +
1116+ (emailService () if params ["emailNeeded" ] and not run_on_k8s else []) +
1117+ (clamavService () if params ["antivirusNeeded" ] and not run_on_k8s else []) +
1118+ (( fakeOffice () + collaboraService () + onlyofficeService ()) if params [ "collaborationServiceNeeded" ] else []),
11201119 "depends_on" : getPipelineNames (buildOcisBinaryForTesting (ctx )),
11211120 "trigger" : {
11221121 "ref" : [
@@ -3814,15 +3813,13 @@ def deployOcis():
38143813 "image" : "owncloudci/golang:latest" ,
38153814 "commands" : [
38163815 "make -C %s build" % dirs ["ocisWrapper" ],
3817- "mv %s/tests/config/drone/k3s /values.yaml %s/ocis-charts/charts/ocis/ci/deployment-values.yaml" % (dirs ["base" ], dirs ["base" ]),
3818- "cp -r %s/tests/config/drone/k3s /authbasic %s/ocis-charts/charts/ocis/templates/" % (dirs ["base" ], dirs ["base" ]),
3816+ "mv %s/tests/config/drone/k8s /values.yaml %s/ocis-charts/charts/ocis/ci/deployment-values.yaml" % (dirs ["base" ], dirs ["base" ]),
3817+ "cp -r %s/tests/config/drone/k8s /authbasic %s/ocis-charts/charts/ocis/templates/" % (dirs ["base" ], dirs ["base" ]),
38193818 "cd %s/ocis-charts" % dirs ["base" ],
38203819 "sed -i '/{{- define \" ocis.basicServiceTemplates\" -}}/a\\ \\ {{- $_ := set .scope \" appNameAuthBasic\" \" authbasic\" -}}' ./charts/ocis/templates/_common/_tplvalues.tpl" ,
38213820 "sed -i '/- name: IDM_ADMIN_PASSWORD/{n;N;N;N;d;}' ./charts/ocis/templates/idm/deployment.yaml" ,
38223821 "sed -i '/- name: IDM_ADMIN_PASSWORD/a\\ \\ \\ n value: \" admin\" ' ./charts/ocis/templates/idm/deployment.yaml" ,
38233822 "sed -i '/- name: PROXY_HTTP_ADDR/i\\ \\ - name: PROXY_ENABLE_BASIC_AUTH\\ \n value: \" true\" ' ./charts/ocis/templates/proxy/deployment.yaml" ,
3824- "sed -i '/- name: FRONTEND_PASSWORD_POLICY_BANNED_PASSWORDS_LIST/{N;d;}' %s/ocis-charts/charts/ocis/templates/frontend/deployment.yaml" % dirs ["base" ],
3825- "sed -i '/name: SHARING_PASSWORD_POLICY_BANNED_PASSWORDS_LIST/,+1d' %s/ocis-charts/charts/ocis/templates/sharing/deployment.yaml" % dirs ["base" ],
38263823 "export KUBECONFIG=%s/kubeconfig-$${DRONE_BUILD_NUMBER}.yaml" % dirs ["base" ],
38273824 "make helm-install-atomic" ,
38283825 ],
@@ -3834,6 +3831,39 @@ def deployOcis():
38343831 ],
38353832 }]
38363833
3834+ def clamavServiceK8s ():
3835+ return [{
3836+ "name" : "clamav" ,
3837+ "image" : OC_CI_ALPINE ,
3838+ "commands" : [
3839+ "cp -r %s/tests/config/drone/k8s/clamav %s/ocis-charts/charts/ocis/templates/" % (dirs ["base" ], dirs ["base" ]),
3840+ "sed -i 's/{{ *\\ \\ .Values\\ \\ .features\\ \\ .virusscan\\ \\ .infectedFileHandling *| *quote *}}/\" delete\" /' %s/ocis-charts/charts/ocis/templates/antivirus/deployment.yaml" % dirs ["base" ],
3841+ "sed -i 's/{{ *\\ \\ .Values\\ \\ .features\\ \\ .virusscan\\ \\ .infectedFileHandling *| *quote *}}/\" delete\" /' %s/ocis-charts/charts/ocis/templates/antivirus/deployment.yaml" % dirs ["base" ],
3842+ "sed -i '/name: ANTIVIRUS_SCANNER_TYPE/{n;s/value: *\" icap\" /value: \" clamav\" /}' %s/ocis-charts/charts/ocis/templates/antivirus/deployment.yaml" % dirs ["base" ],
3843+ "sed -i '/- name: ANTIVIRUS_SCANNER_TYPE/i\\ \\ - name: ANTIVIRUS_CLAMAV_SOCKET\\ \n value: \" tcp://clamav:3310\" ' %s/ocis-charts/charts/ocis/templates/antivirus/deployment.yaml" % dirs ["base" ],
3844+ ],
3845+ }]
3846+
3847+ def emailServiceK8s ():
3848+ return [{
3849+ "name" : "copy-%s-service" % EMAIL_SMTP_HOST ,
3850+ "image" : OC_CI_ALPINE ,
3851+ "commands" : [
3852+ "cp -r %s/tests/config/drone/k8s/mailpit %s/ocis-charts/charts/ocis/templates/" % (dirs ["base" ], dirs ["base" ]),
3853+ ],
3854+ }]
3855+
3856+ def exposeEmailServiceK8s ():
3857+ return [{
3858+ "name" : EMAIL_SMTP_HOST ,
3859+ "image" : "ghcr.io/k3d-io/k3d:5-dind" ,
3860+ "commands" : [
3861+ "kubectl port-forward svc/mailpit %s:%s -n ocis" % (EMAIL_PORT , EMAIL_PORT ),
3862+ "kubectl port-forward svc/mailpit 9174:9174 -n ocis" ,
3863+ ],
3864+ "detach" : True ,
3865+ }]
3866+
38373867def ociswrapper ():
38383868 return [{
38393869 "name" : "ociswrapper" ,
@@ -3844,6 +3874,8 @@ def ociswrapper():
38443874 "until test -f $${KUBECONFIG}; do sleep 1s; done" ,
38453875 "kubectl get pods -A" ,
38463876 "kubectl get ingress -A" ,
3877+ "kubectl describe pods $(kubectl get pods -n ocis -l app=antivirus -o jsonpath=\" {.items[0].metadata.name}\" ) -n ocis" ,
3878+ "kubectl describe pods $(kubectl get pods -n ocis -l app=postprocessing -o jsonpath=\" {.items[0].metadata.name}\" ) -n ocis" ,
38473879 "%s/bin/ociswrapper serve --url https://ocis-server --admin-username admin --admin-password admin --skip-ocis-run" % dirs ["ocisWrapper" ],
38483880 ],
38493881 "detach" : True ,
0 commit comments