On Wed, Jan 08, 2025 at 03:21:42PM +0100, Helmut Grohne wrote:
> Since I was failing to get this right earlier, I figured I could as well
> write some tests. As a result, I'm attaching a shell script. It
> constructs a few demo packages and attempts a hopefully exhaustive
> combination of using them and dpkg-divert by writing its experiments to
> the working directory. Running it should be fairly boring. If you happen
> to review it, I appreciate a response.

Despite multiple requests to actually attach my tests, nobody seems to
have read them and spot the missing test cases. And of course they were
failing.

The case of upgrading from a single, aliased diversion to a duplicated
diversion was not covered. In this case, we want the canonicalized
diversion target to be used by the canonicalized diversion and
therefore, the aliased diversion must change its diversion target.
Failure to do so results in file loss and/or left-over files.

I'm attaching an updated version that tests the transition from aliased
diversion to duplicated diversion both in the case of the divertee being
absent and present. It's a lot of branches now, but I don't quite see
how we could do it with less.

Again, I appreciate someone actually reading the test cases and telling
me where I am wrong such that I don't have to redo too many redone
patches. At least the one I submitted for bfh-container fails an
additional test case.

Helmut

Attachment: m18_diversions.sh
Description: Bourne shell script

Reply via email to