@@ -62,6 +62,10 @@ func GetFunctionalTestCommand() cli.Command {
6262 Name : "description, de" ,
6363 Usage : "To provide test case description" ,
6464 },
65+ cli.StringFlag {
66+ Name : "image-config" ,
67+ Usage : "path to images config file" ,
68+ },
6569 }
6670
6771 listCmd := cli.Command {
@@ -421,6 +425,10 @@ func getFunctionalCloneVolumeCommand(globalFlags []cli.Flag) cli.Command {
421425 pvcName := c .String ("pvc-name" )
422426 podName := c .String ("pod-name" )
423427 accessMode := c .String ("access-mode" )
428+ testImage , err := getTestImage (c .String ("image-config" ))
429+ if err != nil {
430+ return fmt .Errorf ("failed to get test image: %s" , err )
431+ }
424432
425433 s := []suites.Interface {
426434 & suites.CloneVolumeSuite {
@@ -430,6 +438,7 @@ func getFunctionalCloneVolumeCommand(globalFlags []cli.Flag) cli.Command {
430438 CustomPvcName : pvcName ,
431439 CustomPodName : podName ,
432440 AccessMode : accessMode ,
441+ Image : testImage ,
433442 },
434443 }
435444
@@ -488,6 +497,10 @@ func getFunctionalProvisioningCommand(globalFlags []cli.Flag) cli.Command {
488497 desc := c .String ("description" )
489498 volAccessMode := c .String ("vol-access-mode" )
490499 roFlag := c .Bool ("roFlag" )
500+ testImage , err := getTestImage (c .String ("image-config" ))
501+ if err != nil {
502+ return fmt .Errorf ("failed to get test image: %s" , err )
503+ }
491504 s := []suites.Interface {
492505 & suites.ProvisioningSuite {
493506 VolumeNumber : volNum ,
@@ -497,6 +510,7 @@ func getFunctionalProvisioningCommand(globalFlags []cli.Flag) cli.Command {
497510 RawBlock : blockVol ,
498511 VolAccessMode : volAccessMode ,
499512 ROFlag : roFlag ,
513+ Image : testImage ,
500514 },
501515 }
502516
@@ -557,6 +571,10 @@ func getFunctionalSnapCreationCommand(globalFlags []cli.Flag) cli.Command {
557571 desc := c .String ("description" )
558572 snapName := c .String ("snap-name" )
559573 accessModeRestored := c .String ("access-mode-restored-volume" )
574+ testImage , err := getTestImage (c .String ("image-config" ))
575+ if err != nil {
576+ return fmt .Errorf ("failed to get test image: %s" , err )
577+ }
560578 s := []suites.Interface {
561579 & suites.SnapSuite {
562580 SnapClass : snapClass ,
@@ -566,6 +584,7 @@ func getFunctionalSnapCreationCommand(globalFlags []cli.Flag) cli.Command {
566584 CustomSnapName : snapName ,
567585 AccessModeOriginal : accessModeOriginal ,
568586 AccessModeRestored : accessModeRestored ,
587+ Image : testImage ,
569588 },
570589 }
571590
@@ -611,13 +630,17 @@ func getFunctionalMultiAttachVolCommand(globalFlags []cli.Flag) cli.Command {
611630 desc := c .String ("description" )
612631 isRawBlock := c .Bool ("block" )
613632 accessMode := c .String ("access-mode" )
614-
633+ testImage , err := getTestImage (c .String ("image-config" ))
634+ if err != nil {
635+ return fmt .Errorf ("failed to get test image: %s" , err )
636+ }
615637 s := []suites.Interface {
616638 & suites.MultiAttachSuite {
617639 PodNumber : pods ,
618640 RawBlock : isRawBlock ,
619641 Description : desc ,
620642 AccessMode : accessMode ,
643+ Image : testImage ,
621644 },
622645 }
623646
@@ -669,7 +692,10 @@ func getFunctionalEphemeralCreationCommand(globalFlags []cli.Flag) cli.Command {
669692 fsType := c .String ("fs-type" )
670693 attributesFile := c .String ("csi-attributes" )
671694 podName := c .String ("pod-name" )
672-
695+ testImage , err := getTestImage (c .String ("image-config" ))
696+ if err != nil {
697+ return fmt .Errorf ("failed to get test image: %s" , err )
698+ }
673699 // We will generate volumeAttributes by reading the properties file
674700 volAttributes , err := readEphemeralConfig (attributesFile )
675701 if err != nil {
@@ -685,6 +711,7 @@ func getFunctionalEphemeralCreationCommand(globalFlags []cli.Flag) cli.Command {
685711 VolumeAttributes : volAttributes ,
686712 Description : desc ,
687713 PodCustomName : podName ,
714+ Image : testImage ,
688715 },
689716 }
690717
@@ -850,12 +877,17 @@ func getCapacityTrackingCommand(globalFlags []cli.Flag) cli.Command {
850877 storageClass := c .String ("sc" )
851878 volumeSize := c .String ("volSize" )
852879 pollInterval := c .Duration ("poll-interval" )
880+ testImage , err := getTestImage (c .String ("image-config" ))
881+ if err != nil {
882+ return fmt .Errorf ("failed to get test image: %s" , err )
883+ }
853884 s := []suites.Interface {
854885 & suites.CapacityTrackingSuite {
855886 DriverNamespace : driverns ,
856887 StorageClass : storageClass ,
857888 VolumeSize : volumeSize ,
858889 PollInterval : pollInterval ,
890+ Image : testImage ,
859891 },
860892 }
861893
0 commit comments