mirror of
https://github.com/containers/podman.git
synced 2025-05-20 08:36:23 +08:00
test: fix failing TestPostDeleteHooks
We no longer create the temporary directory as `libpod_test_*`. The directory returned by `t.TempDir()` is TestPostDeleteHooks/001 Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
@ -4,10 +4,8 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
rspec "github.com/opencontainers/runtime-spec/specs-go"
|
||||
@ -58,7 +56,7 @@ func TestPostDeleteHooks(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
stateRegexp := `{"ociVersion":"1\.0\.2-dev","id":"123abc","status":"stopped","bundle":"` + strings.TrimSuffix(os.TempDir(), "/") + `/libpod_test_[0-9]*","annotations":{"a":"b"}}`
|
||||
stateRegexp := `{"ociVersion":"1\.0\.2-dev","id":"123abc","status":"stopped","bundle":"` + dir + `","annotations":{"a":"b"}}`
|
||||
for _, p := range []string{statePath, copyPath} {
|
||||
path := p
|
||||
t.Run(path, func(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user