Skip to content

Commit c36aaf9

Browse files
committed
create e2e test binary and update docs
1 parent 7e584f4 commit c36aaf9

File tree

3 files changed

+25
-19
lines changed

3 files changed

+25
-19
lines changed

README.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,26 @@ nfstestvol
6565
$ csc node get-id --endpoint tcp://127.0.0.1:10000
6666
CSINode
6767
```
68-
69-
## Running Kubernetes End To End tests on the NFS Driver
70-
1) Stand up a local cluster `ALLOW_PRIVILEGED=1 hack/local-up-cluster.sh`
71-
2) Build the nfs driver by running `make`
72-
3) Create NFS Driver Image, where the image tag would be whatever that is required by your YAML deployment files `docker build -t quay.io/k8scsi/nfsplugin:v1.0.0 .`
73-
4) Run E2E Tests using the following command: `go test -v ./cmd/nfsplugin/ -ginkgo.v -ginkgo.progress --kubeconfig=/var/run/kubernetes/admin.kubeconfig -timeout=0`
68+
## Running Kubernetes End To End tests on an NFS Driver
69+
70+
First, stand up a local cluster `ALLOW_PRIVILEGED=1 hack/local-up-cluster.sh` (from your Kubernetes repo)
71+
For Fedora/RHEL clusters, the following might be required:
72+
```
73+
sudo chown -R $USER:$USER /var/run/kubernetes/
74+
sudo chown -R $USER:$USER /var/lib/kubelet
75+
sudo chcon -R -t svirt_sandbox_file_t /var/lib/kubelet
76+
```
77+
If you are plannig to test using your own private image, you could either install your nfs driver using your own set of YAML files, or edit the existing YAML files to use that private image.
78+
79+
When using the [existing set of YAML files](https://github.com/kubernetes-csi/csi-driver-nfs/tree/master/deploy/kubernetes), you would edit the [csi-attacher-nfsplugin.yaml](https://github.com/kubernetes-csi/csi-driver-nfs/blob/master/deploy/kubernetes/csi-attacher-nfsplugin.yaml#L46) and [csi-nodeplugin-nfsplugin.yaml](https://github.com/kubernetes-csi/csi-driver-nfs/blob/master/deploy/kubernetes/csi-nodeplugin-nfsplugin.yaml#L45) files to include your private image instead of the default one. After editing these files, skip to step 3 of the following steps.
80+
81+
If you already have a driver installed, skip to step 4 of the following steps.
82+
83+
1) Build the nfs driver by running `make`
84+
2) Create NFS Driver Image, where the image tag would be whatever that is required by your YAML deployment files `docker build -t quay.io/k8scsi/nfsplugin:v1.0.0 .`
85+
3) Install the Driver: `kubectl create -f deploy/kubernetes`
86+
4) Build E2E test binary: `make build-tests`
87+
5) Run E2E Tests using the following command: `./bin/tests --ginkgo.v --ginkgo.progress --kubeconfig=/var/run/kubernetes/admin.kubeconfig`
7488

7589

7690
## Community, discussion, contribution, and support

cmd/nfsplugin/nfsplugin_test.go renamed to cmd/tests/nfs-e2e.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,7 @@ func Test(t *testing.T) {
3232
RegisterFailHandler(Fail)
3333
RunSpecs(t, "CSI Suite")
3434
}
35+
36+
func main() {
37+
Test(&testing.T{})
38+
}

test/nfs-testdriver.go

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ limitations under the License.
1414
package test
1515

1616
import (
17-
"fmt"
18-
. "github.com/onsi/ginkgo"
1917
"k8s.io/api/core/v1"
2018
"k8s.io/apimachinery/pkg/util/sets"
2119
"k8s.io/kubernetes/test/e2e/framework"
@@ -100,17 +98,7 @@ func (n *nfsDriver) PrepareTest(f *framework.Framework) (*testsuites.PerTestConf
10098
Framework: f,
10199
}
102100

103-
//Install the nfs driver from the manifests
104-
cleanup, err := config.Framework.CreateFromManifests(nil, n.manifests...)
105-
106-
if err != nil {
107-
framework.Failf("deploying %s driver: %v", n.driverInfo.Name, err)
108-
}
109-
110-
return config, func() {
111-
By(fmt.Sprintf("uninstalling %s driver", n.driverInfo.Name))
112-
cleanup()
113-
}
101+
return config, func() {}
114102
}
115103

116104
func (n *nfsDriver) CreateVolume(config *testsuites.PerTestConfig, volType testpatterns.TestVolType) testsuites.TestVolume {

0 commit comments

Comments
 (0)