TestMountOptSetTmpfsNoError tests several aliases that should have the same result.
(t *testing.T)
| 452 | // TestMountOptSetTmpfsNoError tests several aliases that should have |
| 453 | // the same result. |
| 454 | func 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 | |
| 478 | func TestMountOptSetBindCreateSrc(t *testing.T) { |
| 479 | tests := []struct { |