With Chris's help we got the tests to get past the D-Bus errors on Zesty by creating a file /etc/polkit-1/localauthority/50-local.d/manage-units.pkla on the test system with the following contents:
# Allow the "ubuntu" user to manage systemd units unconditionally for testing
(It turned out that manage-unit-files was also needed to enable/disable services). This basically instructs polkitd to tell systemd that it is okay for the "ubuntu" user to manage system services without having to re-enter their password. Assuming that's what you expect while running the tests, the CI scripts should be updated to add this file to the container.
There shouldn't be any need to special case this for Zesty: it should be fine to create the .pkla file on older releases too.
With Chris's help we got the tests to get past the D-Bus errors on Zesty by creating a file /etc/polkit- 1/localauthorit y/50-local. d/manage- units.pkla on the test system with the following contents:
# Allow the "ubuntu" user to manage systemd units unconditionally for testing
[Allow manage-units] unix-user: ubuntu org.freedesktop .systemd1. manage- units;org. freedesktop. systemd1. manage- unit-files ive=yes e=yes
Identity=
Action=
ResultAny=yes
ResultInact
ResultActiv
(It turned out that manage-unit-files was also needed to enable/disable services). This basically instructs polkitd to tell systemd that it is okay for the "ubuntu" user to manage system services without having to re-enter their password. Assuming that's what you expect while running the tests, the CI scripts should be updated to add this file to the container.
There shouldn't be any need to special case this for Zesty: it should be fine to create the .pkla file on older releases too.