mirror of
https://github.com/roddhjav/apparmor.d.git
synced 2025-03-04 06:34:43 +01:00
tests(integration): move most test inside groups.
This commit is contained in:
parent
eba7357cb1
commit
86aba45d67
32 changed files with 37 additions and 40 deletions
|
@ -3,10 +3,9 @@
|
|||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
load common
|
||||
load ../common
|
||||
|
||||
setup_file() {
|
||||
aa_setup
|
||||
skip
|
||||
}
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
load common
|
||||
load ../common
|
||||
|
||||
@test "aa-status: Check status" {
|
||||
sudo aa-status
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
load common
|
||||
load ../common
|
||||
|
||||
@test "gpgconf: List all components" {
|
||||
gpgconf --list-components
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
load common
|
||||
load ../common
|
||||
|
||||
@test "ps: List all running processes" {
|
||||
ps aux
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
load common
|
||||
load ../common
|
||||
|
||||
@test "sysctl: Show all available variables and their values" {
|
||||
sysctl -a
|
||||
|
@ -24,4 +24,3 @@ load common
|
|||
@test "sysctl: Apply changes from `/etc/sysctl.conf`" {
|
||||
sysctl -p
|
||||
}
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
load common
|
||||
load ../common
|
||||
|
||||
@test "w: Display information about all users who are currently logged in" {
|
||||
w
|
||||
|
@ -12,3 +12,8 @@ load common
|
|||
@test "w: Display information about a specific user" {
|
||||
w root
|
||||
}
|
||||
|
||||
@test "w: Display information without including the header, the login, JCPU and PCPU columns" {
|
||||
w --no-header
|
||||
w --short
|
||||
}
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
load common
|
||||
load ../common
|
||||
|
||||
@test "groupadd: Create a new group" {
|
||||
sudo groupadd user2
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
load common
|
||||
load ../common
|
||||
|
||||
@test "groups: Print group memberships for the current user" {
|
||||
groups
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
load common
|
||||
load ../common
|
||||
|
||||
setup_file() {
|
||||
sudo systemctl start systemd-homed
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
load common
|
||||
load ../common
|
||||
|
||||
@test "hostnamectl: Get the hostname of the computer" {
|
||||
hostnamectl
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
load common
|
||||
load ../common
|
||||
|
||||
@test "systemd-ac-power: Report whether we are connected to an external power source." {
|
||||
systemd-ac-power || true
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
load common
|
||||
load ../common
|
||||
|
||||
@test "systemd-analyze: List all running units, ordered by the time they took to initialize" {
|
||||
systemd-analyze --no-pager blame
|
||||
|
@ -16,5 +16,3 @@ load common
|
|||
@test "systemd-analyze: Show security scores of running units" {
|
||||
systemd-analyze --no-pager security
|
||||
}
|
||||
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
load common
|
||||
load ../common
|
||||
|
||||
@test "systemd-cat: Write the output of the specified command to the journal (both output streams are captured)" {
|
||||
systemd-cat pwd
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
load common
|
||||
load ../common
|
||||
|
||||
@test "systemd-cgls: Display the whole control group hierarchy on your system" {
|
||||
systemd-cgls --no-pager
|
||||
|
@ -16,4 +16,3 @@ load common
|
|||
@test "systemd-cgls: Display the control group hierarchy of one or more systemd units" {
|
||||
systemd-cgls --no-pager --unit systemd-logind
|
||||
}
|
||||
|
|
@ -3,23 +3,20 @@
|
|||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
load common
|
||||
load ../common
|
||||
|
||||
@test "systemd-detect-virt: List detectable virtualization technologies" {
|
||||
systemd-detect-virt --list
|
||||
}
|
||||
|
||||
# bats test_tags=systemd-detect-virt
|
||||
@test "systemd-detect-virt: Detect virtualization, print the result and return a zero status code when running in a VM or a container, and a non-zero code otherwise" {
|
||||
systemd-detect-virt || true
|
||||
}
|
||||
|
||||
# bats test_tags=systemd-detect-virt
|
||||
@test "systemd-detect-virt: Silently check without printing anything" {
|
||||
systemd-detect-virt --quiet || true
|
||||
}
|
||||
|
||||
# bats test_tags=systemd-detect-virt
|
||||
@test "systemd-detect-virt: Only detect hardware virtualization" {
|
||||
systemd-detect-virt --vm || true
|
||||
}
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
load common
|
||||
load ../common
|
||||
|
||||
@test "systemd-id128: Generate a new random identifier" {
|
||||
systemd-id128 new
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
load common
|
||||
load ../common
|
||||
|
||||
@test "systemd-sysusers: Print the contents of all configuration files (before each file, its name is printed as a comment)" {
|
||||
systemd-sysusers --cat-config
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
load common
|
||||
load ../common
|
||||
|
||||
@test "userdbctl: List all known user records" {
|
||||
userdbctl --no-pager user
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
load common
|
||||
load ../common
|
||||
|
||||
@test "lsusb: List all the USB devices available" {
|
||||
lsusb || true
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
load common
|
||||
load ../common
|
||||
|
||||
@test "blkid: List all partitions" {
|
||||
sudo blkid
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
load common
|
||||
load ../common
|
||||
|
||||
@test "chsh: list available shells" {
|
||||
chsh --list-shells || true
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
load common
|
||||
load ../common
|
||||
|
||||
@test "df: Display all filesystems and their disk usage" {
|
||||
df
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
load common
|
||||
load ../common
|
||||
|
||||
@test "dmesg: Show kernel messages" {
|
||||
sudo dmesg
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
load common
|
||||
load ../common
|
||||
|
||||
@test "lsblk: List all storage devices in a tree-like format" {
|
||||
lsblk
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
load common
|
||||
load ../common
|
||||
|
||||
@test "lscpu: Display information about all CPUs" {
|
||||
lscpu
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
load common
|
||||
load ../common
|
||||
|
||||
@test "lspci: Show a brief list of devices" {
|
||||
lspci
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
load common
|
||||
load ../common
|
||||
|
||||
@test "pstree: Display a tree of processes" {
|
||||
pstree
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
load common
|
||||
load ../common
|
||||
|
||||
@test "sync: Flush all pending write operations on all disks" {
|
||||
sync
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
load common
|
||||
load ../common
|
||||
|
||||
@test "users: Print logged in usernames" {
|
||||
users
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
load common
|
||||
load ../common
|
||||
|
||||
@test "uuidd: Generate a random UUID" {
|
||||
uuidd --random
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
load common
|
||||
load ../common
|
||||
|
||||
@test "uuidgen: Create a random UUIDv4" {
|
||||
uuidgen --random
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
load common
|
||||
load ../common
|
||||
|
||||
@test "who: Display the username, line, and time of all currently logged-in sessions" {
|
||||
who
|
Loading…
Add table
Reference in a new issue