-
Notifications
You must be signed in to change notification settings - Fork 283
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
CP-40116 xapi-guard: Add unit tests #4813
CP-40116 xapi-guard: Add unit tests #4813
Conversation
c2d1add
to
5a91e42
Compare
The FD leak test is noisy, there's probably some interference with dune and opam |
I'm unable to reproduce the failure locally, neither with dune or opam nor without them:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to see code more concise and using the let*
syntax.
avoid using up 100% CPU waiting for it, | ||
better than Lwt.pause () | ||
*) | ||
let* () = Lwt_unix.sleep 0.001 in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The wait is a lot shorter now. Is this just for Lwt scheduling?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for getting the unit tests to pass quickly while still yielding the CPU to other tasks, see #4670 (comment)
d15b774
to
e6921da
Compare
…esting Signed-off-by: Edwin Török <edvin.torok@citrix.com> Signed-off-by: Pau Ruiz Safont <pau.safont@citrix.com>
Signed-off-by: Edwin Török <edvin.torok@citrix.com> Signed-off-by: Pau Ruiz Safont <pau.safont@citrix.com>
Check that basic API calls get forwarded Signed-off-by: Edwin Török <edvin.torok@citrix.com> Signed-off-by: Pau Ruiz Safont <pau.safont@citrix.com>
Signed-off-by: Edwin Török <edvin.torok@citrix.com> Signed-off-by: Pau Ruiz Safont <pau.safont@citrix.com>
…e socket This is the socket created by xapi-guard itself through Conduit, but Conduit doesn't currently have an API to notify us when the socket got created and listen()-ed on. And we don't want to return too early to our caller (the unit test or xenopsd) since they may get an ECONNREFUSED if they try to connect too early. Signed-off-by: Edwin Török <edvin.torok@citrix.com> Signed-off-by: Pau Ruiz Safont <pau.safont@citrix.com>
Instead of `foo () >>= fun result -> ...` use `let* result = foo () in ...`. Instead of `foo () >|= fun result -> ...` use `let+ result = foo () in ...`. Signed-off-by: Edwin Török <edvin.torok@citrix.com> Signed-off-by: Pau Ruiz Safont <pau.safont@citrix.com>
Signed-off-by: Edwin Török <edvin.torok@citrix.com> Signed-off-by: Pau Ruiz Safont <pau.safont@citrix.com>
Signed-off-by: Edwin Török <edvin.torok@citrix.com> Signed-off-by: Pau Ruiz Safont <pau.safont@citrix.com>
The test is commented out because under certain conditions which couldn't be replicated at the end there are _less_ file descriptors that at the beginning. Signed-off-by: Edwin Török <edvin.torok@citrix.com> Signed-off-by: Pau Ruiz Safont <pau.safont@citrix.com>
e6921da
to
fbc216f
Compare
These were developed in conjunction with a deprivileged interface to gather vtpm data, but it was dropped: #4670
I've removed that part of the tests and kept the rest, including an file descriptor leak test that found actually found one. The fix was included in the codebase months ago.