Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make test not working #33

Closed
kolyshkin opened this issue Oct 11, 2020 · 3 comments
Closed

make test not working #33

kolyshkin opened this issue Oct 11, 2020 · 3 comments

Comments

@kolyshkin
Copy link
Contributor

I tried to run make test for this repo and it's not working

[kir@kir-rhat go-criu]$ make test
mkdir -p image
test/piggie
Child forked, pid -1
test/test dump `pidof piggie` image
CRIU version 31500
panic: runtime error: index out of range [3] with length 3

goroutine 1 [running]:
main.main()
	/home/kir/go/src/github.com/checkpoint-restore/go-criu/test/main.go:79 +0xc88
make: *** [Makefile:28: test] Error 2

One thing I can see is test/piggie is run w/o arguments, while it requires a log file as an argument. The other (secondary) issue is lack of error checking.

I have a feeling I am missing something very obvious here; please help.

@rst0git
Copy link
Member

rst0git commented Oct 11, 2020

I have a feeling I am missing something very obvious here; please help.

checkpoint/restore of test/piggie requires root privileges.

$ sudo make test
mkdir -p image
test/piggie
Child forked, pid 325139
test/test dump `pidof piggie` image                                                                                                                   
CRIU version 31500                                                                                                                                    
Dumping                                                                                                                                               
TEST PRE DUMP                                                                                                                                         
Success                                                                                                                                               
test/test restore image                                                                                                                               
CRIU version 31500                                                                                                                                    
Restoring                                                                                                                                             
Success                                                                                                                                               
pkill -9 piggie || :

@kolyshkin
Copy link
Contributor Author

This was caused by not running tests as root, as well as lack of checking in piggie and Makefile.

All this is addressed now:

@kolyshkin
Copy link
Contributor Author

now fixed:

[kir@kir-rhat go-criu]$ make test
mkdir -p image
PID=$(test/piggie/piggie) && { \
test/test dump $PID image && \
test/test restore image; \
pkill -9 piggie; \
}
clone() failed: Operation not permitted
make: *** [Makefile:23: test] Error 1

(it' is more clear now that EPERM is the cause of the failure, and where it comes from)

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

No branches or pull requests

2 participants