tests: Intruduce hack for libvirt-dbus on system connection on ubuntu
tests: Intruduce hack for libvirt-dbus on system connection on ubuntu

Recently a security issue was fixed by setting libvirt's socket
permissions to 0660 from 0666.
See https://people.canonical.com/~ubuntu-security/cve/2020/CVE-2020-15708.html

This completely breaks libvirt-dbus system connection.

root@ubuntu:~# gdbus call --system --dest org.libvirt --object-path /org/libvirt/QEMU --method org.libvirt.Connect.ListDomains 0
Error: GDBus.Error:org.libvirt.Error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied

That is because libvirt-sock by default allows rw access to users that are in the libvirt group.

root@ubuntu:~# ls -la /var/run/libvirt/libvirt-sock
srw-rw---- 1 root libvirt 0 Aug 24 15:33 /var/run/libvirt/libvirt-sock

However libvirt-dbus system process is running as libvirtdbus/libvirtdbus user/group.

root@ubuntu:~# ps aux | grep libvirt-dbus
\libvirt+ 6813 0.0 1.6 363436 18892 ? Sl 15:33 0:00 /usr/sbin/libvirt-dbus --system
root 7207 0.0 0.0 8164 672 pts/0 S+ 15:35 0:00 grep --color=auto libvirt-dbus

root@ubuntu:~# cat /proc/6813/status | grep Uid
Uid: 996 996 996 996

root@ubuntu:~# cat /proc/6813/status | grep Gid
Gid: 996 996 996 996

root@ubuntu:~# cat /etc/group | grep 996
libvirtdbus:x:996:

root@ubuntu:~# id libvirtdbus
uid=996(libvirtdbus) gid=996(libvirtdbus) groups=996(libvirtdbus)

Add a HACK for allowing tests to run while waiting for the official
resolution.
Upstream bug https://bugs.launchpad.net/ubuntu/+source/libvirt-dbus/+bug/1892757

Closes #14507
cockpit-project/cockpit,cockpit-project/cockpit,moraleslazaro/cockpit,martinpitt/cockpit,moraleslazaro/cockpit,deryni/cockpit,mvollmer/cockpit,mvollmer/cockpit,garrett/cockpit,garrett/cockpit,moraleslazaro/cockpit,mvollmer/cockpit,deryni/cockpit,martinpitt/cockpit,mvollmer/cockpit,martinpitt/cockpit,garrett/cockpit,deryni/cockpit,deryni/cockpit,martinpitt/cockpit,moraleslazaro/cockpit,garrett/cockpit,moraleslazaro/cockpit,garrett/cockpit,deryni/cockpit,mvollmer/cockpit,cockpit-project/cockpit,moraleslazaro/cockpit,deryni/cockpit,martinpitt/cockpit,deryni/cockpit,moraleslazaro/cockpit,cockpit-project/cockpit,cockpit-project/cockpit