Skip to content

Conversation

@wiselike
Copy link

fix bug #76

@wiselike wiselike force-pushed the fix-tests-in-root branch from 1886a06 to 4e4a372 Compare May 30, 2025 09:31
devel/run-tests Outdated
PID=$!
if [[ $(id -u) -eq 0 ]]; then
touch test.out.log darkhttpd.gcda && chmod 0777 test.out.log darkhttpd.gcda;
sudo -u nobody ./a.out $DIR --port $PORT --addr $ADDR --log test.out.log >>test.out.stdout 2>>test.out.stderr &
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we "sudo -u nobody run-tests" instead? I don't like the duplication here.

@wiselike wiselike force-pushed the fix-tests-in-root branch from 4e4a372 to bbbabee Compare June 3, 2025 01:52
devel/Makefile Outdated
all:
./run-tests
@chmod a+w "$(THIS_DIR)/../devel"
sudo -u nobody ./run-tests
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant do this in the Dockerfile. :)

Or "sudo make all" if you really want to go via the Makefile.

@wiselike
Copy link
Author

wiselike commented Jun 3, 2025

There are several methods to run the tests:

  1. Using the Dockerfile
  2. Via make test
  3. Running the single test directly in the devel directory

We cannot strictly dictate which method users must use. Additionally, we should avoid implying that "running tests as root is not supported" (users should have flexibility in their environment configuration).

I believe we should be able to run make test with any user account (root or not root) and in any environment, including but not limited to Docker.
@emikulic

@wiselike wiselike force-pushed the fix-tests-in-root branch from bbbabee to 9d54e36 Compare June 3, 2025 14:25
Signed-off-by: hengwu0 <17380582683@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants