]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
cephadm: fix a cephadm test when docker doesn't exist 51579/head
authorJohn Mulligan <jmulligan@redhat.com>
Thu, 18 May 2023 20:46:50 +0000 (16:46 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Sat, 20 May 2023 14:23:23 +0000 (10:23 -0400)
commit66b23909687e91d737ec7f54928940ae263b81df
treed516187d164703021146c773bc33b97882ef75ea
parentecebe2f4b2d126a5bc311a0cff559b4a64795056
cephadm: fix a cephadm test when docker doesn't exist

Previously, when I ran the cephadm test suite locally the test case
test_mon_crush_location was failing with the error:
```
>       with pytest.raises(Exception, match='--set-crush-location
database=a'):
E       AssertionError: Regex pattern did not match.
E        Regex: '--set-crush-location database=a'
E        Input: "[Errno 2] No such file or directory: '/usr/bin/docker'"

```

At the very least this test should run on a system that doesn't
have docker installed. Although, I don't know why this test
would have passed on any system that wasn't actively running
a cephadm container...

This patch mocks out `extract_uid_gid` which was calling
out to docker even in the unit tests.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/cephadm/tests/test_cephadm.py