Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSI sanity test failure for ControllerExpandVolume due to wrong volume size in ControllerExpandVolumeResponse #218

Closed
wnxn opened this issue Sep 22, 2019 · 0 comments · Fixed by #219

Comments

@wnxn
Copy link
Contributor

wnxn commented Sep 22, 2019

CSI sanity test output reports ExpandVolume test case failed when my storage plugin tested through CSI sanity test v2.2.0. The CSI sanity test expect 11 GB, but my storage plugin returns 20 GB after expanding volume.
My storage system expands volume 10 GB each time. But the sanity test set the DefTestExpandIncrement as 1 GB each time. I think we can add a flag in CSI sanity test to allow user to set the TestVolumeExpandSize.

Test output:

------------------------------
••STEP: reusing connection to CSI driver at /var/lib/kubelet/plugins/disk.csi.qingcloud.com/csi.sock
STEP: creating mount and staging directories
STEP: creating a new volume
STEP: expanding the volume
cleanup: deleting sanity-expand-volume-D08CE596-10087AD6 = vol-9qxvld3m

------------------------------
• Failure [45.027 seconds]
ExpandVolume [Controller Server]
/root/mygo/src/github.com/kubernetes-csi/csi-test/pkg/sanity/tests.go:44
  should work [It]
  /root/mygo/src/github.com/kubernetes-csi/csi-test/pkg/sanity/controller.go:2123

  Expected
      <int64>: 21474836480
  to equal
      <int64>: 11811160064

  /root/mygo/src/github.com/kubernetes-csi/csi-test/pkg/sanity/controller.go:2163
------------------------------

func init() {
flag.StringVar(&config.Address, prefix+"endpoint", "", "CSI endpoint")
flag.StringVar(&config.ControllerAddress, prefix+"controllerendpoint", "", "CSI controller endpoint")
flag.BoolVar(&version, prefix+"version", false, "Version of this program")
flag.StringVar(&config.TargetPath, prefix+"mountdir", os.TempDir()+"/csi-mount", "Mount point for NodePublish")
flag.StringVar(&config.StagingPath, prefix+"stagingdir", os.TempDir()+"/csi-staging", "Mount point for NodeStage if staging is supported")
flag.StringVar(&config.CreateTargetPathCmd, prefix+"createmountpathcmd", "", "Command to run for target path creation")
flag.StringVar(&config.CreateStagingPathCmd, prefix+"createstagingpathcmd", "", "Command to run for staging path creation")
flag.IntVar(&config.CreatePathCmdTimeout, prefix+"createpathcmdtimeout", 10, "Timeout for the commands to create target and staging paths, in seconds")
flag.StringVar(&config.RemoveTargetPathCmd, prefix+"removemountpathcmd", "", "Command to run for target path removal")
flag.StringVar(&config.RemoveStagingPathCmd, prefix+"removestagingpathcmd", "", "Command to run for staging path removal")
flag.IntVar(&config.RemovePathCmdTimeout, prefix+"removepathcmdtimeout", 10, "Timeout for the commands to remove target and staging paths, in seconds")
flag.StringVar(&config.SecretsFile, prefix+"secrets", "", "CSI secrets file")
flag.Int64Var(&config.TestVolumeSize, prefix+"testvolumesize", sanity.DefTestVolumeSize, "Base volume size used for provisioned volumes")
flag.StringVar(&config.TestVolumeParametersFile, prefix+"testvolumeparameters", "", "YAML file of volume parameters for provisioned volumes")
flag.BoolVar(&config.TestNodeVolumeAttachLimit, prefix+"testnodevolumeattachlimit", false, "Test node volume attach limit")
flag.StringVar(&config.JUnitFile, prefix+"junitfile", "", "JUnit XML output file where test results will be written")
flag.Parse()
}

func TestVolumeExpandSize(sc *SanityContext) int64 {
if sc.Config.TestVolumeExpandSize > 0 {
return sc.Config.TestVolumeExpandSize
}
return TestVolumeSize(sc) + DefTestExpandIncrement
}

stmcginnis pushed a commit to stmcginnis/csi-test that referenced this issue Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant