Skip to content

Commit

Permalink
test: get smb server external ip
Browse files Browse the repository at this point in the history
fix

fix

fix

fix

fix
  • Loading branch information
andyzhangx committed Aug 14, 2024
1 parent 36bc85e commit 5ada9e2
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/e2e/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,25 @@ var _ = ginkgo.BeforeSuite(func() {
err := os.Chdir("test/e2e")
gomega.Expect(err).NotTo(gomega.HaveOccurred())
}()

getSMBPublicIPScript := "test/utils/get_smb_svc_public_ip.sh"
log.Printf("run script: %s\n", getSMBPublicIPScript)

cmd := exec.Command("bash", getSMBPublicIPScript)
output, err := cmd.CombinedOutput()
log.Printf("got output: %v, error: %v\n", string(output), err)
gomega.Expect(err).NotTo(gomega.HaveOccurred())

smbPublicIP := strings.TrimSuffix(string(output), "\n")
source := fmt.Sprintf("//%s/share", smbPublicIP)

log.Printf("use source on Windows: %v\n", source)
defaultStorageClassParameters["source"] = source
retainStorageClassParameters["source"] = source
archiveStorageClassParameters["source"] = source
archiveSubDirStorageClassParameters["source"] = source
subDirStorageClassParameters["source"] = source
noProvisionerSecretStorageClassParameters["source"] = source
}
})

Expand Down
18 changes: 18 additions & 0 deletions test/utils/get_smb_svc_public_ip.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

# Copyright 2020 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -e
kubectl get svc smb-server -n default | grep smb | awk '{print $4}'

0 comments on commit 5ada9e2

Please sign in to comment.