Skip to content

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

@wnxn

Description

@wnxn

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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions