tests: add a few integration tests.

This commit is contained in:
Alexandre Pujol 2025-07-21 00:32:27 +02:00 committed by Alex
parent 0c2385fef9
commit d579b33011
16 changed files with 325 additions and 6 deletions

View file

@ -0,0 +1,30 @@
#!/usr/bin/env bats
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2025 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
load ../common
@test "journalctl: Show all messages with priority level 3 (errors) from this boot" {
sudo journalctl -b --priority=3
}
@test "journalctl: Show only the last N lines of the journal" {
sudo journalctl --lines 100
}
@test "journalctl: Show all messages by a specific [u]nit" {
sudo journalctl --unit apparmor.service
}
@test "journalctl: Show all messages by a specific process" {
sudo journalctl _PID=1
}
@test "journalctl: Show all messages by a specific executable" {
sudo journalctl /usr/bin/bootctl
}
@test "journalctl: Delete journal logs which are older than 10 seconds" {
sudo journalctl --vacuum-time=10s
}