MCPcopy Create free account
hub / github.com/docker/cli / TestMountOptSetTmpfsNoError

Function TestMountOptSetTmpfsNoError

opts/mount_test.go:454–476  ·  view source on GitHub ↗

TestMountOptSetTmpfsNoError tests several aliases that should have the same result.

(t *testing.T)

Source from the content-addressed store, hash-verified

452// TestMountOptSetTmpfsNoError tests several aliases that should have
453// the same result.
454func TestMountOptSetTmpfsNoError(t *testing.T) {
455 for _, tc := range []string{
456 "type=tmpfs,target=/target,tmpfs-size=1m,tmpfs-mode=0700",
457 "type=tmpfs,target=/target,tmpfs-size=1MB,tmpfs-mode=700",
458 } {
459 t.Run(tc, func(t *testing.T) {
460 var m MountOpt
461
462 assert.NilError(t, m.Set(tc))
463
464 mounts := m.Value()
465 assert.Assert(t, is.Len(mounts, 1))
466 assert.Check(t, is.DeepEqual(mount.Mount{
467 Type: mount.TypeTmpfs,
468 Target: "/target",
469 TmpfsOptions: &mount.TmpfsOptions{
470 SizeBytes: 1024 * 1024, // not 1000 * 1000
471 Mode: os.FileMode(0o700),
472 },
473 }, mounts[0]))
474 })
475 }
476}
477
478func TestMountOptSetBindCreateSrc(t *testing.T) {
479 tests := []struct {

Callers

nothing calls this directly

Calls 3

SetMethod · 0.95
ValueMethod · 0.95
LenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…