(t *testing.T)
| 95 | } |
| 96 | |
| 97 | func TestBindToOverlay(t *testing.T) { |
| 98 | testCases := []struct { |
| 99 | name string |
| 100 | mounts []mount.Mount |
| 101 | expect []mount.Mount |
| 102 | }{ |
| 103 | { |
| 104 | name: "single bind mount", |
| 105 | mounts: []mount.Mount{ |
| 106 | { |
| 107 | Type: "bind", |
| 108 | Source: "/path/to/source", |
| 109 | Options: []string{"ro", "rbind"}, |
| 110 | }, |
| 111 | }, |
| 112 | expect: []mount.Mount{ |
| 113 | { |
| 114 | Type: "overlay", |
| 115 | Source: "overlay", |
| 116 | Options: []string{ |
| 117 | "ro", |
| 118 | "upperdir=/path/to/source", |
| 119 | }, |
| 120 | }, |
| 121 | }, |
| 122 | }, |
| 123 | { |
| 124 | name: "overlay mount", |
| 125 | mounts: []mount.Mount{ |
| 126 | { |
| 127 | Type: "overlay", |
| 128 | Source: "overlay", |
| 129 | Options: []string{ |
| 130 | "lowerdir=/path/to/lower", |
| 131 | "upperdir=/path/to/upper", |
| 132 | }, |
| 133 | }, |
| 134 | }, |
| 135 | expect: []mount.Mount{ |
| 136 | { |
| 137 | Type: "overlay", |
| 138 | Source: "overlay", |
| 139 | Options: []string{ |
| 140 | "lowerdir=/path/to/lower", |
| 141 | "upperdir=/path/to/upper", |
| 142 | }, |
| 143 | }, |
| 144 | }, |
| 145 | }, |
| 146 | { |
| 147 | name: "multiple mounts", |
| 148 | mounts: []mount.Mount{ |
| 149 | { |
| 150 | Type: "bind", |
| 151 | Source: "/path/to/source1", |
| 152 | }, |
| 153 | { |
| 154 | Type: "bind", |
nothing calls this directly
no test coverage detected
searching dependent graphs…