| 429 | } |
| 430 | |
| 431 | func TestMountOptSetImageNoError(t *testing.T) { |
| 432 | for _, tc := range []string{ |
| 433 | "type=image,source=foo,target=/target,image-subpath=/bar", |
| 434 | } { |
| 435 | var m MountOpt |
| 436 | |
| 437 | assert.NilError(t, m.Set(tc)) |
| 438 | |
| 439 | mounts := m.Value() |
| 440 | assert.Assert(t, is.Len(mounts, 1)) |
| 441 | assert.Check(t, is.DeepEqual(mount.Mount{ |
| 442 | Type: mount.TypeImage, |
| 443 | Source: "foo", |
| 444 | Target: "/target", |
| 445 | ImageOptions: &mount.ImageOptions{ |
| 446 | Subpath: "/bar", |
| 447 | }, |
| 448 | }, mounts[0])) |
| 449 | } |
| 450 | } |
| 451 | |
| 452 | // TestMountOptSetTmpfsNoError tests several aliases that should have |
| 453 | // the same result. |