Skip to content

Commit 06e3fef

Browse files
author
Kubernetes Submit Queue
authored
Merge pull request kubernetes#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 kubernetes#61569 and kubernetes#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 ```
2 parents 2b03013 + 470980d commit 06e3fef

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

pkg/volume/fc/fc_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package fc
1919
import (
2020
"fmt"
2121
"os"
22+
"runtime"
2223
"strconv"
2324
"strings"
2425
"testing"
@@ -424,6 +425,9 @@ func Test_getWwnsLunWwidsError(t *testing.T) {
424425
}
425426

426427
func Test_ConstructVolumeSpec(t *testing.T) {
428+
if runtime.GOOS == "darwin" {
429+
t.Skipf("Test_ConstructVolumeSpec is not supported on GOOS=%s", runtime.GOOS)
430+
}
427431
fm := &mount.FakeMounter{
428432
MountPoints: []mount.MountPoint{
429433
{Device: "/dev/sdb", Path: "/var/lib/kubelet/pods/some-pod/volumes/kubernetes.io~fc/fc-in-pod1"},

pkg/volume/rbd/rbd_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"os"
2222
"path/filepath"
2323
"reflect"
24+
"runtime"
2425
"strings"
2526
"sync"
2627
"testing"
@@ -532,6 +533,9 @@ func TestGetDeviceMountPath(t *testing.T) {
532533

533534
// https://github.com/kubernetes/kubernetes/issues/57744
534535
func TestConstructVolumeSpec(t *testing.T) {
536+
if runtime.GOOS == "darwin" {
537+
t.Skipf("TestConstructVolumeSpec is not supported on GOOS=%s", runtime.GOOS)
538+
}
535539
tmpDir, err := utiltesting.MkTmpdir("rbd_test")
536540
if err != nil {
537541
t.Fatalf("error creating temp dir: %v", err)

0 commit comments

Comments
 (0)