Skip to content

Commit

Permalink
Fix polkit values for integration tests daemons
Browse files Browse the repository at this point in the history
As of 24.04, polkit had some changes in its packages and file locations,
so we need to update the values used in the mocks to point in the right
direction.
  • Loading branch information
denisonbarbosa committed Aug 9, 2024
1 parent 3d71626 commit a85e6e1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
5 changes: 4 additions & 1 deletion cmd/adsysd/integration_tests/adsys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,10 @@ func runDaemons() (teardown func()) {
go func() {
defer wg.Done()

if err := os.MkdirAll(socketDir, 0750); err != nil {
// 24.04 introduced some polkit changes that make the daemon drop root privileges before executing. In order
// to be able to connect to the bus and run polkitd, we need more permissions in the socket directory.
//nolint:gosec
if err := os.MkdirAll(socketDir, 0755); err != nil {
log.Fatalf("Setup: can’t create %s socket directory: %v", answer, err)
}

Expand Down
5 changes: 1 addition & 4 deletions cmd/adsysd/integration_tests/systemdaemons/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ FROM ubuntu

ENV DEBIAN_FRONTEND=noninteractive
# we need at least dbusmock 0.25 to use systemd template
RUN \
apt-get update && \
apt-get install -y policykit-1 dbus libglib2.0-bin python3-pip python3-gi python3-dbus && \
pip install python-dbusmock
RUN apt update && apt install -y polkitd dbus libglib2.0-bin python3-gi python3-dbus python3-dbusmock

COPY cmd/adsysd/integration_tests/systemdaemons/*.py /
COPY cmd/adsysd/integration_tests/systemdaemons/run_daemons /
Expand Down
2 changes: 1 addition & 1 deletion cmd/adsysd/integration_tests/systemdaemons/run_daemons
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ from gi.repository import GLib
from session_daemons import start_session_bus, run_session_mocks
from system_daemons import start_system_bus, run_system_mocks

POLKIT_PATH = "/usr/libexec/polkitd"
POLKIT_PATH = "/usr/lib/polkit-1/polkitd"
ADSYS_POLICY_PATH_SRC = "/usr/share/polkit-1/actions.orig/com.ubuntu.adsys.policy"
ADSYS_POLICY_PATH_DST = "/usr/share/polkit-1/actions/com.ubuntu.adsys.policy"

Expand Down
1 change: 1 addition & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Recommends: ${misc:Recommends},
Suggests: curlftpfs,
ubuntu-proxy-manager,
python3-cepces,
polkitd-pkla,
Description: ${source:Synopsis}
${source:Extended-Description}

Expand Down

0 comments on commit a85e6e1

Please sign in to comment.