Skip to content

Commit

Permalink
tests: minor tests improvment.
Browse files Browse the repository at this point in the history
  • Loading branch information
roddhjav committed Nov 13, 2024
1 parent b4bcb2f commit a1c6e79
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 15 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
build:
runs-on: ${{ matrix.os }}
needs: check
strategy:
matrix:
os:
Expand Down Expand Up @@ -93,14 +94,19 @@ jobs:
sudo apt-get install -y \
apparmor-profiles apparmor-utils \
bats bats-support
bash tests/requirements.sh
- name: Install apparmor.d
run: |
sudo install -Dm0644 tests/github.local /etc/apparmor.d/tunables/global.d/github.local
sudo dpkg --install .pkg/apparmor.d_*_amd64.deb || true
sudo systemctl restart apparmor.service
- name: Github Action specific requirements
run: |
bash tests/requirements.sh
sudo systemctl restart systemd-hostnamed
sudo systemctl restart snapd
- name: Run the bats integration tests
run: |
make bats
Expand Down
7 changes: 3 additions & 4 deletions apparmor.d/abstractions/app/sudo
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@

network netlink raw, # PAM

dbus send bus=system path=/org/freedesktop/login1
interface=org.freedesktop.logi1.Manager
member=CreateSession
peer=(name=org.freedesktop.login1, label=systemd-logind),
unix bind type=stream addr=@@{hex16}/bus/sudo/system,

#aa:dbus talk bus=system name=org.freedesktop.login1 label=systemd-logind

dbus (send receive) bus=session path=/org/freedesktop/systemd1
interface=org.freedesktop.systemd.Manager
Expand Down
2 changes: 0 additions & 2 deletions apparmor.d/profiles-s-z/sudo
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ profile sudo @{exec_path} flags=(attach_disconnected) {
signal (send) set=(winch) peer=pacman,
signal (send) set=(winch, hup, term) peer=rpm,

unix bind type=stream addr=@@{hex16}/bus/sudo/system/,

@{bin}/@{shells} rUx,
@{lib}/** PUx,
/opt/*/** PUx,
Expand Down
1 change: 1 addition & 0 deletions tests/bats/homectl.bats
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ load common

setup_file() {
aa_setup
skip
}

# bats test_tags=homectl
Expand Down
1 change: 0 additions & 1 deletion tests/bats/snap.bats
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ load common

setup_file() {
aa_setup
skip
}

# bats test_tags=snap
Expand Down
6 changes: 0 additions & 6 deletions tests/bats/systemd-id128.bats
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ setup_file() {
aa_check
}

# bats test_tags=systemd-id128
@test "systemd-id128: Print the identifier of the current service invocation (this is available in systemd services)" {
systemd-id128 invocation-id
aa_check
}

# bats test_tags=systemd-id128
@test "systemd-id128: Generate a new random identifier and print it as a UUID (five groups of digits separated by hyphens)" {
systemd-id128 new --uuid
Expand Down
2 changes: 1 addition & 1 deletion tests/requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ arch)
;;
debian | ubuntu | whonix)
sudo apt-get install -y \
cpuid dfc systemd-userdbd
cpuid dfc systemd-userdbd systemd-homed tlp
;;
opensuse*)
;;
Expand Down

0 comments on commit a1c6e79

Please sign in to comment.