mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
fix ipv6 test case
This commit is contained in:
parent
124b71bd11
commit
e05a8403c8
@ -18,6 +18,7 @@ package nfs
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net"
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
@ -118,6 +119,18 @@ func doTestPlugin(t *testing.T, spec *volume.Spec) {
|
|||||||
if mounter == nil {
|
if mounter == nil {
|
||||||
t.Errorf("Got a nil Mounter")
|
t.Errorf("Got a nil Mounter")
|
||||||
}
|
}
|
||||||
|
if nfsm, ok := mounter.(*nfsMounter); ok {
|
||||||
|
srvr := nfsm.server
|
||||||
|
vol, _, _ := getVolumeSource(spec)
|
||||||
|
expectedSrvr := vol.Server
|
||||||
|
// check cluster IP version
|
||||||
|
if net.ParseIP(expectedSrvr).To16() != nil {
|
||||||
|
expectedSrvr = fmt.Sprintf("[%s]", expectedSrvr)
|
||||||
|
}
|
||||||
|
if srvr != expectedSrvr {
|
||||||
|
t.Errorf("Unexpected nfs server, expected %q, got: %q", expectedSrvr, srvr)
|
||||||
|
}
|
||||||
|
}
|
||||||
volumePath := mounter.GetPath()
|
volumePath := mounter.GetPath()
|
||||||
expectedPath := fmt.Sprintf("%s/pods/poduid/volumes/kubernetes.io~nfs/vol1", tmpDir)
|
expectedPath := fmt.Sprintf("%s/pods/poduid/volumes/kubernetes.io~nfs/vol1", tmpDir)
|
||||||
if volumePath != expectedPath {
|
if volumePath != expectedPath {
|
||||||
|
Loading…
Reference in New Issue
Block a user