mirror of
https://github.com/containers/buildah.git
synced 2026-02-05 09:45:38 +01:00
This change is generated by `go1.23rc2 fix ./...`. Had to use go1.23rc2, since all released go versions have a bug preventing it from working with `go 1.22.0` in go.mod (opened https://github.com/golang/go/issues/68825, https://github.com/golang/go/issues/68824 for awareness). Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
78 lines
1.4 KiB
Go
78 lines
1.4 KiB
Go
//go:build !windows
|
|
|
|
package copier
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestPutChroot(t *testing.T) {
|
|
if uid != 0 {
|
|
t.Skip("chroot() requires root privileges, skipping")
|
|
}
|
|
couldChroot := canChroot
|
|
canChroot = true
|
|
testPut(t)
|
|
canChroot = couldChroot
|
|
}
|
|
|
|
func TestStatChroot(t *testing.T) {
|
|
if uid != 0 {
|
|
t.Skip("chroot() requires root privileges, skipping")
|
|
}
|
|
couldChroot := canChroot
|
|
canChroot = true
|
|
testStat(t)
|
|
canChroot = couldChroot
|
|
}
|
|
|
|
func TestGetSingleChroot(t *testing.T) {
|
|
if uid != 0 {
|
|
t.Skip("chroot() requires root privileges, skipping")
|
|
}
|
|
couldChroot := canChroot
|
|
canChroot = true
|
|
testGetSingle(t)
|
|
canChroot = couldChroot
|
|
}
|
|
|
|
func TestGetMultipleChroot(t *testing.T) {
|
|
if uid != 0 {
|
|
t.Skip("chroot() requires root privileges, skipping")
|
|
}
|
|
couldChroot := canChroot
|
|
canChroot = true
|
|
testGetMultiple(t)
|
|
canChroot = couldChroot
|
|
}
|
|
|
|
func TestEvalChroot(t *testing.T) {
|
|
if uid != 0 {
|
|
t.Skip("chroot() requires root privileges, skipping")
|
|
}
|
|
couldChroot := canChroot
|
|
canChroot = true
|
|
testEval(t)
|
|
canChroot = couldChroot
|
|
}
|
|
|
|
func TestMkdirChroot(t *testing.T) {
|
|
if uid != 0 {
|
|
t.Skip("chroot() requires root privileges, skipping")
|
|
}
|
|
couldChroot := canChroot
|
|
canChroot = true
|
|
testMkdir(t)
|
|
canChroot = couldChroot
|
|
}
|
|
|
|
func TestRemoveChroot(t *testing.T) {
|
|
if uid != 0 {
|
|
t.Skip("chroot() requires root privileges, skipping")
|
|
}
|
|
couldChroot := canChroot
|
|
canChroot = true
|
|
testRemove(t)
|
|
canChroot = couldChroot
|
|
}
|