docker-py icon indicating copy to clipboard operation
docker-py copied to clipboard

tests/integration: Make the tests runnable on SELinux enabled daemon

Open ricardobranco777 opened this issue 2 months ago • 0 comments

Make the tests runnable on SELinux enabled daemon.

Otherwise I get failures like these: https://openqa.opensuse.org/tests/5393787/file/python_docker-integration.txt

=================================== FAILURES ===================================
___________________ VolumeBindTest.test_create_with_binds_ro ___________________
tests/integration/api_container_test.py:511: in setUp
    self.run_with_volume(
tests/integration/api_container_test.py:636: in run_with_volume
    return self.run_container(
tests/integration/base.py:106: in run_container
    raise Exception(
E   Exception: Container exited with code 1:
E   b'touch: /mnt/shared.txt: Permission denied\n'
___________________ VolumeBindTest.test_create_with_binds_rw ___________________
tests/integration/api_container_test.py:511: in setUp
    self.run_with_volume(
tests/integration/api_container_test.py:636: in run_with_volume
    return self.run_container(
tests/integration/base.py:106: in run_container
    raise Exception(
E   Exception: Container exited with code 1:
E   b'touch: /mnt/shared.txt: Permission denied\n'
_______________ VolumeBindTest.test_create_with_binds_rw_rshared _______________
tests/integration/api_container_test.py:511: in setUp
    self.run_with_volume(
tests/integration/api_container_test.py:636: in run_with_volume
    return self.run_container(
tests/integration/base.py:106: in run_container
    raise Exception(
E   Exception: Container exited with code 1:
E   b'touch: /mnt/shared.txt: Permission denied\n'
____________________ VolumeBindTest.test_create_with_mounts ____________________
tests/integration/api_container_test.py:511: in setUp
    self.run_with_volume(
tests/integration/api_container_test.py:636: in run_with_volume
    return self.run_container(
tests/integration/base.py:106: in run_container
    raise Exception(
E   Exception: Container exited with code 1:
E   b'touch: /mnt/shared.txt: Permission denied\n'
__________________ VolumeBindTest.test_create_with_mounts_ro ___________________
tests/integration/api_container_test.py:511: in setUp
    self.run_with_volume(
tests/integration/api_container_test.py:636: in run_with_volume
    return self.run_container(
tests/integration/base.py:106: in run_container
    raise Exception(
E   Exception: Container exited with code 1:
E   b'touch: /mnt/shared.txt: Permission denied\n'
_________________ VolumeBindTest.test_create_with_volume_mount _________________
tests/integration/api_container_test.py:511: in setUp
    self.run_with_volume(
tests/integration/api_container_test.py:636: in run_with_volume
    return self.run_container(
tests/integration/base.py:106: in run_container
    raise Exception(
E   Exception: Container exited with code 1:
E   b'touch: /mnt/shared.txt: Permission denied\n'
_________________ ContainerCollectionTest.test_run_with_volume _________________
tests/integration/models_containers_test.py:58: in test_run_with_volume
    out = client.containers.run(
docker/models/containers.py:905: in run
    raise ContainerError(
E   docker.errors.ContainerError: Command 'cat /insidecontainer/test' in image 'alpine' returned non-zero exit status 1: b"cat: can't open '/insidecontainer/test': No such file or directory\n"

ricardobranco777 avatar Oct 18 '25 19:10 ricardobranco777