Commit graph

3 commits

Author SHA1 Message Date
Dennis Kempin
b803e3cdcf net_util: Execute tap tests via sudo
These tests require root privileges to run. Check if we can do
a passwordless sudo and run the test process as a child process
with sudo.

This will work in CI or dev_container. For developer workflows,
the test_runner will already ask for sudo credentials before
running tests.

BUG=b:261600801
TEST=Fails: cargo test -p net_util
Passes: sudo true && cargo test -p net_util

Change-Id: I7c18057f7cfb91d5d389f9d9d1bb2d886d7f0149
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4086904
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-12-07 19:22:35 +00:00
Dennis Kempin
b157bda3ee tools/run_tests: Run some tests as root
Testing tap functionality requires root privileges. The crosvmdev
user of our dev_container is set up for passwordless sudo, so we can
seamlessly execute these tests via sudo.

For running on the developer workstation directly, this will prompt
for a password, which is disruptive to workflows. The --no-root
option can be used to prevent this and skip the tests in question.

BUG=None
TEST=tools/run_tests [--no-root]

Change-Id: I731887837affceb76152466f0006c4ee51a19234
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4063237
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-11-29 19:40:36 +00:00
Dennis Kempin
9d24750e7d net_util: Extract integration_test
The tests require root privileges and have been silently
failing in CI because of that.

We will need a mechanism to run tests as root to enable these.
See b/256221093

BUG=b:244623459
TEST=presubmit

Change-Id: If812c219f44221275eabb2892891fd05b432d2fb
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3990012
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-11-03 23:29:15 +00:00