mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
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 ```
This commit is contained in:
commit
e35ecf1618
@ -541,6 +541,10 @@ func TestAttacherMountDevice(t *testing.T) {
|
|||||||
csiAttacher := attacher.(*csiAttacher)
|
csiAttacher := attacher.(*csiAttacher)
|
||||||
csiAttacher.csiClient = setupClient(t, tc.stageUnstageSet)
|
csiAttacher.csiClient = setupClient(t, tc.stageUnstageSet)
|
||||||
|
|
||||||
|
if tc.deviceMountPath != "" {
|
||||||
|
tc.deviceMountPath = filepath.Join(tmpDir, tc.deviceMountPath)
|
||||||
|
}
|
||||||
|
|
||||||
nodeName := string(csiAttacher.plugin.host.GetNodeName())
|
nodeName := string(csiAttacher.plugin.host.GetNodeName())
|
||||||
|
|
||||||
// Create spec
|
// Create spec
|
||||||
@ -649,6 +653,8 @@ func TestAttacherUnmountDevice(t *testing.T) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
testName: "stage_unstage not set no vars should not fail",
|
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,
|
stageUnstageSet: false,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user