Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions tests/e2e/cloudprovider/test-lb-service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
19 changes: 15 additions & 4 deletions tests/e2e/csi/manila/manilavolume.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package test
import (
"bytes"
"context"
"os"
"os/exec"
"strconv"
"strings"
Expand All @@ -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...)
Expand Down Expand Up @@ -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,
Expand All @@ -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))

Expand Down
12 changes: 12 additions & 0 deletions tests/e2e/csi/manila/testdriver.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package test
import (
"context"
"fmt"
"os"

"github.com/onsi/gomega"
v1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
10 changes: 10 additions & 0 deletions tests/playbooks/roles/install-csi-cinder/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,16 @@

kubectl -n kube-system logs ds/openstack-cloud-controller-manager > /var/log/csi-pod/occm.log

- name: Collect pod logs for debug purpose (early collection on deployment failure)
shell:
executable: /bin/bash
cmd: |
set -x
mkdir -p /var/log/csi-pod
kubectl logs deployment/csi-cinder-controllerplugin -n kube-system -c cinder-csi-plugin > /var/log/csi-pod/deployment-csi-cinder-controllerplugin.log
kubectl logs daemonset/csi-cinder-nodeplugin -n kube-system -c cinder-csi-plugin > /var/log/csi-pod/deployment-csi-cinder-nodeplugin.log
ignore_errors: true

- name: &failmsg Stop due to prior failure of csi-cinder-plugin
fail:
msg: *failmsg
Expand Down
12 changes: 11 additions & 1 deletion tests/playbooks/roles/install-csi-manila/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
capabilities:
add: ["SYS_ADMIN"]
allowPrivilegeEscalation: true
image: quay.io/k8scsi/nfsplugin:v2.0.0
image: registry.k8s.io/sig-storage/nfsplugin:v4.12.1
args:
- "--nodeid=\$(NODE_ID)"
- "--endpoint=unix://plugin/csi.sock"
Expand Down Expand Up @@ -187,6 +187,16 @@
debug:
var: describe_csi.stdout_lines

- name: Collect pod logs for debug purpose (early collection on deployment failure)
shell:
executable: /bin/bash
cmd: |
set -x
mkdir -p /var/log/csi-pod
kubectl logs -l app=openstack-manila-csi,component=controllerplugin -n default -c nfs-nodeplugin --tail=-1 > /var/log/csi-pod/deployment-csi-manila-controllerplugin.log
kubectl logs -l app=openstack-manila-csi,component=nodeplugin -n default -c nfs-nodeplugin --tail=-1 > /var/log/csi-pod/deployment-csi-manila-nodeplugin.log
ignore_errors: true

- name: &failmsg Stop due to prior failure of manila-csi-plugin
fail:
msg: *failmsg
Expand Down
2 changes: 1 addition & 1 deletion tests/playbooks/roles/install-devstack/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
user: "stack"
workdir: "/home/{{ user }}/devstack"
branch: "stable/2025.1"
branch: "stable/2025.2"
enable_services:
- nova
- glance
Expand Down
29 changes: 26 additions & 3 deletions tests/playbooks/roles/install-k3s/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,39 @@
retries: 100
delay: 5

- name: Prepare kubectl and kubeconfig file
- name: Prepare kubeconfig file
shell:
executable: /bin/bash
cmd: |
set -ex

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
Expand Down