mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #61738 from ianchakeres/osx-volume-ut-fix
Automatic merge from submit-queue (batch tested with PRs 61452, 61727, 61462, 61692, 61738). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Skip volume unit tests that don't work on osx. **What this PR does / why we need it**: `volume/fc` and `volume/rbd` unit tests fail on osx. ``` $ pwd <snip>/gopath/src/k8s.io/kubernetes/pkg/volume/fc $ go test --- FAIL: Test_ConstructVolumeSpec (0.00s) fc_test.go:450: couldn't fetch mountrefs fc_test.go:469: failed to retrieve WWIDs fc_test.go:450: couldn't fetch mountrefs fc_test.go:469: failed to retrieve WWIDs FAIL exit status 1 FAIL k8s.io/kubernetes/pkg/volume/fc 0.054s <snip> $ pwd <snip>/gopath/src/k8s.io/kubernetes/pkg/volume/rbd $ go test --- FAIL: TestConstructVolumeSpec (0.00s) rbd_test.go:575: ConstructVolumeSpec failed: directory /var/folders/59/yc7_f4fd53nbyw868zqpk78cn7shx9/T/rbd_test144865306/pods/pod123/volumes/kubernetes.io~rbd/vol is not mounted rbd_test.go:575: ConstructVolumeSpec failed: directory /var/folders/59/yc7_f4fd53nbyw868zqpk78cn7shx9/T/rbd_test144865306/pods/pod123/volumes/kubernetes.io~rbd/vol is not mounted FAIL exit status 1 FAIL k8s.io/kubernetes/pkg/volume/rbd 0.063s ``` **Which issue(s) this PR fixes** : Fixes #61569 and #61571 **Special notes for your reviewer**: To see these unit test fail, you need to run `go test` on an osx machine. **Release note**: ```release-note NONE ```
This commit is contained in:
commit
06e3fefc21
@ -19,6 +19,7 @@ package fc
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
@ -424,6 +425,9 @@ func Test_getWwnsLunWwidsError(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Test_ConstructVolumeSpec(t *testing.T) {
|
func Test_ConstructVolumeSpec(t *testing.T) {
|
||||||
|
if runtime.GOOS == "darwin" {
|
||||||
|
t.Skipf("Test_ConstructVolumeSpec is not supported on GOOS=%s", runtime.GOOS)
|
||||||
|
}
|
||||||
fm := &mount.FakeMounter{
|
fm := &mount.FakeMounter{
|
||||||
MountPoints: []mount.MountPoint{
|
MountPoints: []mount.MountPoint{
|
||||||
{Device: "/dev/sdb", Path: "/var/lib/kubelet/pods/some-pod/volumes/kubernetes.io~fc/fc-in-pod1"},
|
{Device: "/dev/sdb", Path: "/var/lib/kubelet/pods/some-pod/volumes/kubernetes.io~fc/fc-in-pod1"},
|
||||||
|
@ -21,6 +21,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"testing"
|
"testing"
|
||||||
@ -532,6 +533,9 @@ func TestGetDeviceMountPath(t *testing.T) {
|
|||||||
|
|
||||||
// https://github.com/kubernetes/kubernetes/issues/57744
|
// https://github.com/kubernetes/kubernetes/issues/57744
|
||||||
func TestConstructVolumeSpec(t *testing.T) {
|
func TestConstructVolumeSpec(t *testing.T) {
|
||||||
|
if runtime.GOOS == "darwin" {
|
||||||
|
t.Skipf("TestConstructVolumeSpec is not supported on GOOS=%s", runtime.GOOS)
|
||||||
|
}
|
||||||
tmpDir, err := utiltesting.MkTmpdir("rbd_test")
|
tmpDir, err := utiltesting.MkTmpdir("rbd_test")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("error creating temp dir: %v", err)
|
t.Fatalf("error creating temp dir: %v", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user