When using destructive mode, or if the user is already a member of the lxd group, then using sg to gain the group is unnecessary and can sometimes lead to issues. Even when needed, if the group is not available, the error message produced is confusing.
This also refactors the tests into separate unit and integration tests, and updates the abort_on_fail autouse fixture to avoid creating an ops_test instance (and thus creating a model) when not needed.
When using destructive mode, or if the user is already a member of the lxd group, then using
sg
to gain the group is unnecessary and can sometimes lead to issues. Even when needed, if the group is not available, the error message produced is confusing.This also refactors the tests into separate unit and integration tests, and updates the
abort_on_fail
autouse fixture to avoid creating anops_test
instance (and thus creating a model) when not needed.