diff --git a/.ci/run-webdav-tests.sh b/.ci/run-webdav-tests.sh new file mode 100755 index 00000000000..40ba824bc66 --- /dev/null +++ b/.ci/run-webdav-tests.sh @@ -0,0 +1,56 @@ +#!/bin/sh + +. /init-grid-ui.sh + +yum install -y -q python36-urllib3 + + +export DFTS_SUT=https://store-door-svc.$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local:8083 + + + +cat > propfind.py <" + +cntxt = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) +cntxt.verify_mode = ssl.CERT_REQUIRED +cntxt.verify_flags = ssl.VERIFY_DEFAULT +cntxt.check_hostname = True + +CSWD_VERSION = "v2.00.01" +CSWD_CAPATH = "/etc/grid-security/certificates" +CSWD_PROPOCOL_BAD = ["SSL", "SSLv2", "SSLv3", "TLS", "TLSv1", "TLSv1.1"] + +cntxt.load_verify_locations(capath=CSWD_CAPATH) +cntxt.load_cert_chain(x509vo, x509vo) + +requestObj = urllib.request.Request(requestURL, data=PROPFIND_DATA.encode("utf-8"), headers=PROPFIND_HDR, method="PROPFIND") +responseObj = urllib.request.urlopen(requestObj, timeout=90, context=cntxt) + +print(responseObj.status) +print(responseObj.msg) +print(responseObj.reason) +print(responseObj.code) + +urlCharset = responseObj.headers.get_content_charset() +xmlData = responseObj.read().decode( urlCharset ) +print(xmlData) + +EOF + +python3 ./propfind.py $DFTS_SUT diff --git a/.ci/webdav-wn-cvmfs.yaml b/.ci/webdav-wn-cvmfs.yaml new file mode 100644 index 00000000000..67ba39ede1c --- /dev/null +++ b/.ci/webdav-wn-cvmfs.yaml @@ -0,0 +1,21 @@ +apiVersion: v1 +kind: Pod +metadata: + name: webdav-tester +spec: + containers: + - name: tester + image: centos:7 + imagePullPolicy: IfNotPresent + command: [ "/bin/sleep", "inf"] + volumeMounts: + - name: cvmfs + mountPath: /cvmfs + # CVMFS automount volumes must be mounted with HostToContainer mount propagation. + mountPropagation: HostToContainer + volumes: + - name: cvmfs + persistentVolumeClaim: + claimName: cvmfs + + diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fe7a8ccd2e6..db05f566a2f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -434,6 +434,18 @@ gsi_xroot_tests: - kubectl -n $K8S_NAMESPACE cp .ci/run-xroot-tests.sh xroot-tester:/run-xroot-tests.sh - kubectl -n $K8S_NAMESPACE exec xroot-tester -- /bin/sh /run-xroot-tests.sh +webdav_with_x509_tests: + stage: testing + extends: .kubernetes_image + script: + - kubectl -n $K8S_NAMESPACE apply -f .ci/cvmfs-volume-storageclass-pvc.yaml + - kubectl -n $K8S_NAMESPACE apply -f .ci/webdav-wn-cvmfs.yaml + - while ! kubectl -n $K8S_NAMESPACE wait --for=condition=Ready pod webdav-tester; do sleep 1; done + - kubectl -n $K8S_NAMESPACE exec webdav-tester -- ls /cvmfs/grid.cern.ch/umd-c7wn-latest/etc/profile.d/setup-c7-wn-example.sh + - kubectl -n $K8S_NAMESPACE cp .ci/init-grid-ui.sh webdav-tester:/init-grid-ui.sh + - kubectl -n $K8S_NAMESPACE cp .ci/run-webdav-tests.sh webdav-tester:/run-webdav-tests.sh + - kubectl -n $K8S_NAMESPACE exec webdav-tester -- /bin/sh /run-webdav-tests.sh + pynfs_tests: stage: testing extends: .kubernetes_image