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

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

@vojtechsokol

Description

@vojtechsokol
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions