mirror of
https://github.com/containers/podman-compose.git
synced 2025-01-07 14:39:53 +01:00
Add tests for x-podman.uidmaps and x-podman.gidmaps
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
This commit is contained in:
parent
9599cc039e
commit
a6c4263738
@ -171,6 +171,50 @@ class TestContainerToArgs(unittest.IsolatedAsyncioTestCase):
|
||||
with self.assertRaises(ValueError):
|
||||
await container_to_args(c, cnt)
|
||||
|
||||
async def test_uidmaps_extension(self):
|
||||
c = create_compose_mock()
|
||||
|
||||
cnt = get_minimal_container()
|
||||
cnt['x-podman.uidmaps'] = ['1000:1000:1', '1001:1001:2']
|
||||
|
||||
args = await container_to_args(c, cnt)
|
||||
self.assertEqual(
|
||||
args,
|
||||
[
|
||||
"--name=project_name_service_name1",
|
||||
"-d",
|
||||
"--network=bridge",
|
||||
"--network-alias=service_name",
|
||||
'--uidmap',
|
||||
'1000:1000:1',
|
||||
'--uidmap',
|
||||
'1001:1001:2',
|
||||
"busybox",
|
||||
],
|
||||
)
|
||||
|
||||
async def test_gidmaps_extension(self):
|
||||
c = create_compose_mock()
|
||||
|
||||
cnt = get_minimal_container()
|
||||
cnt['x-podman.gidmaps'] = ['1000:1000:1', '1001:1001:2']
|
||||
|
||||
args = await container_to_args(c, cnt)
|
||||
self.assertEqual(
|
||||
args,
|
||||
[
|
||||
"--name=project_name_service_name1",
|
||||
"-d",
|
||||
"--network=bridge",
|
||||
"--network-alias=service_name",
|
||||
'--gidmap',
|
||||
'1000:1000:1',
|
||||
'--gidmap',
|
||||
'1001:1001:2',
|
||||
"busybox",
|
||||
],
|
||||
)
|
||||
|
||||
async def test_rootfs_extension(self):
|
||||
c = create_compose_mock()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user