swupd-client icon indicating copy to clipboard operation
swupd-client copied to clipboard

Testlib: when creating a bundle, if using `-t` it should also install the bundle

Open castulo opened this issue 4 years ago • 1 comments

The create_bundle function has a flag L to indicate the bundle has to be "installed" in the test target root, and it also has a flag t to indicate the bundle is "tracked". At the moment, a bundle can be tracked but not installed, this doesn't make sense since if a bundle is tracked it should also be installed. We should be able to create bundles that are not tracked, and we can use L for that, but all tracked bundles t should be installed without having to specify the L flag.

castulo avatar Apr 20 '20 20:04 castulo

Instead of having one single function that does many complex operations it's better to have multiple functions that do simple operations.

There are multiple problems created by this fact, like:

  • Performace/usability trade-offs like the one reported on #1483
  • Code duplication in create_bundle/update_bundle
  • Compatibility is hard to maintain (for example, it's hard to make sure that creating a bundle with one file will be the same as creating a bundle and them adding one file to it, because the code is different.)

So, right now, the feature -L don't guarantee that the bundle will be completely installed in the system, because you don't know if the bundle will be changed later by update_bundle. Instead it would be better to have one function that install the bundle and the user could call that at any time to install the bundle to the system in the state that the bundle is at.

otaviobp avatar Apr 20 '20 21:04 otaviobp