@@ -19,6 +19,7 @@ import (
1919 "flag"
2020 "fmt"
2121 "os"
22+ "strings"
2223 "time"
2324
2425 "github.com/kubernetes-csi/csi-test/v3/pkg/sanity"
@@ -78,6 +79,7 @@ func main() {
7879 stringVar (& config .RemoveStagingPathCmd , "removestagingpathcmd" , "Command to run for staging path removal" )
7980 durationVar (& config .RemovePathCmdTimeout , "removepathcmdtimeout" , "Timeout for the commands to remove target and staging paths, in seconds" )
8081 stringVar (& config .SecretsFile , "secrets" , "CSI secrets file" )
82+ stringVar (& config .TestVolumeAccessType , "testvolumeaccesstype" , "Volume capability access type, valid values are mount or block" )
8183 int64Var (& config .TestVolumeSize , "testvolumesize" , "Base volume size used for provisioned volumes" )
8284 int64Var (& config .TestVolumeExpandSize , "testvolumeexpandsize" , "Target size for expanded volumes" )
8385 stringVar (& config .TestVolumeParametersFile , "testvolumeparameters" , "YAML file of volume parameters for provisioned volumes" )
@@ -94,6 +96,10 @@ func main() {
9496 fmt .Printf ("--%sendpoint must be provided with an CSI endpoint\n " , prefix )
9597 os .Exit (1 )
9698 }
99+ if at := strings .TrimSpace (strings .ToLower (config .TestVolumeAccessType )); ! (at == "mount" || at == "block" ) {
100+ fmt .Printf ("--%stestvolumeaccesstype valid values are mount or block\n " , prefix )
101+ os .Exit (1 )
102+ }
97103
98104 t := testing {}
99105 sanity .Test (& t , config )
0 commit comments