The following are a list of test cases for declarative diversions



TEST CASE ONE


Aim


Add a diversion using declarative diversions



Process




Expected Outcome


Packages 'foo' and 'bar' are successfully configured with both /usr/share/foo and /usr/share/bar present in the tree.




TEST CASE TWO


Aim


Remove a declarative diversion



Process




Expected Outcome


The declarative diversion is removed resulting in /usr/share/bar becoming /usr/share/foo once again




TEST CASE THREE


Aim


Add a diversion to a none existant file



Process




Expected Outcome


If package 'foo' installs a file to /usr/share/foo in the future with the declarative diversion still in place it will divert it to /usr/share/bar




TEST CASE FOUR


Aim


Remove a diversion resulting in a file conflict


Process





Expected Outcome


An error is returned and unpack is aborted




TEST CASE FIVE


Aim


Remove a package, leaving a diversion in place



Process




Expected Outcome


Diversion atomically removed on cleanup




TEST CASE SIX


Aim


Remove a package, leaving a diversion in place. Install a new version of that package that doesn't ship the diversion



Process




Expected Outcome


Diversion atomically removed on cleanup