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

run.bats: check that we can run with symlinks in the bundle path #746

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion run.go
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ func setupNamespaces(g *generate.Generator, namespaceOptions NamespaceOptions, i
// Run runs the specified command in the container's root filesystem.
func (b *Builder) Run(command []string, options RunOptions) error {
var user specs.User
p, err := ioutil.TempDir(os.TempDir(), Package)
p, err := ioutil.TempDir("", Package)
if err != nil {
return err
}
Expand Down
14 changes: 14 additions & 0 deletions tests/run.bats
Original file line number Diff line number Diff line change
Expand Up @@ -335,3 +335,17 @@ load helpers
echo "$output"
[ "$status" -ne 0 ]
}

@test "run symlinks" {
if ! which runc ; then
skip
fi
runc --version
cid=$(buildah from --pull --signature-policy ${TESTSDIR}/policy.json alpine)
mkdir -p ${TESTDIR}/tmp
ln -s tmp ${TESTDIR}/tmp2
export TMPDIR=${TESTDIR}/tmp2
run buildah --debug=false run $cid id
echo "$output"
[ "$status" -eq 0 ]
}