diff --git a/docs/manila-csi-plugin/using-manila-csi-plugin.md b/docs/manila-csi-plugin/using-manila-csi-plugin.md index fa748fff17..29be4ac5b6 100644 --- a/docs/manila-csi-plugin/using-manila-csi-plugin.md +++ b/docs/manila-csi-plugin/using-manila-csi-plugin.md @@ -71,6 +71,7 @@ Parameter | Required | Description ----------|----------|------------ `shareID` | if `shareName` is not given | The UUID of the share `shareName` | if `shareID` is not given | The name of the share +`shareAccessID` | _no_ | The UUID of the access rule for the share. This parameter is being deprecated and replaced by `shareAccessIDs`. `shareAccessIDs` | _yes_ | Comma separated UUIDs of access rules for the share `cephfs-mounter` | _no_ | Relevant for CephFS Manila shares. Specifies which mounting method to use with the CSI CephFS driver. Available options are `kernel` and `fuse`, defaults to `fuse`. See [CSI CephFS docs](https://github.com/ceph/ceph-csi/blob/csi-v1.0/docs/deploy-cephfs.md#configuration) for further information. `cephfs-kernelMountOptions` | _no_ | Relevant for CephFS Manila shares. Specifies mount options for CephFS kernel client. See [CSI CephFS docs](https://github.com/ceph/ceph-csi/blob/csi-v1.0/docs/deploy-cephfs.md#configuration) for further information. diff --git a/tests/e2e/cloudprovider/test-lb-service.sh b/tests/e2e/cloudprovider/test-lb-service.sh index cb57d6ec8c..55617f773f 100755 --- a/tests/e2e/cloudprovider/test-lb-service.sh +++ b/tests/e2e/cloudprovider/test-lb-service.sh @@ -57,7 +57,7 @@ function _check_lb_tags { local tags=$3 if [ -z "$tags" ]; then - tags=$(openstack loadbalancer show $lbID -f value -c tags) + tags=$(openstack loadbalancer show $lbID -f json -c tags | jq -r '.tags[]') tags=$(echo $tags) fi if [[ ! "$tags" =~ (^|[[:space:]])kube_service_(.+?)$svcName($|[[:space:]]) ]]; then @@ -468,7 +468,7 @@ EOF lbID=$(_check_service_lb_annotation "${service1}") printf "\n>>>>>>> Validating tags of openstack load balancer %s \n" "$lbID" - tags=$(openstack loadbalancer show $lbID -f value -c tags) + tags=$(openstack loadbalancer show $lbID -f json -c tags | jq -r '.tags[]') tags=$(echo $tags) _check_lb_tags $lbID $service1 "$tags" if [ $? -ne 0 ]; then @@ -509,7 +509,7 @@ EOF fi printf "\n>>>>>>> Validating tags of openstack load balancer %s \n" "$lbID" - tags=$(openstack loadbalancer show $lbID -f value -c tags) + tags=$(openstack loadbalancer show $lbID -f json -c tags | jq -r '.tags[]') tags=$(echo $tags) _check_lb_tags $lbID $service1 "$tags" if [ $? -ne 0 ]; then @@ -560,7 +560,7 @@ EOF wait_for_loadbalancer $lbID printf "\n>>>>>>> Validating tags of openstack load balancer %s \n" "$lbID" - tags=$(openstack loadbalancer show $lbID -f value -c tags) + tags=$(openstack loadbalancer show $lbID -f json -c tags | jq -r '.tags[]') tags=$(echo $tags) _check_lb_tags $lbID $service1 "$tags" if [ $? -ne 0 ]; then @@ -605,7 +605,7 @@ EOF wait_for_service_address ${service3} printf "\n>>>>>>> Validating tags of openstack load balancer %s \n" "$lbID" - tags=$(openstack loadbalancer show $lbID -f value -c tags) + tags=$(openstack loadbalancer show $lbID -f json -c tags | jq -r '.tags[]') tags=$(echo $tags) _check_lb_tags $lbID $service3 "$tags" if [ $? -ne 0 ]; then @@ -637,7 +637,7 @@ EOF sleep 10 printf "\n>>>>>>> Validating tags of openstack load balancer %s \n" "$lbID" - tags=$(openstack loadbalancer show $lbID -f value -c tags) + tags=$(openstack loadbalancer show $lbID -f json -c tags | jq -r '.tags[]') tags=$(echo $tags) _check_lb_tags $lbID $service1 "$tags" if [ $? -ne 0 ]; then @@ -660,7 +660,7 @@ EOF sleep 5 printf "\n>>>>>>> Validating tags of openstack load balancer %s \n" "$lbID" - tags=$(openstack loadbalancer show $lbID -f value -c tags) + tags=$(openstack loadbalancer show $lbID -f json -c tags | jq -r '.tags[]') tags=$(echo $tags) _check_lb_tags $lbID $service1 "$tags" if [ $? -ne 0 ]; then @@ -680,7 +680,7 @@ EOF wait_for_loadbalancer $lbID printf "\n>>>>>>> Validating tags of openstack load balancer %s \n" "$lbID" - tags=$(openstack loadbalancer show $lbID -f value -c tags) + tags=$(openstack loadbalancer show $lbID -f json -c tags | jq -r '.tags[]') tags=$(echo $tags) _check_lb_tags $lbID $service1 "$tags" if [ $? -eq 0 ]; then @@ -778,7 +778,7 @@ EOF lbID=$(_check_service_lb_annotation "${service1}") printf "\n>>>>>>> Validating tags of openstack load balancer %s \n" "$lbID" - tags=$(openstack loadbalancer show $lbID -f value -c tags) + tags=$(openstack loadbalancer show $lbID -f json -c tags | jq -r '.tags[]') tags=$(echo $tags) _check_lb_tags $lbID $service1 "$tags" if [ $? -ne 0 ]; then @@ -792,7 +792,7 @@ EOF wait_for_service_deleted ${service1} printf "\n>>>>>>> Validating tags of openstack load balancer %s \n" "$lbID" - tags=$(openstack loadbalancer show $lbID -f value -c tags) + tags=$(openstack loadbalancer show $lbID -f json -c tags | jq -r '.tags[]') tags=$(echo $tags) _check_lb_tags $lbID $service1 "$tags" if [ $? -eq 0 ]; then diff --git a/tests/e2e/csi/manila/manilavolume.go b/tests/e2e/csi/manila/manilavolume.go index a322236565..fa13381fcc 100644 --- a/tests/e2e/csi/manila/manilavolume.go +++ b/tests/e2e/csi/manila/manilavolume.go @@ -3,6 +3,7 @@ package test import ( "bytes" "context" + "os" "os/exec" "strconv" "strings" @@ -13,6 +14,10 @@ import ( storageframework "k8s.io/kubernetes/test/e2e/storage/framework" ) +// Environment variable for DHSS=True mode share network. +// This must match the variable in testdriver.go. +var manilaShareNetworkIDForVolume = os.Getenv("MANILA_SHARE_NETWORK_ID") + func runCmd(name string, args ...string) ([]byte, error) { var stdout, stderr bytes.Buffer cmd := exec.Command(name, args...) @@ -47,9 +52,8 @@ func manilaCreateVolume( ginkgo.By("Creating a test Manila volume externally") // Create share. - - out, err := runCmd( - "openstack", + // Build command arguments, optionally including share network for DHSS=True mode. + args := []string{ "share", "create", shareProto, @@ -58,7 +62,14 @@ func manilaCreateVolume( "--format=value", "--column=id", "--wait", - ) + } + + // Support for DHSS=True mode: include share network ID if specified + if manilaShareNetworkIDForVolume != "" { + args = append(args, "--share-network="+manilaShareNetworkIDForVolume) + } + + out, err := runCmd("openstack", args...) shareID := strings.TrimSpace(string(out)) diff --git a/tests/e2e/csi/manila/testdriver.go b/tests/e2e/csi/manila/testdriver.go index 46ca175c67..b152065f6f 100644 --- a/tests/e2e/csi/manila/testdriver.go +++ b/tests/e2e/csi/manila/testdriver.go @@ -3,6 +3,7 @@ package test import ( "context" "fmt" + "os" "github.com/onsi/gomega" v1 "k8s.io/api/core/v1" @@ -30,6 +31,12 @@ const ( manilaShareSizeGiB = 1 ) +// Environment variables for DHSS=True (driver_handles_share_servers) mode. +// Set MANILA_SHARE_NETWORK_ID to enable testing with share networks. +var ( + manilaShareNetworkID = os.Getenv("MANILA_SHARE_NETWORK_ID") +) + type manilaTestDriver struct { driverInfo storageframework.DriverInfo volumeAttributes []map[string]string @@ -129,6 +136,11 @@ func (d *manilaTestDriver) GetDynamicProvisionStorageClass(ctx context.Context, "csi.storage.k8s.io/node-publish-secret-namespace": manilaSecretNamespace, } + // Support for DHSS=True mode: include share network ID if specified + if manilaShareNetworkID != "" { + parameters["shareNetworkID"] = manilaShareNetworkID + } + sc := storageframework.GetStorageClass( d.driverInfo.Name, parameters, diff --git a/tests/playbooks/roles/install-devstack/defaults/main.yaml b/tests/playbooks/roles/install-devstack/defaults/main.yaml index c73699bbd5..7b2c47404f 100644 --- a/tests/playbooks/roles/install-devstack/defaults/main.yaml +++ b/tests/playbooks/roles/install-devstack/defaults/main.yaml @@ -1,7 +1,7 @@ --- user: "stack" workdir: "/home/{{ user }}/devstack" -branch: "stable/2025.1" +branch: "stable/2025.2" enable_services: - nova - glance diff --git a/tests/playbooks/roles/install-k3s/tasks/main.yaml b/tests/playbooks/roles/install-k3s/tasks/main.yaml index 75863d85eb..26530979d4 100644 --- a/tests/playbooks/roles/install-k3s/tasks/main.yaml +++ b/tests/playbooks/roles/install-k3s/tasks/main.yaml @@ -154,7 +154,7 @@ retries: 100 delay: 5 -- name: Prepare kubectl and kubeconfig file +- name: Prepare kubeconfig file shell: executable: /bin/bash cmd: | @@ -162,8 +162,31 @@ mkdir -p {{ ansible_user_dir }}/.kube scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i {{ ansible_user_dir }}/.ssh/id_rsa ubuntu@{{ k3s_fip }}:/etc/rancher/k3s/k3s.yaml {{ ansible_user_dir }}/.kube/config - curl -sLO# https://dl.k8s.io/release/$(curl -Ls https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl - chmod +x ./kubectl; sudo mv ./kubectl /usr/local/bin/kubectl + +- name: Get latest kubectl version + uri: + url: https://dl.k8s.io/release/stable.txt + return_content: yes + register: kubectl_version + retries: 5 + delay: 10 + until: kubectl_version.status == 200 + +- name: Download kubectl binary + get_url: + url: "https://dl.k8s.io/release/{{ kubectl_version.content | trim }}/bin/linux/amd64/kubectl" + dest: /usr/local/bin/kubectl + mode: '0755' + become: true + retries: 5 + delay: 10 + +- name: Set kubectl cluster config + shell: + executable: /bin/bash + cmd: | + set -ex + kubectl config set-cluster default --server=https://{{ k3s_fip }}:6443 --kubeconfig {{ ansible_user_dir }}/.kube/config - name: Wait for k8s node ready