Skip to content

Commit 2f52ae2

Browse files
committed
fix ut windows
1 parent 2d3abc1 commit 2f52ae2

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

pkg/blob/azure_test.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"fmt"
2222
"os"
2323
"reflect"
24+
"runtime"
2425
"strings"
2526
"syscall"
2627
"testing"
@@ -92,11 +93,17 @@ users:
9293
expectedErr: nil,
9394
},
9495
{
95-
desc: "[failure][disallowEmptyCloudConfig] out of cluster, no kubeconfig, no credential file",
96+
desc: "[linux][failure][disallowEmptyCloudConfig] out of cluster, no kubeconfig, no credential file",
9697
nodeID: "",
9798
allowEmptyCloudConfig: false,
9899
expectedErr: syscall.ENOENT,
99100
},
101+
{
102+
desc: "[windows][failure][disallowEmptyCloudConfig] out of cluster, no kubeconfig, no credential file",
103+
nodeID: "",
104+
allowEmptyCloudConfig: false,
105+
expectedErr: syscall.ENOTDIR,
106+
},
100107
{
101108
desc: "[success] out of cluster & in cluster, specify a fake kubeconfig, no credential file",
102109
createFakeKubeConfig: true,
@@ -117,6 +124,12 @@ users:
117124

118125
var kubeClient kubernetes.Interface
119126
for _, test := range tests {
127+
if strings.HasPrefix(test.desc, "[linux]") && runtime.GOOS == "windows" {
128+
continue
129+
}
130+
if strings.HasPrefix(test.desc, "[windows]") && runtime.GOOS == "linux" {
131+
continue
132+
}
120133
if test.createFakeKubeConfig {
121134
if err := createTestFile(fakeKubeConfig); err != nil {
122135
t.Error(err)

0 commit comments

Comments
 (0)