Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to run tests for csi-sanity #248

Closed
Kartik494 opened this issue Feb 12, 2020 · 5 comments
Closed

Not able to run tests for csi-sanity #248

Kartik494 opened this issue Feb 12, 2020 · 5 comments

Comments

@Kartik494
Copy link
Member

I am not able to run csi-sanity test case,as i am using csi-driver host-path for csi endpoint
root@kmaster:~/csi-test/cmd/csi-sanity# kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
csi-hostpath-attacher ClusterIP 10.96.104.168 12345/TCP 27h
csi-hostpath-provisioner ClusterIP 10.96.12.151 12345/TCP 27h
csi-hostpath-resizer ClusterIP 10.96.220.210 12345/TCP 27h
csi-hostpath-snapshotter ClusterIP 10.96.245.163 12345/TCP 27h
csi-hostpathplugin ClusterIP 10.96.175.29 12345/TCP 27h
csi-snapshotter ClusterIP 10.96.47.90 12345/TCP 26h
example-service NodePort 10.96.204.209 8080:30760/TCP 21d
hostpath-service NodePort 10.96.210.21 10000:30106/TCP 27h
internal-docker-registry NodePort 10.96.72.151 5000:32000/TCP 20d
kubernetes ClusterIP 10.96.0.1 443/TCP 29d

and while running this test i got an error

root@kmaster:~/csi-test/cmd/csi-sanity# ./csi-sanity -csi.endpoint dns://127.0.0.1:30106
Running Suite: CSI Driver Test Suite

Random Seed: 1581499694
Will run 72 of 73 specs

STEP: connecting to CSI driver
• Failure in Spec Setup (BeforeEach) [60.002 seconds]
Node Service
/root/csi-test/pkg/sanity/tests.go:44
NodeGetCapabilities [BeforeEach]
/root/csi-test/pkg/sanity/node.go:119
should return appropriate capabilities
/root/csi-test/pkg/sanity/node.go:120

Unexpected error:
    <*errors.errorString | 0xc00035e660>: {
        s: "Connection timed out",
    }
    Connection timed out
occurred

/root/csi-test/pkg/sanity/sanity.go:255

Can anyone help how to solve this error

@pohly
Copy link
Contributor

pohly commented Feb 12, 2020

That hostpath-service is not connected to anything, at least not if it is similar to the one from
https://github.com/kubernetes-csi/csi-driver-host-path/blob/3acaee013dd04c1a88c977b3ec1db86381c6e030/deploy/kubernetes-1.17/hostpath/csi-hostpath-plugin.yaml#L5-L16

You have to run something like
https://github.com/kubernetes-csi/csi-driver-host-path/blob/master/deploy/kubernetes-1.17/hostpath/csi-hostpath-testing.yaml to make the driver's Unix domain socket available via TCP outside of the cluster.

@Kartik494
Copy link
Member Author

Hi @pohly after running https://github.com/kubernetes-csi/csi-driver-host-path/blob/master/deploy/kubernetes-1.17/hostpath/csi-hostpath-testing.yaml i am not able to get the expected output as test cases are failing. I've got output
STEP: connecting to CSI driver
• Failure in Spec Setup (BeforeEach) [60.003 seconds]
ListSnapshots [Controller Server]
/root/csi-test/pkg/sanity/tests.go:44
should return appropriate values (no optional values added) [BeforeEach]
/root/csi-test/pkg/sanity/controller.go:1625

Unexpected error:
<*errors.errorString | 0xc00002e1a0>: {
s: "Connection timed out",
}
Connection timed out
occurred

/root/csi-test/pkg/sanity/sanity.go:255

@Kartik494
Copy link
Member Author

According to docs when i unit-test csi-sanity the test NodePublishVolume should fail when no volume id is provided should pass but in my environment i got error.Is there is any other way to test CSI driver?

@pohly
Copy link
Contributor

pohly commented Feb 27, 2020

Connection timed out

How did you run csi-sanity? It must be configured to connect to the running CSI driver. That part didn't work.

This blog post has a full working example: https://kubernetes.io/blog/2020/01/08/testing-of-csi-drivers/

@Kartik494
Copy link
Member Author

Thanks @pohly for the blog post https://kubernetes.io/blog/2020/01/08/testing-of-csi-drivers/ .The problem is with unix domain socket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants