Skip to content

Commit 7ff8aed

Browse files
committed
WIP: Fix TestTransportParseReference on macOS
Originally, when the test was written, an empty runRoot or graphRoot was rejected by storage.GetStore. That changed in ce62453 , when GetStore started accepting inputs with at least one of runRoot / graphRoot set, using the default path for the unspecified one. The test continued to work because the default value, on macOS, was /run/..., and an attempt to create that directory failed. The recent c/storage configuration redesign changed the defaults, and they are now a temporary runtime dir in $TMPDIR. So, update the test to match. Explicitly specify the graph driver to avoid interfering with other local storage. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
1 parent 380549a commit 7ff8aed

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

image/storage/storage_transport_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,16 @@ func TestTransportParseReference(t *testing.T) {
100100
root := store.GraphRoot()
101101

102102
for _, c := range []struct{ prefix, expectedDriver, expectedRoot, expectedRunRoot string }{
103-
{"", driver, root, ""}, // Implicit store location prefix
104-
{"[unterminated", "", "", ""}, // Unterminated store specifier
105-
{"[]", "", "", ""}, // Empty store specifier
106-
{"[relative/path]", "", "", ""}, // Non-absolute graph root path
107-
{"[" + driver + "@relative/path]", "", "", ""}, // Non-absolute graph root path
108-
{"[@" + root + "suffix2]", "", "", ""}, // Empty graph driver
109-
{"[" + driver + "@]", "", "", ""}, // Empty root path
110-
{"[thisisunknown@" + root + "suffix2]", "", "", ""}, // Unknown graph driver
111-
{"[" + root + "suffix1]", "", "", ""}, // A valid root path, but no run dir
112-
{"[" + driver + "@" + root + "suffix3+relative/path]", "", "", ""}, // Non-absolute run dir
103+
{"", driver, root, ""}, // Implicit store location prefix
104+
{"[unterminated", "", "", ""}, // Unterminated store specifier
105+
{"[]", "", "", ""}, // Empty store specifier
106+
{"[relative/path]", "", "", ""}, // Non-absolute graph root path
107+
{"[" + driver + "@relative/path]", "", "", ""}, // Non-absolute graph root path
108+
{"[@" + root + "suffix2]", "", "", ""}, // Empty graph driver
109+
{"[" + driver + "@]", "", "", ""}, // Empty root path
110+
{"[thisisunknown@" + root + "suffix2]", "", "", ""}, // Unknown graph driver
111+
{"[" + driver + "@" + root + "suffix1]", driver, root + "suffix1", ""}, //A valid root path, but no run dir
112+
{"[" + driver + "@" + root + "suffix3+relative/path]", "", "", ""}, // Non-absolute run dir
113113
{
114114
"[" + driver + "@" + root + "suffix3+" + root + "suffix4]",
115115
driver,

0 commit comments

Comments
 (0)