mirror of https://github.com/k3s-io/k3s
Merge pull request #65573 from CaoShuFeng/csi
Automatic merge from submit-queue (batch tested with PRs 65628, 65573). 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>. run test TestAttacherMountDevice in temp directory This change fix two unit test: 1. After run command `make test WHAT=k8s.io/kubernetes/pkg/volume/csi KUBE_TEST_ARGS='-run ^TestAttacherMountDevice$'` There is a file leaked in work space: pkg/volume/csi/vol_data.json 2. make test WHAT=k8s.io/kubernetes/pkg/volume/csi KUBE_TEST_ARGS='-run ^TestAttacherUnmountDevice$' This test fails if it does not run along with TestAttacherMountDevice. This change fix it. **What this PR does / why we need it**: **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```pull/8/head
commit
e35ecf1618
|
@ -541,6 +541,10 @@ func TestAttacherMountDevice(t *testing.T) {
|
|||
csiAttacher := attacher.(*csiAttacher)
|
||||
csiAttacher.csiClient = setupClient(t, tc.stageUnstageSet)
|
||||
|
||||
if tc.deviceMountPath != "" {
|
||||
tc.deviceMountPath = filepath.Join(tmpDir, tc.deviceMountPath)
|
||||
}
|
||||
|
||||
nodeName := string(csiAttacher.plugin.host.GetNodeName())
|
||||
|
||||
// Create spec
|
||||
|
@ -649,6 +653,8 @@ func TestAttacherUnmountDevice(t *testing.T) {
|
|||
},
|
||||
{
|
||||
testName: "stage_unstage not set no vars should not fail",
|
||||
deviceMountPath: "plugins/csi/pv/test-pv-name/globalmount",
|
||||
jsonFile: `{"driverName":"test-driver","volumeHandle":"test-vol1"}`,
|
||||
stageUnstageSet: false,
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue