Conversation
The UT depend on a specific path for lvcreate binaries, however the path actually used is distro dependent. On Debian distros, lvcreate is in /sbin. SM correctly auto detects the location, but the UT were expecting it in /usr/sbin. Fix the UT so they use the detected path for the executables.
|
@MarkSymsCtx this seems reasonable to me but I'd rather have you looking at it |
MarkSymsCtx
left a comment
There was a problem hiding this comment.
If we need a quick fix then this change is OK.
However, as the unit tests are apparently distro dependent this means that they are not correctly isolated from the execution environment and are accessing the local filesystem which should not be the case. So we can either approve this as a short term fix and raise a new issue to correctly isolate the tests, which may be non-trivial depending on how twisted the logic is, or we reject and only do the test rework to isolate.
|
The real issue is that https://github.com/xapi-project/sm/blob/master/drivers/lvutil.py#L40 attempts to detect the location of lv executables on file import. After approving this change a refactor to fix the lvutil code would at least have UT validating the refactor. |
The UT depend on a specific path for lvcreate binaries, however
the path actually used is distro dependent. On Debian distros,
lvcreate is in /sbin. SM correctly auto detects the location,
but the UT were expecting it in /usr/sbin.
Fix the UT so they use the detected path for the executables.