Replies: 1 comment
-
For what it's worth, I managed to solve this on Linux. Using |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Motivation: I'm trying to run a test that essentially runs
ip addr add 10.0.0.1 dev lo
at some point during the test. This fails because you can only run that as the super user (when the system I'm testing is deployed for real, it will run as the super user).I'm trying to figure out how I can make it work in the Bazel test. Here's what I've tried:
sudo bazel test
does not work (and would feel way too dangerous even if it did). Documentation says "tests must be executed as a non-root user" anyway.setuid
bit on theip
binary beforehand (withsudo chmod u+s "$(which ip)"
) does not work either. This is surprising, because it does mean I can run theip addr add
command from a normal shell and it works fine withoutsudo
. I'm assuming this has something to do with Bazel's linux sandbox. Looking for clarifications if possible.fake_root
option, but it's unclear how I might set it or if it would even help. I struggled to find much useful documentation about the linux sandbox in general. Can I pass that-R
parameter tobazel test
somehow?Beta Was this translation helpful? Give feedback.
All reactions