tests: update ceph_volume tests

accordingly to change introduced by b5548ea9412cd7741bee993dddcbfd9daa34cb02

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit f2dcb02d21)
pull/3657/head
Guillaume Abrioux 2019-02-28 10:54:03 +01:00 committed by mergify[bot]
parent 58a527c192
commit 320af524d8
2 changed files with 7 additions and 14 deletions

View File

@ -182,14 +182,7 @@ def container_exec(binary, container_image):
''' '''
Build the docker CLI to run a command inside a container Build the docker CLI to run a command inside a container
''' '''
<<<<<<< HEAD command_exec = ['docker', 'run', '--rm', '--privileged', '--net=host', '--ipc=host',
command_exec = ['docker', 'run', '--rm', '--privileged', '--net=host',
=======
container_binary = os.getenv('CEPH_CONTAINER_BINARY')
command_exec = [container_binary, 'run',
'--rm', '--privileged', '--net=host', '--ipc=host',
>>>>>>> 15812970... cv: expose host ipc namespace to ceph-volume container
'-v', '/run/lock/lvm:/run/lock/lvm:z', '-v', '/run/lock/lvm:/run/lock/lvm:z',
'-v', '/var/run/udev/:/var/run/udev/:z', '-v', '/var/run/udev/:/var/run/udev/:z',
'-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z', '-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z',

View File

@ -39,7 +39,7 @@ class TestCephVolumeModule(object):
def test_container_exec(sefl): def test_container_exec(sefl):
fake_binary = "ceph-volume" fake_binary = "ceph-volume"
fake_container_image = "docker.io/ceph/daemon:latest-luminous" fake_container_image = "docker.io/ceph/daemon:latest-luminous"
expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', # noqa E501 expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', '--ipc=host', # noqa E501
'-v', '/run/lock/lvm:/run/lock/lvm:z', '-v', '/run/lock/lvm:/run/lock/lvm:z',
'-v', '/var/run/udev/:/var/run/udev/:z', '-v', '/var/run/udev/:/var/run/udev/:z',
'-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z', # noqa E501 '-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z', # noqa E501
@ -55,7 +55,7 @@ class TestCephVolumeModule(object):
fake_module = MagicMock() fake_module = MagicMock()
fake_module.params = {'data': '/dev/sda'} fake_module.params = {'data': '/dev/sda'}
fake_container_image = "docker.io/ceph/daemon:latest-luminous" fake_container_image = "docker.io/ceph/daemon:latest-luminous"
expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', # noqa E501 expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', '--ipc=host', # noqa E501
'-v', '/run/lock/lvm:/run/lock/lvm:z', '-v', '/run/lock/lvm:/run/lock/lvm:z',
'-v', '/var/run/udev/:/var/run/udev/:z', '-v', '/var/run/udev/:/var/run/udev/:z',
'-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z', # noqa E501 '-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z', # noqa E501
@ -123,7 +123,7 @@ class TestCephVolumeModule(object):
fake_module = MagicMock() fake_module = MagicMock()
fake_module.params = {'cluster': 'ceph', 'data': '/dev/sda'} fake_module.params = {'cluster': 'ceph', 'data': '/dev/sda'}
fake_container_image = "docker.io/ceph/daemon:latest-luminous" fake_container_image = "docker.io/ceph/daemon:latest-luminous"
expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', # noqa E501 expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', '--ipc=host', # noqa E501
'-v', '/run/lock/lvm:/run/lock/lvm:z', '-v', '/run/lock/lvm:/run/lock/lvm:z',
'-v', '/var/run/udev/:/var/run/udev/:z', '-v', '/var/run/udev/:/var/run/udev/:z',
'-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z', # noqa E501 '-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z', # noqa E501
@ -150,7 +150,7 @@ class TestCephVolumeModule(object):
fake_action = "create" fake_action = "create"
fake_container_image = "docker.io/ceph/daemon:latest-luminous" fake_container_image = "docker.io/ceph/daemon:latest-luminous"
expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', # noqa E501 expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', '--ipc=host', # noqa E501
'-v', '/run/lock/lvm:/run/lock/lvm:z', '-v', '/run/lock/lvm:/run/lock/lvm:z',
'-v', '/var/run/udev/:/var/run/udev/:z', '-v', '/var/run/udev/:/var/run/udev/:z',
'-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z', # noqa E501 '-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z', # noqa E501
@ -198,7 +198,7 @@ class TestCephVolumeModule(object):
fake_action = "prepare" fake_action = "prepare"
fake_container_image = "docker.io/ceph/daemon:latest-luminous" fake_container_image = "docker.io/ceph/daemon:latest-luminous"
expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', # noqa E501 expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', '--ipc=host', # noqa E501
'-v', '/run/lock/lvm:/run/lock/lvm:z', '-v', '/run/lock/lvm:/run/lock/lvm:z',
'-v', '/var/run/udev/:/var/run/udev/:z', '-v', '/var/run/udev/:/var/run/udev/:z',
'-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z', # noqa E501 '-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z', # noqa E501
@ -247,7 +247,7 @@ class TestCephVolumeModule(object):
'batch_devices': ["/dev/sda", "/dev/sdb"]} 'batch_devices': ["/dev/sda", "/dev/sdb"]}
fake_container_image = "docker.io/ceph/daemon:latest-luminous" fake_container_image = "docker.io/ceph/daemon:latest-luminous"
expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', # noqa E501 expected_command_list = ['docker', 'run', '--rm', '--privileged', '--net=host', '--ipc=host', # noqa E501
'-v', '/run/lock/lvm:/run/lock/lvm:z', '-v', '/run/lock/lvm:/run/lock/lvm:z',
'-v', '/var/run/udev/:/var/run/udev/:z', '-v', '/var/run/udev/:/var/run/udev/:z',
'-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z', # noqa E501 '-v', '/dev:/dev', '-v', '/etc/ceph:/etc/ceph:z', # noqa E501