tests: fix failures when run as root user - #77
Conversation
1886a06 to
4e4a372
Compare
| 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 & |
There was a problem hiding this comment.
Can we "sudo -u nobody run-tests" instead? I don't like the duplication here.
4e4a372 to
bbbabee
Compare
| all: | ||
| ./run-tests | ||
| @chmod a+w "$(THIS_DIR)/../devel" | ||
| sudo -u nobody ./run-tests |
There was a problem hiding this comment.
I meant do this in the Dockerfile. :)
Or "sudo make all" if you really want to go via the Makefile.
|
There are several methods to run the tests:
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 |
bbbabee to
9d54e36
Compare
Signed-off-by: hengwu0 <17380582683@163.com>
|
I'm sorry, but I don't want to support running tests as root. Have Dockerfile or sudo or some other mechanism drop privileges instead. |
fix bug #76