[CRIU] [PATCH 2/2] test: rpc: run test as a non-root user

Ruslan Kuprieiev kupruser at gmail.com
Thu Jan 22 08:00:54 PST 2015


Forgot to add:

Reported-by: Andrey Vagin <avagin at openvz.org>

On 01/22/2015 05:59 PM, Ruslan Kuprieiev wrote:
> It is nice to have non-root user case covered with tests.
>
> Signed-off-by: Ruslan Kuprieiev <kupruser at gmail.com>
> ---
>   test/rpc/Makefile | 11 ++++++++---
>   test/rpc/run.sh   |  2 +-
>   2 files changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/test/rpc/Makefile b/test/rpc/Makefile
> index 2cc13fd..46f36a8 100644
> --- a/test/rpc/Makefile
> +++ b/test/rpc/Makefile
> @@ -1,9 +1,14 @@
> -all: test-c rpc_pb2.py
> +all: test-c rpc_pb2.py criu
>   .PHONY: all
>   
>   run: all
>   	mkdir -p build
> -	./run.sh
> +	chmod a+rwx build
> +	sudo -g '#1000' -u '#1000' ./run.sh
> +
> +criu:
> +	cp ../../criu $@
> +	chmod u+s $@
>   
>   test-c: rpc.pb-c.o test.o
>   	gcc $^ -o $@ -lprotobuf-c
> @@ -18,5 +23,5 @@ rpc.pb-c.c: rpc.proto
>   	protoc-c --proto_path=. --c_out=. rpc.proto
>   
>   clean:
> -	rm -rf build rpc.pb-c.o test.o test-c rpc.pb-c.c rpc.pb-c.h rpc_pb2.py rpc_pb2.pyc
> +	rm -rf build rpc.pb-c.o test.o test-c rpc.pb-c.c rpc.pb-c.h rpc_pb2.py rpc_pb2.pyc criu
>   .PHONY: clean
> diff --git a/test/rpc/run.sh b/test/rpc/run.sh
> index f14752d..13eb8e3 100755
> --- a/test/rpc/run.sh
> +++ b/test/rpc/run.sh
> @@ -2,7 +2,7 @@
>   
>   set -e
>   
> -source ../env.sh || exit 1
> +CRIU=./criu
>   
>   export PROTODIR=`readlink -f "${PWD}/../../protobuf"`
>   



More information about the CRIU mailing list