Skip to content
This repository has been archived by the owner on Apr 5, 2018. It is now read-only.

Tests fail when /tmp is mounted with noeexec option #31

Open
vojtechsokol opened this issue Feb 19, 2018 · 0 comments
Open

Tests fail when /tmp is mounted with noeexec option #31

vojtechsokol opened this issue Feb 19, 2018 · 0 comments

Comments

@vojtechsokol
Copy link

vojtechsokol commented Feb 19, 2018

git clone https://github.com/leapp-to/leapp-go
cd leapp-go
make test
?       _/root/leapp-go/cmd/actor-stdout        [no test files]
fork/exec /tmp/go-build232987098/_/root/leapp-go/cmd/leapp-daemon/_test/leapp-daemon.test: permission denied
FAIL    _/root/leapp-go/cmd/leapp-daemon        0.009s
fork/exec /tmp/go-build232987098/_/root/leapp-go/pkg/api/_test/api.test: permission denied
FAIL    _/root/leapp-go/pkg/api 0.000s
fork/exec /tmp/go-build232987098/_/root/leapp-go/pkg/db/_test/db.test: permission denied
FAIL    _/root/leapp-go/pkg/db  0.002s
fork/exec /tmp/go-build232987098/_/root/leapp-go/pkg/executor/_test/executor.test: permission denied
FAIL    _/root/leapp-go/pkg/executor    0.000s
?       _/root/leapp-go/pkg/web [no test files]
make: *** [Makefile:25: test] Error 1

The permision denied error is caused by mounting /tmp with noexec option (in docker container):

findmnt /tmp
/tmp   tmpfs  tmpfs  rw,nosuid,nodev,noexec,relatime,seclabel

A possible workaround is to set TMPDIR environment variable:

TMPDIR=/root/go-tmp/ make test
?       _/root/leapp-go/cmd/actor-stdout        [no test files]
ok      _/root/leapp-go/cmd/leapp-daemon        0.026s                                                                                                                                                                                       
ok      _/root/leapp-go/pkg/api 0.003s                                                                                                                                                                                                       
ok      _/root/leapp-go/pkg/db  0.002s                                                                                                                                                                                                       
ok      _/root/leapp-go/pkg/executor    0.010s                                                                                                                                                                                               
?       _/root/leapp-go/pkg/web [no test files]    

Other way is to use Go 1.10, where GOTMPDIR can be specified.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant