support/testing: add polkit tests
authorAdam Duskett <aduskett@gmail.com>
Wed, 21 Jul 2021 21:45:17 +0000 (14:45 -0700)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sat, 24 Jul 2021 21:29:21 +0000 (23:29 +0200)
commitdb1ded10846f25ee93d2010394c3ba0fecad6719
treeed153825c9a5c0bb5cdf4e64c1c701e5652d4222
parent82712c5862badbc905346afb6ad08c4d4ff47dfb
support/testing: add polkit tests

This test script tests polkit with and without systemd.

The Systemd test does the following:
  - The brtest user attempts to restart the systemd-timesyncd service and is
    denied.

  - A systemd-timesyncd-restart.rules file provided by polkit-rules-test
    is copied from /root/ to /etc/polkit-1/rules.d

  - The brtest user attempts to restart the systemd-timesyncd service and should
    now succeed.

The initd test does the following:
- The brtest user attempts to run the test application "hello-polkit" with the
  command "pkexec hello-polkit" and is denied.

- A hello-polkit.rules file provided by polkit-rules-test is copied from /root/
  to /etc/polkit-1/rules.d

- The brtest user attempts to re-run the test hello-polkit binary with
  "pkexec hello-polkit" and succeeds.

Signed-off-by: Adam Duskett <aduskett@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
support/testing/tests/package/br2-external/polkit/Config.in [new file with mode: 0644]
support/testing/tests/package/br2-external/polkit/external.desc [new file with mode: 0644]
support/testing/tests/package/br2-external/polkit/external.mk [new file with mode: 0644]
support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/Config.in [new file with mode: 0644]
support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/initd/hello-polkit.c [new file with mode: 0644]
support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/initd/hello-polkit.policy [new file with mode: 0644]
support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/initd/hello-polkit.rules [new file with mode: 0644]
support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/polkit-rules-test.mk [new file with mode: 0644]
support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/systemd/systemd-timesyncd-restart.rules [new file with mode: 0644]
support/testing/tests/package/test_polkit.py [new file with mode: 0644]