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

Enable Sanity Testing #21

Merged
merged 8 commits into from
Feb 21, 2019
Merged

Conversation

Masquerade0097
Copy link
Contributor

@Masquerade0097 Masquerade0097 commented Feb 12, 2019

On running the tests, I am getting an error as shown below. I'm working to resolve it. This is a Work In Progress Pull Request depicting the status of work.

priyanshu@Masquerade:~/work/src/github.com/andyzhangx/azuredisk-csi-driver$ make test-sanity
go test -v ./tests/sanity/...
=== RUN   TestSanity
Running Suite: CSI Driver Test Suite
====================================
Random Seed: 1549980291
Will run 57 of 57 specs

S [SKIPPING] in Spec Setup (BeforeEach) [0.002 seconds]
CreateSnapshot [Controller Server]
/home/priyanshu/work/src/github.com/andyzhangx/azuredisk-csi-driver/vendor/github.com/kubernetes-csi/csi-test/pkg/sanity/tests.go:44
  should fail when no name is provided [BeforeEach]
  /home/priyanshu/work/src/github.com/andyzhangx/azuredisk-csi-driver/vendor/github.com/kubernetes-csi/csi-test/pkg/sanity/controller.go:1502

  CreateSnapshot not supported

  /home/priyanshu/work/src/github.com/andyzhangx/azuredisk-csi-driver/vendor/github.com/kubernetes-csi/csi-test/pkg/sanity/controller.go:1498
------------------------------
S [SKIPPING] in Spec Setup (BeforeEach) [0.001 seconds]
CreateSnapshot [Controller Server]
/home/priyanshu/work/src/github.com/andyzhangx/azuredisk-csi-driver/vendor/github.com/kubernetes-csi/csi-test/pkg/sanity/tests.go:44
  should fail when no source volume id is provided [BeforeEach]
  /home/priyanshu/work/src/github.com/andyzhangx/azuredisk-csi-driver/vendor/github.com/kubernetes-csi/csi-test/pkg/sanity/controller.go:1519

  CreateSnapshot not supported

  /home/priyanshu/work/src/github.com/andyzhangx/azuredisk-csi-driver/vendor/github.com/kubernetes-csi/csi-test/pkg/sanity/controller.go:1498
------------------------------
S [SKIPPING] in Spec Setup (BeforeEach) [0.001 seconds]
CreateSnapshot [Controller Server]
/home/priyanshu/work/src/github.com/andyzhangx/azuredisk-csi-driver/vendor/github.com/kubernetes-csi/csi-test/pkg/sanity/tests.go:44
  should not fail when requesting to create a snapshot with already existing name and same SourceVolumeId. [BeforeEach]
  /home/priyanshu/work/src/github.com/andyzhangx/azuredisk-csi-driver/vendor/github.com/kubernetes-csi/csi-test/pkg/sanity/controller.go:1536

  CreateSnapshot not supported

  /home/priyanshu/work/src/github.com/andyzhangx/azuredisk-csi-driver/vendor/github.com/kubernetes-csi/csi-test/pkg/sanity/controller.go:1498
------------------------------
S [SKIPPING] in Spec Setup (BeforeEach) [0.002 seconds]
CreateSnapshot [Controller Server]
/home/priyanshu/work/src/github.com/andyzhangx/azuredisk-csi-driver/vendor/github.com/kubernetes-csi/csi-test/pkg/sanity/tests.go:44
  should fail when requesting to create a snapshot with already existing name and different SourceVolumeId. [BeforeEach]
  /home/priyanshu/work/src/github.com/andyzhangx/azuredisk-csi-driver/vendor/github.com/kubernetes-csi/csi-test/pkg/sanity/controller.go:1566

  CreateSnapshot not supported

  /home/priyanshu/work/src/github.com/andyzhangx/azuredisk-csi-driver/vendor/github.com/kubernetes-csi/csi-test/pkg/sanity/controller.go:1498
------------------------------
S [SKIPPING] in Spec Setup (BeforeEach) [0.001 seconds]
CreateSnapshot [Controller Server]
/home/priyanshu/work/src/github.com/andyzhangx/azuredisk-csi-driver/vendor/github.com/kubernetes-csi/csi-test/pkg/sanity/tests.go:44
  should not fail when creating snapshot with maximum-length name [BeforeEach]
  /home/priyanshu/work/src/github.com/andyzhangx/azuredisk-csi-driver/vendor/github.com/kubernetes-csi/csi-test/pkg/sanity/controller.go:1601

  CreateSnapshot not supported

  /home/priyanshu/work/src/github.com/andyzhangx/azuredisk-csi-driver/vendor/github.com/kubernetes-csi/csi-test/pkg/sanity/controller.go:1498
------------------------------
••E0212 19:34:51.215633   12427 utils.go:110] GRPC error: rpc error: code = InvalidArgument desc = Volume capability missing in request
•E0212 19:34:51.270327   12427 utils.go:110] GRPC error: rpc error: code = InvalidArgument desc = Volume capability missing in request
•E0212 19:34:51.271009   12427 utils.go:110] GRPC error: rpc error: code = InvalidArgument desc = Volume capability missing in request
•E0212 19:34:51.271785   12427 utils.go:110] GRPC error: rpc error: code = InvalidArgument desc = Volume ID missing in request
•E0212 19:34:51.272407   12427 utils.go:110] GRPC error: rpc error: code = InvalidArgument desc = Target path missing in request
•E0212 19:34:51.273282   12427 utils.go:110] GRPC error: rpc error: code = InvalidArgument desc = Volume ID not provided
•E0212 19:34:51.273980   12427 utils.go:110] GRPC error: rpc error: code = InvalidArgument desc = Staging target not provided
•E0212 19:34:51.274640   12427 utils.go:110] GRPC error: rpc error: code = InvalidArgument desc = Volume capability not provided
•E0212 19:34:51.275367   12427 utils.go:110] GRPC error: rpc error: code = InvalidArgument desc = Volume ID not provided
•E0212 19:34:51.276014   12427 utils.go:110] GRPC error: rpc error: code = InvalidArgument desc = Staging target not provided
•panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1278467]

oroutine 98 [running]:
github.com/andyzhangx/azuredisk-csi-driver/vendor/k8s.io/kubernetes/pkg/cloudprovider/providers/azure.(*ManagedDiskController).CreateManagedDisk(0x0, 0xc420164580, 0x0, 0x0, 0x0, 0x0)
	/home/priyanshu/work/src/github.com/andyzhangx/azuredisk-csi-driver/vendor/k8s.io/kubernetes/pkg/cloudprovider/providers/azure/azure_managedDiskController.go:136 +0x687
github.com/andyzhangx/azuredisk-csi-driver/pkg/azuredisk.(*Driver).CreateVolume(0xc4200887e0, 0x17a3000, 0xc42057a480, 0xc42048ca80, 0xc4200887e0, 0x412001, 0xc4205bec90)
	/home/priyanshu/work/src/github.com/andyzhangx/azuredisk-csi-driver/pkg/azuredisk/controllerserver.go:178 +0x17cb
github.com/andyzhangx/azuredisk-csi-driver/vendor/github.com/container-storage-interface/spec/lib/go/csi._Controller_CreateVolume_Handler.func1(0x17a3000, 0xc42057a480, 0x15cc860, 0xc42048ca80, 0x1, 0x1, 0x0, 0xc420069400)
	/home/priyanshu/work/src/github.com/andyzhangx/azuredisk-csi-driver/vendor/github.com/container-storage-interface/spec/lib/go/csi/csi.pb.go:4579 +0x86
github.com/andyzhangx/azuredisk-csi-driver/pkg/csi-common.logGRPC(0x17a3000, 0xc42057a480, 0x15cc860, 0xc42048ca80, 0xc420494120, 0xc420494140, 0x145d1c0, 0x22b9c20, 0x15fa280, 0xc4206f5300)
	/home/priyanshu/work/src/github.com/andyzhangx/azuredisk-csi-driver/pkg/csi-common/utils.go:108 +0x179
github.com/andyzhangx/azuredisk-csi-driver/vendor/github.com/container-storage-interface/spec/lib/go/csi._Controller_CreateVolume_Handler(0x15ff660, 0xc4200887e0, 0x17a3000, 0xc42057a480, 0xc42057e460, 0x16eb3b8, 0x0, 0x0, 0xc4201be150, 0x2c)
	/home/priyanshu/work/src/github.com/andyzhangx/azuredisk-csi-driver/vendor/github.com/container-storage-interface/spec/lib/go/csi/csi.pb.go:4581 +0x167
github.com/andyzhangx/azuredisk-csi-driver/vendor/google.golang.org/grpc.(*Server).processUnaryRPC(0xc420464480, 0x17b18a0, 0xc42038a780, 0xc4206f5300, 0xc4203c4ae0, 0x2276640, 0x0, 0x0, 0x0)
	/home/priyanshu/work/src/github.com/andyzhangx/azuredisk-csi-driver/vendor/google.golang.org/grpc/server.go:966 +0x4bc
github.com/andyzhangx/azuredisk-csi-driver/vendor/google.golang.org/grpc.(*Server).handleStream(0xc420464480, 0x17b18a0, 0xc42038a780, 0xc4206f5300, 0x0)
	/home/priyanshu/work/src/github.com/andyzhangx/azuredisk-csi-driver/vendor/google.golang.org/grpc/server.go:1245 +0xd69
github.com/andyzhangx/azuredisk-csi-driver/vendor/google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc420472060, 0xc420464480, 0x17b18a0, 0xc42038a780, 0xc4206f5300)
	/home/priyanshu/work/src/github.com/andyzhangx/azuredisk-csi-driver/vendor/google.golang.org/grpc/server.go:685 +0x9f
created by github.com/andyzhangx/azuredisk-csi-driver/vendor/google.golang.org/grpc.(*Server).serveStreams.func1
	/home/priyanshu/work/src/github.com/andyzhangx/azuredisk-csi-driver/vendor/google.golang.org/grpc/server.go:683 +0xa1
FAIL	github.com/andyzhangx/azuredisk-csi-driver/tests/sanity	0.288s
Makefile:30: recipe for target 'test-sanity' failed
make: *** [test-sanity] Error 1

@Masquerade0097 Masquerade0097 changed the title Enable Sanity Testing [WIP] Enable Sanity Testing Feb 12, 2019
@andyzhangx
Copy link
Member

about /home/priyanshu/work/src/github.com/andyzhangx/azuredisk-csi-driver/vendor/k8s.io/kubernetes/pkg/cloudprovider/providers/azure/azure_managedDiskController.go:136 +0x687 failure
You could check that line of code directly, usually it's due to your cloud config file(azure.json) file parameter incorrect

@Masquerade0097
Copy link
Contributor Author

@andyzhangx I have updated the error log above.

You could check that line of code directly, usually it's due to your cloud config file(azure.json) file parameter incorrect

Ok, I'll check that.

@andyzhangx
Copy link
Member

@andyzhangx
Copy link
Member

I think there is no CreateManagedDisk fake function, that's the reason why it failed. Can you use real azure crendentials like what our integration-test does, thus we don't need to write lots of fake functions. Then the sanity test would be more like functional test with real Azure credentials.

@Masquerade0097
Copy link
Contributor Author

Masquerade0097 commented Feb 12, 2019

It's https://github.com/kubernetes/kubernetes/blob/v1.13.0/pkg/cloudprovider/providers/azure/azure_managedDiskController.go#L136, where is your azure.json? How did you initialize it?

@andyzhangx I was creating fake cloud so didn't initialize the cloud config azure.json.

@Masquerade0097
Copy link
Contributor Author

I think there is no CreateManagedDisk fake function, that's the reason why it failed. Can you use real azure crendentials like what our integration-test does, thus we don't need to write lots of fake functions. Then the sanity test would be more like functional test with real Azure credentials.

Okay, I'll proceed with using real cluster.

@Masquerade0097
Copy link
Contributor Author

Masquerade0097 commented Feb 18, 2019

Status: I have removed the fakes and used real cluster for sanity testing.

Results for sanity tests for CSI v1.0.0 -

Ran 40 of 57 Specs in 92.517 seconds
FAIL! -- 27 Passed | 13 Failed | 0 Pending | 17 Skipped
--- FAIL: TestSanity (92.53s)
FAIL
FAIL	github.com/csi-driver/azuredisk-csi-driver/test/sanity	92.550s

Working on resolving the error:

GRPC error: compute.DisksClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="InvalidParameter" Message="The value '0' of parameter 'disk.diskSizeGb' is out of range. Value '0' must be between '1' and '32767' inclusive." Target="disk.diskSizeGb"

The detailed log can be found below -
test-log.txt

CC @andyzhangx

@andyzhangx
Copy link
Member

andyzhangx commented Feb 18, 2019

@Masquerade0097 great progress! The sanity test shows some functions has issues, we could skip it in CI temporarily (or make it run as optional?), let's work together to fix those implementation issues then, it's a really good test result!

There are a few items to address:

  • pls run hack/verify-all.sh to make sure there is no code format issue which will break CI
    run hack/update-gofmt.sh to update code format directly
  • I see there are many vendor files in this PR, are they all necessary, you could run following command to make sure they are really needed:
rm -rf vendor/*
dep ensure -v
  • I have moved this repository from andyzhangx to csi-driver which has caused some CI error, let me make the repo name change first, it looks like repo migration to k8s-sig still needs a few days.

@Masquerade0097
Copy link
Contributor Author

Masquerade0097 commented Feb 18, 2019

@andyzhangx I have skipped the sanity test for CI build as of now because it would lead to failing build. But it can be run separately by make sanity-test, I have included a README.md in sanity test directory for guidelines.

let's work together to fix those implementation issues then

Sure.

pls run hack/verify-all.sh to make sure there is no code format issue which will break CI
run hack/update-gofmt.sh to update code format directly

Done.

Also, I ran the following commands to update the vendors.

rm -rf vendor/*
dep ensure -v

Because in some files andyzhangx/azuredisk-csi-driver is not updated to csi-driver/azuredisk-csi-driver the former vendor is added by dep. Should I remove andyzhangx/azuredisk-csi-driver vendor ? or would you address it in a separate PR as per your comment.

I have moved this repository from andyzhangx to csi-driver which has caused some CI error, let me make the repo name change first, it looks like repo migration to k8s-sig still needs a few days.

@Masquerade0097 Masquerade0097 changed the title [WIP] Enable Sanity Testing Enable Sanity Testing Feb 18, 2019
@andyzhangx
Copy link
Member

andyzhangx commented Feb 19, 2019

Because in some files andyzhangx/azuredisk-csi-driver is not updated to csi-driver/azuredisk-csi-driver the former vendor is added by dep. Should I remove andyzhangx/azuredisk-csi-driver vendor ? or would you address it in a separate PR as per your comment.

Pls remove andyzhangx/azuredisk-csi-driver vendor in this PR, I have already changed repo name by this commit: 2725839
You could rebase your branch, thanks.

@andyzhangx
Copy link
Member

also, pls provide a sanity test result after fixing the disk 0 size failures, and then we could proceed to fixing those sanity test failures.

@Masquerade0097
Copy link
Contributor Author

@andyzhangx I have rebased this branch. Can I send different PR after I fix disk 0 size failures ?

@andyzhangx
Copy link
Member

@Masquerade0097 sure, just use your convenient way.

@Masquerade0097
Copy link
Contributor Author

@andyzhangx I have fixed the disk size 0 error and added a commit in this PR.

Now 9 tests are failing with the following log.
tests-log2.txt

@andyzhangx
Copy link
Member

@Masquerade0097 pls fix my only comment, other part looks good to me, thanks.

@Masquerade0097
Copy link
Contributor Author

Masquerade0097 commented Feb 21, 2019

@andyzhangx I have made the change.

@andyzhangx andyzhangx merged commit 01a54ce into kubernetes-sigs:master Feb 21, 2019
@Masquerade0097 Masquerade0097 deleted the sanity branch February 21, 2019 14:11
dobsonj pushed a commit to dobsonj/azuredisk-csi-driver that referenced this pull request Feb 22, 2022
…ncy-openshift-4.11-ose-azure-disk-csi-driver

Updating ose-azure-disk-csi-driver images to be consistent with ART
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

Successfully merging this pull request may close these issues.

2 participants