You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are updating how pycloudlib run the exec cmds. By default, LXD is running all of the commands as root. We are changing that behavior. However, this will impact the test_write_files test, which is being updated in this PR.
imo the test harness 'exec' should be done as root.
That is the most sane default. if the caller wants to change to non-root, they can do so using sudo.
but i'm not sure what the motivation for "We are changing that behavior" is.
imo the test harness 'exec' should be done as root.
In non-LXD cases (where we SSH into instances as non-root), that would mean that running commands as non-root would be going through sudo twice: once to do the exec as root, and once to get back to the default user. It would also mean that tests have to know what the default username is (e.g. ubuntu vs. ec2-user) for the currently running instance; currently that can be contained in the framework code which handles the SSH connection (or lxc exec call).
That is the most sane default. if the caller wants to change to non-root, they can do so using sudo.
James has proposed #664 for framework changes around this: we use sudo to gain root, and that's the default behaviour when you call execute() (so the 'exec' is done as root, in that sense). execute() has a use_sudo parameter which allows you to not use sudo (and therefore run as the default SSH user without knowing its username).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We are updating how pycloudlib run the
exec cmds. By default, LXD is running all of the commands as root. We are changing that behavior. However, this will impact thetest_write_filestest, which is being updated in this PR.