From 53d52016fe42d6278239c8df2059dfc9ec052dce Mon Sep 17 00:00:00 2001 From: alikdell <52920355+alikdell@users.noreply.github.com> Date: Tue, 15 Mar 2022 09:23:44 -0400 Subject: [PATCH] Update privateMountDir path for unity nfs (#113) * change mount dir for nfs volume mount * increase failsecs for unity test cases with retry need more time --- internal/monitor/driver.go | 5 ++- internal/monitor/features/integration.feature | 38 +++++++++---------- internal/monitor/integration_steps_test.go | 4 ++ 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/internal/monitor/driver.go b/internal/monitor/driver.go index ec12f3f..98de59e 100644 --- a/internal/monitor/driver.go +++ b/internal/monitor/driver.go @@ -13,9 +13,10 @@ package monitor import ( "fmt" - log "github.com/sirupsen/logrus" "os" "strings" + + log "github.com/sirupsen/logrus" ) type drivertype interface { @@ -103,7 +104,7 @@ func (d *UnityDriver) GetDriverName() string { //GetDriverMountDir returns the Unity private mount directory. func (d *UnityDriver) GetDriverMountDir(volumeHandle, pvName, podUUID string) string { - privateMountDir := fmt.Sprintf("/var/lib/kubelet/plugins/kubernetes.io/csi/pv/%s/mount", pvName) + privateMountDir := fmt.Sprintf("/var/lib/kubelet/pods/%s/volumes/kubernetes.io~csi/%s/mount", podUUID, pvName) log.Debugf("privateMountDir: %s", privateMountDir) return privateMountDir } diff --git a/internal/monitor/features/integration.feature b/internal/monitor/features/integration.feature index 7e0d3d3..b9314b2 100644 --- a/internal/monitor/features/integration.feature +++ b/internal/monitor/features/integration.feature @@ -94,12 +94,12 @@ Feature: Integration Test Examples: | kubeConfig | podsPerNode | nVol | nDev | driverType | storageClass | workers | primary | failure | failSecs | deploySecs | runSecs | nodeCleanSecs | # Small number of pods, increasing number of vols and devs - | "" | "1-2" | "1-1" | "1-1" | "unity" | "unity-iscsi" | "one-third" | "zero" | "interfacedown" | 240 | 900 | 900 | 900 | + | "" | "1-2" | "1-1" | "1-1" | "unity" | "unity-iscsi" | "one-third" | "zero" | "interfacedown" | 600 | 900 | 900 | 900 | # | "" | "1-2" | "2-2" | "2-2" | "unity" | "unity-iscsi" | "one-third" | "zero" | "interfacedown" | 240 | 900 | 900 | 900 | # | "" | "1-2" | "4-4" | "4-4" | "unity" | "unity-iscsi" | "one-third" | "zero" | "interfacedown" | 240 | 900 | 900 | 900 | # Slightly more pods, increasing number of vols and devs # | "" | "3-5" | "1-1" | "1-1" | "unity" | "unity-iscsi" | "one-third" | "zero" | "interfacedown" | 240 | 900 | 900 | 900 | - | "" | "3-5" | "2-2" | "2-2" | "unity" | "unity-iscsi" | "one-third" | "zero" | "interfacedown" | 240 | 900 | 900 | 900 | + | "" | "3-5" | "2-2" | "2-2" | "unity" | "unity-iscsi" | "one-third" | "zero" | "interfacedown" | 600 | 900 | 900 | 900 | # | "" | "3-5" | "4-4" | "4-4" | "unity" | "unity-iscsi" | "one-third" | "zero" | "interfacedown" | 240 | 1500 | 900 | 900 | @unity-integration @@ -118,12 +118,12 @@ Feature: Integration Test Examples: | kubeConfig | podsPerNode | nVol | nDev | driverType | storageClass | workers | primary | failure | failSecs | deploySecs | runSecs | nodeCleanSecs | # Small number of pods, increasing number of vols and devs - | "" | "1-2" | "1-1" | "0-0" | "unity" | "unity-nfs" | "one-third" | "zero" | "interfacedown" | 240 | 900 | 900 | 900 | + | "" | "1-2" | "1-1" | "0-0" | "unity" | "unity-nfs" | "one-third" | "zero" | "interfacedown" | 600 | 900 | 900 | 900 | # | "" | "1-2" | "2-2" | "0-0" | "unity" | "unity-nfs" | "one-third" | "zero" | "interfacedown" | 240 | 900 | 900 | 900 | # | "" | "1-2" | "4-4" | "0-0" | "unity" | "unity-nfs" | "one-third" | "zero" | "interfacedown" | 240 | 900 | 900 | 900 | # Slightly more pods, increasing number of vols and devs # | "" | "3-5" | "1-1" | "0-0" | "unity" | "unity-nfs" | "one-third" | "zero" | "interfacedown" | 240 | 900 | 900 | 900 | - | "" | "3-5" | "2-2" | "0-0" | "unity" | "unity-nfs" | "one-third" | "zero" | "interfacedown" | 240 | 900 | 900 | 900 | + | "" | "3-5" | "2-2" | "0-0" | "unity" | "unity-nfs" | "one-third" | "zero" | "interfacedown" | 600 | 900 | 900 | 900 | # | "" | "3-5" | "4-4" | "0-0" | "unity" | "unity-nfs" | "one-third" | "zero" | "interfacedown" | 240 | 1500 | 900 | 900 | @unity-integration @@ -206,13 +206,13 @@ Feature: Integration Test # Examples: # | kubeConfig | podsPerNode | nVol | nDev | driverType | storageClass | workers | primary | failure | failSecs | deploySecs | runSecs | nodeCleanSecs | # # Small number of pods, increasing number of vols and devs -# | "" | "1-2" | "1-1" | "1-1" | "unity" | "unity-iscsi" | "one-third" | "zero" | "reboot" | 240 | 900 | 900 | 600 | -# | "" | "1-2" | "2-2" | "2-2" | "unity" | "unity-iscsi" | "one-third" | "zero" | "reboot" | 240 | 900 | 900 | 600 | -# | "" | "1-2" | "4-4" | "4-4" | "unity" | "unity-iscsi" | "one-third" | "zero" | "reboot" | 240 | 900 | 900 | 600 | +# | "" | "1-2" | "1-1" | "1-1" | "unity" | "unity-iscsi" | "one-third" | "zero" | "reboot" | 600 | 900 | 900 | 600 | +# | "" | "1-2" | "2-2" | "2-2" | "unity" | "unity-iscsi" | "one-third" | "zero" | "reboot" | 600 | 900 | 900 | 600 | +# | "" | "1-2" | "4-4" | "4-4" | "unity" | "unity-iscsi" | "one-third" | "zero" | "reboot" | 600 | 900 | 900 | 600 | # # Slightly more pods, increasing number of vols and devs -# | "" | "3-5" | "1-1" | "1-1" | "unity" | "unity-iscsi" | "one-third" | "zero" | "reboot" | 240 | 1500 | 600 | 600 | -# | "" | "3-5" | "2-2" | "2-2" | "unity" | "unity-iscsi" | "one-third" | "zero" | "reboot" | 240 | 1500 | 600 | 600 | -# | "" | "3-5" | "4-4" | "4-4" | "unity" | "unity-iscsi" | "one-third" | "zero" | "reboot" | 240 | 1500 | 600 | 600 | +# | "" | "3-5" | "1-1" | "1-1" | "unity" | "unity-iscsi" | "one-third" | "zero" | "reboot" | 600 | 1500 | 600 | 600 | +# | "" | "3-5" | "2-2" | "2-2" | "unity" | "unity-iscsi" | "one-third" | "zero" | "reboot" | 600 | 1500 | 600 | 600 | +# | "" | "3-5" | "4-4" | "4-4" | "unity" | "unity-iscsi" | "one-third" | "zero" | "reboot" | 600 | 1500 | 600 | 600 | # @unity-integration # Scenario Outline: Basic node failover testing using test StatefulSet pods (node slow reboots) @@ -230,13 +230,13 @@ Feature: Integration Test # Examples: # | kubeConfig | podsPerNode | nVol | nDev | driverType | storageClass | workers | primary | failure | failSecs | deploySecs | runSecs | nodeCleanSecs | # # Small number of pods, increasing number of vols and devs -# | "" | "1-2" | "1-1" | "0-0" | "unity" | "unity-nfs" | "one-third" | "zero" | "reboot" | 120 | 900 | 900 | 600 | -# | "" | "1-2" | "2-2" | "0-0" | "unity" | "unity-nfs" | "one-third" | "zero" | "reboot" | 120 | 900 | 900 | 600 | -# | "" | "1-2" | "4-4" | "0-0" | "unity" | "unity-nfs" | "one-third" | "zero" | "reboot" | 120 | 900 | 900 | 600 | +# | "" | "1-2" | "1-1" | "0-0" | "unity" | "unity-nfs" | "one-third" | "zero" | "reboot" | 600 | 900 | 900 | 600 | +# | "" | "1-2" | "2-2" | "0-0" | "unity" | "unity-nfs" | "one-third" | "zero" | "reboot" | 600 | 900 | 900 | 600 | +# | "" | "1-2" | "4-4" | "0-0" | "unity" | "unity-nfs" | "one-third" | "zero" | "reboot" | 600 | 900 | 900 | 600 | # # Slightly more pods, increasing number of vols and devs -# | "" | "3-5" | "1-1" | "0-0" | "unity" | "unity-nfs" | "one-third" | "zero" | "reboot" | 240 | 1500 | 900 | 900 | -# | "" | "3-5" | "2-2" | "0-0" | "unity" | "unity-nfs" | "one-third" | "zero" | "reboot" | 240 | 1500 | 900 | 900 | -# | "" | "3-5" | "4-4" | "0-0" | "unity" | "unity-nfs" | "one-third" | "zero" | "reboot" | 240 | 1500 | 900 | 900 | +# | "" | "3-5" | "1-1" | "0-0" | "unity" | "unity-nfs" | "one-third" | "zero" | "reboot" | 600 | 1500 | 900 | 900 | +# | "" | "3-5" | "2-2" | "0-0" | "unity" | "unity-nfs" | "one-third" | "zero" | "reboot" | 600 | 1500 | 900 | 900 | +# | "" | "3-5" | "4-4" | "0-0" | "unity" | "unity-nfs" | "one-third" | "zero" | "reboot" | 600 | 1500 | 900 | 900 | @powerflex-integration @@ -272,7 +272,7 @@ Feature: Integration Test Then finally cleanup everything Examples: | kubeConfig | podsPerNode | nVol | nDev | driverType | storageClass | workers | primary | failure | failSecs | deploySecs | nodeCleanSecs | - | "" | "1-2" | "1-1" | "1-1" | "unity" | "unity-iscsi" | "one-third" | "zero" | "interfacedown" | 240 | 900 | 900 | + | "" | "1-2" | "1-1" | "1-1" | "unity" | "unity-iscsi" | "one-third" | "zero" | "interfacedown" | 600 | 900 | 900 | # | "" | "1-2" | "1-1" | "1-1" | "unity" | "unity-iscsi" | "one-third" | "zero" | "reboot" | 240 | 900 | 900 | @unity-integration @@ -290,7 +290,7 @@ Feature: Integration Test Then finally cleanup everything Examples: | kubeConfig | podsPerNode | nVol | nDev | driverType | storageClass | workers | primary | failure | failSecs | deploySecs | nodeCleanSecs | - | "" | "1-2" | "1-1" | "0-0" | "unity" | "unity-nfs" | "one-third" | "zero" | "interfacedown" | 240 | 900 | 900 | + | "" | "1-2" | "1-1" | "0-0" | "unity" | "unity-nfs" | "one-third" | "zero" | "interfacedown" | 600 | 900 | 900 | # | "" | "1-2" | "1-1" | "0-0" | "unity" | "unity-nfs" | "one-third" | "zero" | "reboot" | 240 | 900 | 900 | @powerflex-integration @@ -345,7 +345,7 @@ Feature: Integration Test Examples: | kubeConfig | podsPerNode | nVol | nDev | driverType | storageClass | workers | primary | failure | failSecs | deploySecs | runSecs | nodeCleanSecs | - | "" | "1-1" | "1-1" | "1-1" | "unity" | "unity-iscsi" | "one-third" | "zero" | "interfacedown" | 240 | 900 | 900 | 900 | + | "" | "1-1" | "1-1" | "1-1" | "unity" | "unity-iscsi" | "one-third" | "zero" | "interfacedown" | 600 | 900 | 900 | 900 | # | "" | "1-1" | "1-1" | "1-1" | "unity" | "unity-iscsi" | "one-third" | "zero" | "reboot" | 240 | 900 | 900 | 900 | # @unity-integration diff --git a/internal/monitor/integration_steps_test.go b/internal/monitor/integration_steps_test.go index dcbc0d5..90c3fd4 100644 --- a/internal/monitor/integration_steps_test.go +++ b/internal/monitor/integration_steps_test.go @@ -385,11 +385,13 @@ func (i *integration) deployPods(protected bool, podsPerNode, numVols, numDevs, // Select the deployment script to use based on the driver type. var deployScript string + cleanUpWait := 1 * time.Second switch driverType { case "vxflexos": deployScript = "insv.sh" case "unity": deployScript = "insu.sh" + cleanUpWait = 120 * time.Second } // Set test namespace prefix is based on the driver type. @@ -429,6 +431,8 @@ func (i *integration) deployPods(protected bool, podsPerNode, numVols, numDevs, command.Stdout = os.Stdout command.Stderr = os.Stderr + // For consecutive run provide Unity array some cleanup times + time.Sleep(cleanUpWait) log.Infof("Attempting to deploy with command: %v", command) err = command.Start() if err != nil {