mirror of
https://github.com/containers/podman.git
synced 2025-05-17 23:26:08 +08:00
Fix TestPostDeleteHooks on macOS
os.TempDir() is /var/folders/.../T/ on macOS, not /tmp. Signed-off-by: Miloslav Trmač <mitr@redhat.com> Closes: #1111 Approved by: baude
This commit is contained in:

committed by
Atomic Bot

parent
930660c36b
commit
cedb4576a4
@ -7,6 +7,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
rspec "github.com/opencontainers/runtime-spec/specs-go"
|
||||
@ -59,7 +60,7 @@ func TestPostDeleteHooks(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
stateRegexp := `{"ociVersion":"1\.0\.0","id":"123abc","status":"stopped","bundle":"/tmp/libpod_test_[0-9]*","annotations":{"a":"b"}}`
|
||||
stateRegexp := `{"ociVersion":"1\.0\.0","id":"123abc","status":"stopped","bundle":"` + strings.TrimSuffix(os.TempDir(), "/") + `/libpod_test_[0-9]*","annotations":{"a":"b"}}`
|
||||
for _, path := range []string{statePath, copyPath} {
|
||||
t.Run(path, func(t *testing.T) {
|
||||
content, err := ioutil.ReadFile(path)
|
||||
|
Reference in New Issue
Block a user