@@ -18,6 +18,7 @@ public void parseUsingDefaultAccessMode() {
1818 assertThat (bind .getAccessMode (), is (AccessMode .DEFAULT ));
1919 assertThat (bind .getSecMode (), is (SELContext .none ));
2020 assertThat (bind .getNoCopy (), nullValue ());
21+ assertThat (bind .getPropagationMode (), is (PropagationMode .DEFAULT ));
2122 }
2223
2324 @ Test
@@ -28,8 +29,9 @@ public void parseReadWrite() {
2829 assertThat (bind .getAccessMode (), is (rw ));
2930 assertThat (bind .getSecMode (), is (SELContext .none ));
3031 assertThat (bind .getNoCopy (), nullValue ());
32+ assertThat (bind .getPropagationMode (), is (PropagationMode .DEFAULT ));
3133 }
32-
34+
3335 @ Test
3436 public void parseReadWriteNoCopy () {
3537 Bind bind = Bind .parse ("/host:/container:rw,nocopy" );
@@ -38,6 +40,40 @@ public void parseReadWriteNoCopy() {
3840 assertThat (bind .getAccessMode (), is (rw ));
3941 assertThat (bind .getSecMode (), is (SELContext .none ));
4042 assertThat (bind .getNoCopy (), is (true ));
43+ assertThat (bind .getPropagationMode (), is (PropagationMode .DEFAULT ));
44+ }
45+
46+ @ Test
47+ public void parseReadWriteShared () {
48+ Bind bind = Bind .parse ("/host:/container:rw,shared" );
49+ assertThat (bind .getPath (), is ("/host" ));
50+ assertThat (bind .getVolume ().getPath (), is ("/container" ));
51+ assertThat (bind .getAccessMode (), is (rw ));
52+ assertThat (bind .getSecMode (), is (SELContext .none ));
53+ assertThat (bind .getNoCopy (), nullValue ());
54+ assertThat (bind .getPropagationMode (), is (PropagationMode .mount_shared ));
55+ }
56+
57+ @ Test
58+ public void parseReadWriteSlave () {
59+ Bind bind = Bind .parse ("/host:/container:rw,slave" );
60+ assertThat (bind .getPath (), is ("/host" ));
61+ assertThat (bind .getVolume ().getPath (), is ("/container" ));
62+ assertThat (bind .getAccessMode (), is (rw ));
63+ assertThat (bind .getSecMode (), is (SELContext .none ));
64+ assertThat (bind .getNoCopy (), nullValue ());
65+ assertThat (bind .getPropagationMode (), is (PropagationMode .mount_slave ));
66+ }
67+
68+ @ Test
69+ public void parseReadWritePrivate () {
70+ Bind bind = Bind .parse ("/host:/container:rw,private" );
71+ assertThat (bind .getPath (), is ("/host" ));
72+ assertThat (bind .getVolume ().getPath (), is ("/container" ));
73+ assertThat (bind .getAccessMode (), is (rw ));
74+ assertThat (bind .getSecMode (), is (SELContext .none ));
75+ assertThat (bind .getNoCopy (), nullValue ());
76+ assertThat (bind .getPropagationMode (), is (PropagationMode .mount_private ));
4177 }
4278
4379 @ Test
@@ -48,6 +84,7 @@ public void parseReadOnly() {
4884 assertThat (bind .getAccessMode (), is (ro ));
4985 assertThat (bind .getSecMode (), is (SELContext .none ));
5086 assertThat (bind .getNoCopy (), nullValue ());
87+ assertThat (bind .getPropagationMode (), is (PropagationMode .DEFAULT ));
5188 }
5289
5390 @ Test
@@ -58,13 +95,15 @@ public void parseSELOnly() {
5895 assertThat (bind .getAccessMode (), is (AccessMode .DEFAULT ));
5996 assertThat (bind .getSecMode (), is (SELContext .single ));
6097 assertThat (bind .getNoCopy (), nullValue ());
98+ assertThat (bind .getPropagationMode (), is (PropagationMode .DEFAULT ));
6199
62100 bind = Bind .parse ("/host:/container:z" );
63101 assertThat (bind .getPath (), is ("/host" ));
64102 assertThat (bind .getVolume ().getPath (), is ("/container" ));
65103 assertThat (bind .getAccessMode (), is (AccessMode .DEFAULT ));
66104 assertThat (bind .getSecMode (), is (SELContext .shared ));
67105 assertThat (bind .getNoCopy (), nullValue ());
106+ assertThat (bind .getPropagationMode (), is (PropagationMode .DEFAULT ));
68107 }
69108
70109 @ Test
@@ -75,6 +114,7 @@ public void parseReadWriteSEL() {
75114 assertThat (bind .getAccessMode (), is (rw ));
76115 assertThat (bind .getSecMode (), is (SELContext .single ));
77116 assertThat (bind .getNoCopy (), nullValue ());
117+ assertThat (bind .getPropagationMode (), is (PropagationMode .DEFAULT ));
78118 }
79119
80120 @ Test
@@ -85,6 +125,7 @@ public void parseReadOnlySEL() {
85125 assertThat (bind .getAccessMode (), is (ro ));
86126 assertThat (bind .getSecMode (), is (SELContext .shared ));
87127 assertThat (bind .getNoCopy (), nullValue ());
128+ assertThat (bind .getPropagationMode (), is (PropagationMode .DEFAULT ));
88129 }
89130
90131 @ Test (expectedExceptions = IllegalArgumentException .class , expectedExceptionsMessageRegExp = "Error parsing Bind.*" )
@@ -111,12 +152,27 @@ public void toStringReadOnly() {
111152 public void toStringReadWrite () {
112153 assertThat (Bind .parse ("/host:/container:rw" ).toString (), is ("/host:/container:rw" ));
113154 }
114-
155+
115156 @ Test
116157 public void toStringReadWriteNoCopy () {
117158 assertThat (Bind .parse ("/host:/container:rw,nocopy" ).toString (), is ("/host:/container:rw,nocopy" ));
118159 }
119160
161+ @ Test
162+ public void toStringReadWriteShared () {
163+ assertThat (Bind .parse ("/host:/container:rw,shared" ).toString (), is ("/host:/container:rw,shared" ));
164+ }
165+
166+ @ Test
167+ public void toStringReadWriteSlave () {
168+ assertThat (Bind .parse ("/host:/container:rw,slave" ).toString (), is ("/host:/container:rw,slave" ));
169+ }
170+
171+ @ Test
172+ public void toStringReadWritePrivate () {
173+ assertThat (Bind .parse ("/host:/container:rw,private" ).toString (), is ("/host:/container:rw,private" ));
174+ }
175+
120176 @ Test
121177 public void toStringDefaultAccessMode () {
122178 assertThat (Bind .parse ("/host:/container" ).toString (), is ("/host:/container:rw" ));
0 commit comments