Skip to content

Commit

Permalink
drivers/graphtest: use camel-caps for runRoot
Browse files Browse the repository at this point in the history
Signed-off-by: Han-Wen Nienhuys <[email protected]>
  • Loading branch information
hanwen-flow committed Jan 23, 2025
1 parent 4cc70d4 commit 7c30b8a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions drivers/graphtest/graphtest_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ const (
type Driver struct {
graphdriver.Driver
root string
runroot string
runRoot string
refCount int
}

func newGraphDriver(t testing.TB, name string, options []string, root string, runroot string) graphdriver.Driver {
d, err := graphdriver.GetDriver(name, graphdriver.Options{DriverOptions: options, Root: root, RunRoot: runroot})
func newGraphDriver(t testing.TB, name string, options []string, root string, runRoot string) graphdriver.Driver {
d, err := graphdriver.GetDriver(name, graphdriver.Options{DriverOptions: options, Root: root, RunRoot: runRoot})
if err != nil {
t.Logf("graphdriver: %v\n", err)
os.RemoveAll(runroot)
os.RemoveAll(runRoot)
os.RemoveAll(root)
if errors.Is(err, graphdriver.ErrNotSupported) || errors.Is(err, graphdriver.ErrPrerequisites) || errors.Is(err, graphdriver.ErrIncompatibleFS) {
t.Skipf("Driver %s not supported", name)
Expand All @@ -64,17 +64,17 @@ func newGraphDriver(t testing.TB, name string, options []string, root string, ru
func newDriver(t testing.TB, name string, options []string) *Driver {
root, err := os.MkdirTemp("", "storage-graphtest-")
require.NoError(t, err)
runroot, err := os.MkdirTemp("", "storage-graphtest-")
runRoot, err := os.MkdirTemp("", "storage-graphtest-")
require.NoError(t, err)

return &Driver{newGraphDriver(t, name, options, root, runroot), root, runroot, 1}
return &Driver{newGraphDriver(t, name, options, root, runRoot), root, runRoot, 1}
}

func cleanup(t testing.TB, d *Driver) {
if err := drv.Cleanup(); err != nil {
t.Fatal(err)
}
os.RemoveAll(d.runroot)
os.RemoveAll(d.runRoot)
os.RemoveAll(d.root)
}

Expand All @@ -100,7 +100,7 @@ func ReconfigureDriver(t testing.TB, name string, options ...string) {
if err := drv.Cleanup(); err != nil {
t.Fatal(err)
}
drv.Driver = newGraphDriver(t, name, options, drv.root, drv.runroot)
drv.Driver = newGraphDriver(t, name, options, drv.root, drv.runRoot)
}

// PutDriver removes the driver if it is no longer used and updates the reference count.
Expand Down

0 comments on commit 7c30b8a

Please sign in to comment.