Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions storage/pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,27 @@ func TestZfsOptions(t *testing.T) {
t.Fatalf("Expected to find size %q, got %v", s100, doptions)
}
}

// Options set in different driver sections must all survive one call. Every
// other test here sets a single field on a fresh OptionsConfig, so a branch
// that ends the chain early goes unnoticed: 5d9d814bc3 fixed btrfs.min_space
// returning instead of appending, and this package passed either way.
func TestCombinedDriverOptions(t *testing.T) {
var options OptionsConfig
options.Btrfs.MinSpace = s100
options.Overlay.MountOpt = nodev
options.Vfs.IgnoreChownErrors = trueString
options.Zfs.Name = foobar

doptions := GetGraphDriverOptions(options)
for _, want := range []string{
"btrfs.min_space=" + s100,
"overlay.mountopt=" + nodev,
"vfs.ignore_chown_errors=" + trueString,
"zfs.fsname=" + foobar,
} {
if !searchOptions(doptions, want) {
t.Fatalf("Expected to find %q, got %v", want, doptions)
}
}
}
Loading