ipatests: Update expectations for test_detect_container

Since a4a9a6f7c6
systemd improves the detection of Docker and Podman containers based
on the presence of files-markers.

```console
[slev@test systemd]$ git describe --contains --tags a4a9a6f7c6e9cd9e219c56d08434a04bc2f395ff
v248-rc1~155^2~1
```

Note: on Azure unit tests are run as non-privileged user in non-systemd
inited container.

This worked on F32 because:
```console
[root@6d2aad38f62c /]# rpm -q systemd
systemd-245.9-1.fc32.x86_64
```
So, actual comparison in test was `assert None == None`.

But F34 has:
```console
[root@1ff1325f5a61 /]# rpm -q systemd
systemd-248-2.fc34.x86_64
```
So, the test's expectations should be updated.
Unfortunately, this is incompatible with older versions of systemd
(< v248).

See https://github.com/systemd/systemd/pull/17902 for details.

Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
Stanislav Levin 2021-05-07 19:20:45 +03:00 committed by Alexander Bokovoy
parent 06d7c7f1d3
commit 1aff24e891

View File

@ -47,10 +47,10 @@ def test_detect_container():
k, v = item.split('=', 1)
if k == 'container':
container = v
elif os.path.isfile("/run/.containerenv"):
container = "podman"
elif os.path.isfile("/.dockerenv"):
container = "docker"
detected = tasks.detect_container()
if container == 'oci':
# systemd doesn't know about podman
assert detected in {'container-other', container}
else:
assert detected == container
assert detected == container