action #101444
closedcoordination #90086: [epic] Refactor container tests
Move install_podman_when_needed and install_docker_when_needed to engine class.
0%
Description
Currently we have these 2 functions in lib/containers/common.pm
:
install_podman_when_needed
install_docker_when_needed
The idea of this ticket is to move this logic to engine.pm
, and simply do:
$engine->install()
This way, when we create the object engine
via Factory class,
my $engine = $self->containers_factory('podman');
should also install the packages and configure_insecure_registries
, so we don't need to do that in the tests every time.
This depends on https://progress.opensuse.org/issues/90086
Updated by jlausuch about 3 years ago
- Subject changed from Move to Move install_podman_when_needed and install_docker_when_needed to engine class.
Updated by jlausuch about 3 years ago
Blocked by: https://progress.opensuse.org/issues/101442
Updated by pdostal about 3 years ago
- Status changed from Workable to In Progress
I am working on this.
Updated by ybonatakis about 3 years ago
Engine class is not the proper place for it.
As i have mentioned here the design should not mix interrelated ideas. The Engine should deal with container engine tools. The installation is different topic.
Updated by jlausuch about 3 years ago
As discussed during a call, this might not be the best solution.
Alternative proposals:
- Leave
install_podman_when_needed
where it is, so others can use it without creating theengine
object, and call to this function in the Factory after creatingengine
. - Leave everything as it is, the test modules are responsible for installing the packages (current situation).
- Add
host_configuration.pm
to all the container tests and call the installation of packages ONLY there (remove it from the tests modules).
Updated by pdostal about 3 years ago
jlausuch wrote:
As discussed during a call, this might not be the best solution.
Alternative proposals:
- Leave
install_podman_when_needed
where it is, so others can use it without creating theengine
object, and call to this function in the Factory after creatingengine
.- Leave everything as it is, the test modules are responsible for installing the packages (current situation).
- Add
host_configuration.pm
to all the container tests and call the installation of packages ONLY there (remove it from the tests modules).
I vote for the first approach of calling install_podman_when_needed
after creating the engine
object.
Updated by jlausuch about 3 years ago
pdostal wrote:
jlausuch wrote:
As discussed during a call, this might not be the best solution.
Alternative proposals:
- Leave
install_podman_when_needed
where it is, so others can use it without creating theengine
object, and call to this function in the Factory after creatingengine
.- Leave everything as it is, the test modules are responsible for installing the packages (current situation).
- Add
host_configuration.pm
to all the container tests and call the installation of packages ONLY there (remove it from the tests modules).I vote for the first approach of calling
install_podman_when_needed
after creating theengine
object.
Me too. I would go even further and create a init() function for engine Class where we do those calls, and in factory we just do $engine->init()
, same as for public cloud.
Updated by ybonatakis about 3 years ago
jlausuch wrote:
As discussed during a call, this might not be the best solution.
Alternative proposals:Some ideas:
- Leave
install_podman_when_needed
where it is, so others can use it without creating theengine
object, and call to this function in the Factory after creatingengine
.
my $engine = $self->containers_factory('podman');
$engine->init();
i think it makes sense to have an init()(or install() if you want) in the containers::basetest. in this case, containers_factory
doesnt need to take care of anything else or be modified, and serves one purpose as factory. But as containers::basetest, we can include and provide that logic here.
- Leave everything as it is, the test modules are responsible for installing the packages (current situation).
- Add
host_configuration.pm
to all the container tests and call the installation of packages ONLY there (remove it from the tests modules).
it is an option but i kinda afraid this as it will create module dependencies. it could be used as plan B. if host_configuration.pm
is not suitable, we might make another module (container_install.pm)
i have also other things in mind but i think it is a bit more complicated so not to consider at the moment
Updated by jlausuch about 3 years ago
Ok, do we agree for now to leave the install functions where they are and create a function init()
in the engines to call those functions?
Updated by pdostal about 3 years ago
jlausuch wrote:
Ok, do we agree for now to leave the install functions where they are and create a function
init()
in the engines to call those functions?
Yes.
Updated by jlausuch about 3 years ago
- Status changed from In Progress to Rejected
I am rejecting this ticket as discussed.