| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -118,10 +118,16 @@ public static Bind parse(String serialized) { | |||
| 118 | 118 | nocopy = true; | |
| 119 | 119 | } else if (PropagationMode.SHARED.toString().equals(p)) { | |
| 120 | 120 | propagationMode = PropagationMode.SHARED; | |
| 121 | + } else if (PropagationMode.RSHARED.toString().equals(p)) { | ||
| 122 | + propagationMode = PropagationMode.RSHARED; | ||
| 121 | 123 | } else if (PropagationMode.SLAVE.toString().equals(p)) { | |
| 122 | 124 | propagationMode = PropagationMode.SLAVE; | |
| 125 | + } else if (PropagationMode.RSLAVE.toString().equals(p)) { | ||
| 126 | + propagationMode = PropagationMode.RSLAVE; | ||
| 123 | 127 | } else if (PropagationMode.PRIVATE.toString().equals(p)) { | |
| 124 | 128 | propagationMode = PropagationMode.PRIVATE; | |
| 129 | + } else if (PropagationMode.RPRIVATE.toString().equals(p)) { | ||
| 130 | + propagationMode = PropagationMode.RPRIVATE; | ||
| 125 | 131 | } else { | |
| 126 | 132 | seMode = SELContext.fromString(p); | |
| 127 | 133 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -166,6 +166,17 @@ public void parseReadWriteShared() { | |||
| 166 | 166 | assertThat(bind.getPropagationMode(), is(PropagationMode.SHARED)); | |
| 167 | 167 | } | |
| 168 | 168 | ||
| 169 | + @Test | ||
| 170 | + public void parseReadWriteRshared() { | ||
| 171 | + Bind bind = Bind.parse("/host:/container:rw,rshared"); | ||
| 172 | + assertThat(bind.getPath(), is("/host")); | ||
| 173 | + assertThat(bind.getVolume().getPath(), is("/container")); | ||
| 174 | + assertThat(bind.getAccessMode(), is(rw)); | ||
| 175 | + assertThat(bind.getSecMode(), is(SELContext.none)); | ||
| 176 | + assertThat(bind.getNoCopy(), nullValue()); | ||
| 177 | + assertThat(bind.getPropagationMode(), is(PropagationMode.RSHARED)); | ||
| 178 | + } | ||
| 179 | + | ||
| 169 | 180 | @Test | |
| 170 | 181 | public void parseReadWriteSlave() { | |
| 171 | 182 | Bind bind = Bind.parse("/host:/container:rw,slave"); | |
@@ -177,6 +188,17 @@ public void parseReadWriteSlave() { | |||
| 177 | 188 | assertThat(bind.getPropagationMode(), is(PropagationMode.SLAVE)); | |
| 178 | 189 | } | |
| 179 | 190 | ||
| 191 | + @Test | ||
| 192 | + public void parseReadWriteRslave() { | ||
| 193 | + Bind bind = Bind.parse("/host:/container:rw,rslave"); | ||
| 194 | + assertThat(bind.getPath(), is("/host")); | ||
| 195 | + assertThat(bind.getVolume().getPath(), is("/container")); | ||
| 196 | + assertThat(bind.getAccessMode(), is(rw)); | ||
| 197 | + assertThat(bind.getSecMode(), is(SELContext.none)); | ||
| 198 | + assertThat(bind.getNoCopy(), nullValue()); | ||
| 199 | + assertThat(bind.getPropagationMode(), is(PropagationMode.RSLAVE)); | ||
| 200 | + } | ||
| 201 | + | ||
| 180 | 202 | @Test | |
| 181 | 203 | public void parseReadWritePrivate() { | |
| 182 | 204 | Bind bind = Bind.parse("/host:/container:rw,private"); | |
@@ -188,6 +210,17 @@ public void parseReadWritePrivate() { | |||
| 188 | 210 | assertThat(bind.getPropagationMode(), is(PropagationMode.PRIVATE)); | |
| 189 | 211 | } | |
| 190 | 212 | ||
| 213 | + @Test | ||
| 214 | + public void parseReadWriteRprivate() { | ||
| 215 | + Bind bind = Bind.parse("/host:/container:rw,rprivate"); | ||
| 216 | + assertThat(bind.getPath(), is("/host")); | ||
| 217 | + assertThat(bind.getVolume().getPath(), is("/container")); | ||
| 218 | + assertThat(bind.getAccessMode(), is(rw)); | ||
| 219 | + assertThat(bind.getSecMode(), is(SELContext.none)); | ||
| 220 | + assertThat(bind.getNoCopy(), nullValue()); | ||
| 221 | + assertThat(bind.getPropagationMode(), is(PropagationMode.RPRIVATE)); | ||
| 222 | + } | ||
| 223 | + | ||
| 191 | 224 | @Test | |
| 192 | 225 | public void parseReadOnly() { | |
| 193 | 226 | Bind bind = Bind.parse("/host:/container:ro"); | |
@@ -284,16 +317,31 @@ public void toStringReadWriteShared() { | |||
| 284 | 317 | assertThat(Bind.parse("/host:/container:rw,shared").toString(), is("/host:/container:rw,shared")); | |
| 285 | 318 | } | |
| 286 | 319 | ||
| 320 | + @Test | ||
| 321 | + public void toStringReadWriteRshared() { | ||
| 322 | + assertThat(Bind.parse("/host:/container:rw,rshared").toString(), is("/host:/container:rw,rshared")); | ||
| 323 | + } | ||
| 324 | + | ||
| 287 | 325 | @Test | |
| 288 | 326 | public void toStringReadWriteSlave() { | |
| 289 | 327 | assertThat(Bind.parse("/host:/container:rw,slave").toString(), is("/host:/container:rw,slave")); | |
| 290 | 328 | } | |
| 291 | 329 | ||
| 330 | + @Test | ||
| 331 | + public void toStringReadWriteRslave() { | ||
| 332 | + assertThat(Bind.parse("/host:/container:rw,rslave").toString(), is("/host:/container:rw,rslave")); | ||
| 333 | + } | ||
| 334 | + | ||
| 292 | 335 | @Test | |
| 293 | 336 | public void toStringReadWritePrivate() { | |
| 294 | 337 | assertThat(Bind.parse("/host:/container:rw,private").toString(), is("/host:/container:rw,private")); | |
| 295 | 338 | } | |
| 296 | 339 | ||
| 340 | + @Test | ||
| 341 | + public void toStringReadWriteRprivate() { | ||
| 342 | + assertThat(Bind.parse("/host:/container:rw,rprivate").toString(), is("/host:/container:rw,rprivate")); | ||
| 343 | + } | ||
| 344 | + | ||
| 297 | 345 | @Test | |
| 298 | 346 | public void toStringDefaultAccessMode() { | |
| 299 | 347 | assertThat(Bind.parse("/host:/container").toString(), is("/host:/container:rw")); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments