@@ -19,6 +19,7 @@ import (
19
19
"flag"
20
20
"fmt"
21
21
"os"
22
+ "strings"
22
23
"time"
23
24
24
25
"github.com/kubernetes-csi/csi-test/v3/pkg/sanity"
@@ -78,6 +79,7 @@ func main() {
78
79
stringVar (& config .RemoveStagingPathCmd , "removestagingpathcmd" , "Command to run for staging path removal" )
79
80
durationVar (& config .RemovePathCmdTimeout , "removepathcmdtimeout" , "Timeout for the commands to remove target and staging paths, in seconds" )
80
81
stringVar (& config .SecretsFile , "secrets" , "CSI secrets file" )
82
+ stringVar (& config .TestVolumeAccessType , "testvolumeaccesstype" , "Volume capability access type, valid values are mount or block" )
81
83
int64Var (& config .TestVolumeSize , "testvolumesize" , "Base volume size used for provisioned volumes" )
82
84
int64Var (& config .TestVolumeExpandSize , "testvolumeexpandsize" , "Target size for expanded volumes" )
83
85
stringVar (& config .TestVolumeParametersFile , "testvolumeparameters" , "YAML file of volume parameters for provisioned volumes" )
@@ -94,6 +96,10 @@ func main() {
94
96
fmt .Printf ("--%sendpoint must be provided with an CSI endpoint\n " , prefix )
95
97
os .Exit (1 )
96
98
}
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
+ }
97
103
98
104
t := testing {}
99
105
sanity .Test (& t , config )
0 commit comments