Skip to content

Commit

Permalink
Fixing test
Browse files Browse the repository at this point in the history
Signed-off-by: Mayank Shah <mayankshah1614@gmail.com>
  • Loading branch information
mayankshah1607 committed Nov 9, 2020
1 parent 7c0c525 commit 8223ce5
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 42 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ install-helm:

.PHONY: e2e-bootstrap
e2e-bootstrap: install-helm
helm install -n csi-driver-nfs ./charts/csi-driver-nfs --namespace kube-system --wait --timeout=15m -v=5 --debug \
helm install csi-driver-nfs ./charts/csi-driver-nfs --namespace kube-system --wait --timeout=15m -v=5 --debug \
--set image.nfs.repository=$(REGISTRY)/$(IMAGE_NAME) \
--set image.nfs.tag=$(IMAGE_VERSION)

Expand Down
6 changes: 3 additions & 3 deletions charts/csi-driver-nfs/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ image:
nfs:
repository: quay.io/k8scsi/nfsplugin
tag: v2.0.0
pullPolicy: ifNotPresent
pullPolicy: IfNotPresent
csiProvisioner:
repository: mcr.microsoft.com/oss/kubernetes-csi/csi-provisioner
tag: v1.4.0
pullPolicy: ifNotPresent
pullPolicy: IfNotPresent
livenessProbe:
repository: mcr.microsoft.com/oss/kubernetes-csi/livenessprobe
tag: v1.1.0
pullPolicy: ifNotPresent
pullPolicy: IfNotPresent
nodeDriverRegistrar:
repository: mcr.microsoft.com/oss/kubernetes-csi/csi-node-driver-registrar
tag: v1.2.0
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/driver/nfs_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type NFSDriver struct {
driverName string
}

// InitNFSDriver returns SMBDriver that implements DynamicPVTestDriver interface
// InitNFSDriver returns NFSDriver that implements DynamicPVTestDriver interface
func InitNFSDriver() PVTestDriver {
driverName := os.Getenv(NFSDriverNameVar)
if driverName == "" {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/dynamic_provisioning_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var _ = ginkgo.Describe("Dynamic Provisioning", func() {
})

testDriver = driver.InitNFSDriver()
ginkgo.It("should create a volume on demand with mount options [smb.csi.k8s.io]", func() {
ginkgo.It("should create a volume on demand with mount options [nfs.csi.k8s.io]", func() {
pods := []testsuites.PodDetails{
{
Cmd: "echo 'hello world' > /mnt/test-1/data && grep 'hello world' /mnt/test-1/data",
Expand Down
57 changes: 27 additions & 30 deletions test/e2e/e2e_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"testing"

"github.com/kubernetes-csi/csi-driver-nfs/pkg/nfs"
testutil "github.com/kubernetes-csi/csi-driver-nfs/test/utils/testutils"
"github.com/onsi/ginkgo"
"github.com/onsi/gomega"
"k8s.io/kubernetes/test/e2e/framework"
Expand Down Expand Up @@ -50,40 +49,38 @@ var _ = ginkgo.BeforeSuite(func() {
handleFlags()
framework.AfterReadingAllFlags(&framework.TestContext)

if testutil.IsRunningInProw() {
// install nfs server
installNFSServer := testCmd{
command: "make",
args: []string{"install-nfs-server"},
startLog: "Installing NFS Server...",
endLog: "NFS Server successfully installed",
}

e2eBootstrap := testCmd{
command: "make",
args: []string{"e2e-bootstrap"},
startLog: "Installing NFS CSI Driver...",
endLog: "NFS CSI Driver Installed",
}
// todo: Install metrics server once added to this driver

execTestCmd([]testCmd{installNFSServer, e2eBootstrap})
go func() {
nfsDriver.Run()
}()
// install nfs server
installNFSServer := testCmd{
command: "make",
args: []string{"install-nfs-server"},
startLog: "Installing NFS Server...",
endLog: "NFS Server successfully installed",
}

e2eBootstrap := testCmd{
command: "make",
args: []string{"e2e-bootstrap"},
startLog: "Installing NFS CSI Driver...",
endLog: "NFS CSI Driver Installed",
}
// todo: Install metrics server once added to this driver

execTestCmd([]testCmd{installNFSServer, e2eBootstrap})
go func() {
nfsDriver.Run()
}()

})

var _ = ginkgo.AfterSuite(func() {
if testutil.IsRunningInProw() {
e2eTeardown := testCmd{
command: "make",
args: []string{"e2e-teardown"},
startLog: "Uninstalling SMB CSI Driver...",
endLog: "SMB Driver uninstalled",
}
execTestCmd([]testCmd{e2eTeardown})
e2eTeardown := testCmd{
command: "make",
args: []string{"e2e-teardown"},
startLog: "Uninstalling NFS CSI Driver...",
endLog: "SMB Driver uninstalled",
}
execTestCmd([]testCmd{e2eTeardown})

})

// handleFlags sets up all flags and parses the command line.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package testsuites

import (
"github.com/kubernetes-csi/csi-driver-smb/test/e2e/driver"
"github.com/kubernetes-csi/csi-driver-nfs/test/e2e/driver"

"github.com/onsi/ginkgo"
v1 "k8s.io/api/core/v1"
Expand Down
6 changes: 1 addition & 5 deletions test/e2e/testsuites/specs.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,7 @@ func (pod *PodDetails) SetupWithDynamicVolumes(client clientset.Interface, names
for n, v := range pod.Volumes {
tpvc, funcs := v.SetupDynamicPersistentVolumeClaim(client, namespace, csiDriver, storageClassParameters)
cleanupFuncs = append(cleanupFuncs, funcs...)
if v.VolumeMode == Block {
tpod.SetupRawBlockVolume(tpvc.persistentVolumeClaim, fmt.Sprintf("%s%d", v.VolumeDevice.NameGenerate, n+1), v.VolumeDevice.DevicePath)
} else {
tpod.SetupVolume(tpvc.persistentVolumeClaim, fmt.Sprintf("%s%d", v.VolumeMount.NameGenerate, n+1), fmt.Sprintf("%s%d", v.VolumeMount.MountPathGenerate, n+1), v.VolumeMount.ReadOnly)
}
tpod.SetupVolume(tpvc.persistentVolumeClaim, fmt.Sprintf("%s%d", v.VolumeMount.NameGenerate, n+1), fmt.Sprintf("%s%d", v.VolumeMount.MountPathGenerate, n+1), v.VolumeMount.ReadOnly)
}
return tpod, cleanupFuncs
}

0 comments on commit 8223ce5

Please sign in to comment.