-
Notifications
You must be signed in to change notification settings - Fork 292
Test CA226886: test import.vdi when SR is unavailable for any host. #3140
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
Conversation
Hi, @gaborigloi and @robhoes |
I'm not sure I quite understand this. You're changing the external behaviour of one of the HTTP handlers - why are you dong that and what is the effect? That change needs to be in a separate commit from any test, so we also need to split this PR into at least 2 commits. |
Hi, Jon. @jonludlam Thanks for you reply.
Thanks a lot. |
Hmm, this function seems to be quite hard to unit test sadly :/
I think we can only test the first thing here, maybe we could set up the socket somehow to receive the HTTP response, but that might be too complicated for a unit test. |
Thanks, @gaborigloi. |
Hi @minli1 , I think setting up the socket might be impossible or very complicated :(. So I think we can maybe only unit test item 1), that the task is set to failed. Sorry, my comment was misleading when I said that we could a unit test for this - I expected it to be much easier to unit test this function. Maybe we'll just have to write a XenRT test in the end, if we cannot unit test 1) either. |
So I think what we could still try is to pass a task in the |
Thanks @gaborigloi |
…it test. Signed-off-by:Min Li <min.li1@citrix.com>
…or the SR,the task should set failure. Signed-off-by:Min Li <min.li1@citrix.com>
Hi, @gaborigloi |
I wonder if it would make more sense to test this from quicktest? |
Agreed, this seems to be hard to unit test sadly, it's so connected to other things. |
Hi, @gaborigloi |
@minli1 Run |
HI, Jon and Gabor. @jonludlam @gaborigloi |
Does the quicktest PR replace this one? If so, let's close this one. Thank you. |
Looks like a duplicate. Closing for now. Please reopen if I am wrong |
This is a unit test for CA226886 code change. Test import_raw_vdi.import when the sr is unavailable for any host.It should raise exn and set the task to fail.
I factor the existing code to make it more suitable for unit testing. Since it's easier than writing socket server end /client end codes to create a real socket in unit-test.