tests(integration): move most test inside groups.

This commit is contained in:
Alexandre Pujol 2025-03-02 00:00:08 +01:00
parent eba7357cb1
commit 86aba45d67
Failed to generate hash of commit
32 changed files with 37 additions and 40 deletions

View file

@ -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
}

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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
}

View file

@ -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
}

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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
}

View file

@ -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

View file

@ -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
}

View file

@ -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
}

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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