mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-11-02 09:07:33 +00:00
Basic theory: We remove the container, but *only from the DB*. We leave it in c/storage, we leave the lock allocated, we leave it running (if it is). Then we create an identical container with an altered name, and add that back to the database. Theoretically we now have a renamed container. The advantage of this approach is that it doesn't just apply to rename - we can use this to make *any* configuration change to a container that does not alter its container ID. Potential problems are numerous. This process is *THOROUGHLY* non-atomic at present - if you `kill -9` Podman mid-rename things will be in a bad place, for example. Also, we can't rename containers that can't be removed normally - IE, containers with dependencies (pod infra containers, for example). The largest potential improvement will be to move the majority of the work into the DB, with a `RecreateContainer()` method - that will add atomicity, and let us remove the container without worrying about depencies and similar issues. Potential problems: long-running processes that edit the DB and may have an older version of the configuration around. Most notable example is `podman run --rm` - the removal command needed to be manually edited to avoid this one. This begins to get at the heart of me not wanting to do this in the first place... This provides CLI and API implementations for frontend, but no tunnel implementation. It will be added in a future release (just held back for time now - we need this in 3.0 and are running low on time). This is honestly kind of horrifying, but I think it will work. Signed-off-by: Matthew Heon <mheon@redhat.com> |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| common.py | ||
| constant.py | ||
| README.md | ||
| test_containers.py | ||
| test_images.py | ||
| test_system.py | ||
Docker regression test
Python test suite to validate Podman endpoints using docker library (aka docker-py). See Docker SDK for Python.
Running Tests
To run the tests locally in your sandbox (Fedora 32,33):
# dnf install python3-docker
Run the entire test suite
# python3 -m unittest discover test/python/docker
Passing the -v option to your test script will instruct unittest.main() to enable a higher level of verbosity, and produce detailed output:
# python3 -m unittest -v discover test/python/docker
Run a specific test class
# cd test/python/docker
# python3 -m unittest -v tests.test_images
Run a specific test within the test class
# cd test/python/docker
# python3 -m unittest tests.test_images.TestImages.test_import_image