File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -700,6 +700,7 @@ from. Optionally a single string joining container id's with commas
700
700
* extra_hosts (dict ): custom host- to- IP mappings (host:ip)
701
701
* pid_mode (str ): if set to " host" , use the host PID namespace inside the
702
702
container
703
+ * security_opt (list ): A list of string values to customize labels for MLS systems, such as SELinux.
703
704
704
705
```python
705
706
>> > from docker import Client
Original file line number Diff line number Diff line change @@ -2270,6 +2270,19 @@ def test_tar_with_directory_symlinks(self):
2270
2270
tar = tarfile .open (fileobj = archive )
2271
2271
self .assertEqual (sorted (tar .getnames ()), ['bar' , 'bar/foo' , 'foo' ])
2272
2272
2273
+ #######################
2274
+ # HOST CONFIG TESTS #
2275
+ #######################
2276
+
2277
+ def test_create_host_config_secopt (self ):
2278
+ security_opt = ['apparmor:test_profile' ]
2279
+ result = create_host_config (security_opt = security_opt )
2280
+ self .assertIn ('SecurityOpt' , result )
2281
+ self .assertEqual (result ['SecurityOpt' ], security_opt )
2282
+
2283
+ with self .assertRaises (docker .errors .DockerException ):
2284
+ create_host_config (security_opt = 'wrong' )
2285
+
2273
2286
2274
2287
class StreamTest (Cleanup , unittest .TestCase ):
2275
2288
You can’t perform that action at this time.
0 commit comments