diff --git a/tests/integration/aa-enforce.bats b/tests/integration/apparmor/aa-enforce.bats similarity index 94% rename from tests/integration/aa-enforce.bats rename to tests/integration/apparmor/aa-enforce.bats index d6b549b1..7bc0e740 100644 --- a/tests/integration/aa-enforce.bats +++ b/tests/integration/apparmor/aa-enforce.bats @@ -3,10 +3,9 @@ # Copyright (C) 2024 Alexandre Pujol # SPDX-License-Identifier: GPL-2.0-only -load common +load ../common setup_file() { - aa_setup skip } diff --git a/tests/integration/aa-status.bats b/tests/integration/apparmor/aa-status.bats similarity index 97% rename from tests/integration/aa-status.bats rename to tests/integration/apparmor/aa-status.bats index fbfb6667..e7e0fc3d 100644 --- a/tests/integration/aa-status.bats +++ b/tests/integration/apparmor/aa-status.bats @@ -3,7 +3,7 @@ # Copyright (C) 2024 Alexandre Pujol # SPDX-License-Identifier: GPL-2.0-only -load common +load ../common @test "aa-status: Check status" { sudo aa-status diff --git a/tests/integration/gpgconf.bats b/tests/integration/gpg/gpgconf.bats similarity index 98% rename from tests/integration/gpgconf.bats rename to tests/integration/gpg/gpgconf.bats index 7155c5aa..41627dc6 100644 --- a/tests/integration/gpgconf.bats +++ b/tests/integration/gpg/gpgconf.bats @@ -3,7 +3,7 @@ # Copyright (C) 2024 Alexandre Pujol # SPDX-License-Identifier: GPL-2.0-only -load common +load ../common @test "gpgconf: List all components" { gpgconf --list-components diff --git a/tests/integration/ps.bats b/tests/integration/procps/ps.bats similarity index 97% rename from tests/integration/ps.bats rename to tests/integration/procps/ps.bats index bcdfbe1b..a27bdf98 100644 --- a/tests/integration/ps.bats +++ b/tests/integration/procps/ps.bats @@ -3,7 +3,7 @@ # Copyright (C) 2024 Alexandre Pujol # SPDX-License-Identifier: GPL-2.0-only -load common +load ../common @test "ps: List all running processes" { ps aux diff --git a/tests/integration/sysctl.bats b/tests/integration/procps/sysctl.bats similarity index 97% rename from tests/integration/sysctl.bats rename to tests/integration/procps/sysctl.bats index 171ee98a..2f284070 100644 --- a/tests/integration/sysctl.bats +++ b/tests/integration/procps/sysctl.bats @@ -3,7 +3,7 @@ # Copyright (C) 2024 Alexandre Pujol # 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 } - diff --git a/tests/integration/w.bats b/tests/integration/procps/w.bats similarity index 68% rename from tests/integration/w.bats rename to tests/integration/procps/w.bats index 1b97ba44..3ee1fe21 100644 --- a/tests/integration/w.bats +++ b/tests/integration/procps/w.bats @@ -3,7 +3,7 @@ # Copyright (C) 2024 Alexandre Pujol # 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 +} diff --git a/tests/integration/groupadd.bats b/tests/integration/shadow/groupadd.bats similarity index 97% rename from tests/integration/groupadd.bats rename to tests/integration/shadow/groupadd.bats index d93b1a69..3d07619b 100644 --- a/tests/integration/groupadd.bats +++ b/tests/integration/shadow/groupadd.bats @@ -3,7 +3,7 @@ # Copyright (C) 2024 Alexandre Pujol # SPDX-License-Identifier: GPL-2.0-only -load common +load ../common @test "groupadd: Create a new group" { sudo groupadd user2 diff --git a/tests/integration/groups.bats b/tests/integration/shadow/groups.bats similarity index 95% rename from tests/integration/groups.bats rename to tests/integration/shadow/groups.bats index 60bf6ea4..f932e912 100644 --- a/tests/integration/groups.bats +++ b/tests/integration/shadow/groups.bats @@ -3,7 +3,7 @@ # Copyright (C) 2024 Alexandre Pujol # SPDX-License-Identifier: GPL-2.0-only -load common +load ../common @test "groups: Print group memberships for the current user" { groups diff --git a/tests/integration/homectl.bats b/tests/integration/systemd/homectl.bats similarity index 98% rename from tests/integration/homectl.bats rename to tests/integration/systemd/homectl.bats index 656a3407..0bdd625c 100644 --- a/tests/integration/homectl.bats +++ b/tests/integration/systemd/homectl.bats @@ -3,7 +3,7 @@ # Copyright (C) 2024 Alexandre Pujol # SPDX-License-Identifier: GPL-2.0-only -load common +load ../common setup_file() { sudo systemctl start systemd-homed diff --git a/tests/integration/hostnamectl.bats b/tests/integration/systemd/hostnamectl.bats similarity index 97% rename from tests/integration/hostnamectl.bats rename to tests/integration/systemd/hostnamectl.bats index 2c15658a..38924920 100644 --- a/tests/integration/hostnamectl.bats +++ b/tests/integration/systemd/hostnamectl.bats @@ -3,7 +3,7 @@ # Copyright (C) 2024 Alexandre Pujol # SPDX-License-Identifier: GPL-2.0-only -load common +load ../common @test "hostnamectl: Get the hostname of the computer" { hostnamectl diff --git a/tests/integration/systemd-ac-power.bats b/tests/integration/systemd/systemd-ac-power.bats similarity index 96% rename from tests/integration/systemd-ac-power.bats rename to tests/integration/systemd/systemd-ac-power.bats index 30019825..65779b61 100644 --- a/tests/integration/systemd-ac-power.bats +++ b/tests/integration/systemd/systemd-ac-power.bats @@ -3,7 +3,7 @@ # Copyright (C) 2024 Alexandre Pujol # 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 diff --git a/tests/integration/systemd-analyze.bats b/tests/integration/systemd/systemd-analyze.bats similarity index 97% rename from tests/integration/systemd-analyze.bats rename to tests/integration/systemd/systemd-analyze.bats index 6bb275bb..b36abb62 100644 --- a/tests/integration/systemd-analyze.bats +++ b/tests/integration/systemd/systemd-analyze.bats @@ -3,7 +3,7 @@ # Copyright (C) 2024 Alexandre Pujol # 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 } - - diff --git a/tests/integration/systemd-cat.bats b/tests/integration/systemd/systemd-cat.bats similarity index 96% rename from tests/integration/systemd-cat.bats rename to tests/integration/systemd/systemd-cat.bats index da634982..9d796ff0 100644 --- a/tests/integration/systemd-cat.bats +++ b/tests/integration/systemd/systemd-cat.bats @@ -3,7 +3,7 @@ # Copyright (C) 2024 Alexandre Pujol # 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 diff --git a/tests/integration/systemd-cgls.bats b/tests/integration/systemd/systemd-cgls.bats similarity index 97% rename from tests/integration/systemd-cgls.bats rename to tests/integration/systemd/systemd-cgls.bats index dca00b62..a0822a51 100644 --- a/tests/integration/systemd-cgls.bats +++ b/tests/integration/systemd/systemd-cgls.bats @@ -3,7 +3,7 @@ # Copyright (C) 2024 Alexandre Pujol # 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 } - diff --git a/tests/integration/systemd-detect-virt.bats b/tests/integration/systemd/systemd-detect-virt.bats similarity index 85% rename from tests/integration/systemd-detect-virt.bats rename to tests/integration/systemd/systemd-detect-virt.bats index 41150ef7..bb2b2a65 100644 --- a/tests/integration/systemd-detect-virt.bats +++ b/tests/integration/systemd/systemd-detect-virt.bats @@ -3,23 +3,20 @@ # Copyright (C) 2024 Alexandre Pujol # 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 } diff --git a/tests/integration/systemd-id128.bats b/tests/integration/systemd/systemd-id128.bats similarity index 97% rename from tests/integration/systemd-id128.bats rename to tests/integration/systemd/systemd-id128.bats index 67bf5907..68e48d9a 100644 --- a/tests/integration/systemd-id128.bats +++ b/tests/integration/systemd/systemd-id128.bats @@ -3,7 +3,7 @@ # Copyright (C) 2024 Alexandre Pujol # SPDX-License-Identifier: GPL-2.0-only -load common +load ../common @test "systemd-id128: Generate a new random identifier" { systemd-id128 new diff --git a/tests/integration/systemd-sysusers.bats b/tests/integration/systemd/systemd-sysusers.bats similarity index 97% rename from tests/integration/systemd-sysusers.bats rename to tests/integration/systemd/systemd-sysusers.bats index 0816fd45..7fff472e 100644 --- a/tests/integration/systemd-sysusers.bats +++ b/tests/integration/systemd/systemd-sysusers.bats @@ -3,7 +3,7 @@ # Copyright (C) 2024 Alexandre Pujol # 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 diff --git a/tests/integration/userdbctl.bats b/tests/integration/systemd/userdbctl.bats similarity index 97% rename from tests/integration/userdbctl.bats rename to tests/integration/systemd/userdbctl.bats index 065dba5f..eda5f5b0 100644 --- a/tests/integration/userdbctl.bats +++ b/tests/integration/systemd/userdbctl.bats @@ -3,7 +3,7 @@ # Copyright (C) 2024 Alexandre Pujol # SPDX-License-Identifier: GPL-2.0-only -load common +load ../common @test "userdbctl: List all known user records" { userdbctl --no-pager user diff --git a/tests/integration/lsusb.bats b/tests/integration/usb/lsusb.bats similarity index 96% rename from tests/integration/lsusb.bats rename to tests/integration/usb/lsusb.bats index f5444fce..85bee2fd 100644 --- a/tests/integration/lsusb.bats +++ b/tests/integration/usb/lsusb.bats @@ -3,7 +3,7 @@ # Copyright (C) 2024 Alexandre Pujol # SPDX-License-Identifier: GPL-2.0-only -load common +load ../common @test "lsusb: List all the USB devices available" { lsusb || true diff --git a/tests/integration/blkid.bats b/tests/integration/utils/blkid.bats similarity index 95% rename from tests/integration/blkid.bats rename to tests/integration/utils/blkid.bats index 6dcf4b4d..625f5f9b 100644 --- a/tests/integration/blkid.bats +++ b/tests/integration/utils/blkid.bats @@ -3,7 +3,7 @@ # Copyright (C) 2024 Alexandre Pujol # SPDX-License-Identifier: GPL-2.0-only -load common +load ../common @test "blkid: List all partitions" { sudo blkid diff --git a/tests/integration/chsh.bats b/tests/integration/utils/chsh.bats similarity index 96% rename from tests/integration/chsh.bats rename to tests/integration/utils/chsh.bats index 81a9f76a..ccdadc6e 100644 --- a/tests/integration/chsh.bats +++ b/tests/integration/utils/chsh.bats @@ -3,7 +3,7 @@ # Copyright (C) 2024 Alexandre Pujol # SPDX-License-Identifier: GPL-2.0-only -load common +load ../common @test "chsh: list available shells" { chsh --list-shells || true diff --git a/tests/integration/df.bats b/tests/integration/utils/df.bats similarity index 97% rename from tests/integration/df.bats rename to tests/integration/utils/df.bats index a97ad53c..b0f3430e 100644 --- a/tests/integration/df.bats +++ b/tests/integration/utils/df.bats @@ -3,7 +3,7 @@ # Copyright (C) 2024 Alexandre Pujol # SPDX-License-Identifier: GPL-2.0-only -load common +load ../common @test "df: Display all filesystems and their disk usage" { df diff --git a/tests/integration/dmesg.bats b/tests/integration/utils/dmesg.bats similarity index 97% rename from tests/integration/dmesg.bats rename to tests/integration/utils/dmesg.bats index 722b3204..f2880666 100644 --- a/tests/integration/dmesg.bats +++ b/tests/integration/utils/dmesg.bats @@ -3,7 +3,7 @@ # Copyright (C) 2024 Alexandre Pujol # SPDX-License-Identifier: GPL-2.0-only -load common +load ../common @test "dmesg: Show kernel messages" { sudo dmesg diff --git a/tests/integration/lsblk.bats b/tests/integration/utils/lsblk.bats similarity index 98% rename from tests/integration/lsblk.bats rename to tests/integration/utils/lsblk.bats index 4dc3e20b..4093526a 100644 --- a/tests/integration/lsblk.bats +++ b/tests/integration/utils/lsblk.bats @@ -3,7 +3,7 @@ # Copyright (C) 2024 Alexandre Pujol # SPDX-License-Identifier: GPL-2.0-only -load common +load ../common @test "lsblk: List all storage devices in a tree-like format" { lsblk diff --git a/tests/integration/lscpu.bats b/tests/integration/utils/lscpu.bats similarity index 96% rename from tests/integration/lscpu.bats rename to tests/integration/utils/lscpu.bats index d0959906..eb60d890 100644 --- a/tests/integration/lscpu.bats +++ b/tests/integration/utils/lscpu.bats @@ -3,7 +3,7 @@ # Copyright (C) 2024 Alexandre Pujol # SPDX-License-Identifier: GPL-2.0-only -load common +load ../common @test "lscpu: Display information about all CPUs" { lscpu diff --git a/tests/integration/lspci.bats b/tests/integration/utils/lspci.bats similarity index 97% rename from tests/integration/lspci.bats rename to tests/integration/utils/lspci.bats index 02190660..1b86dd41 100644 --- a/tests/integration/lspci.bats +++ b/tests/integration/utils/lspci.bats @@ -3,7 +3,7 @@ # Copyright (C) 2024 Alexandre Pujol # SPDX-License-Identifier: GPL-2.0-only -load common +load ../common @test "lspci: Show a brief list of devices" { lspci diff --git a/tests/integration/pstree.bats b/tests/integration/utils/pstree.bats similarity index 96% rename from tests/integration/pstree.bats rename to tests/integration/utils/pstree.bats index 23094478..1fc43c76 100644 --- a/tests/integration/pstree.bats +++ b/tests/integration/utils/pstree.bats @@ -3,7 +3,7 @@ # Copyright (C) 2024 Alexandre Pujol # SPDX-License-Identifier: GPL-2.0-only -load common +load ../common @test "pstree: Display a tree of processes" { pstree diff --git a/tests/integration/sync.bats b/tests/integration/utils/sync.bats similarity index 95% rename from tests/integration/sync.bats rename to tests/integration/utils/sync.bats index 9f2e2688..03cc4730 100644 --- a/tests/integration/sync.bats +++ b/tests/integration/utils/sync.bats @@ -3,7 +3,7 @@ # Copyright (C) 2024 Alexandre Pujol # SPDX-License-Identifier: GPL-2.0-only -load common +load ../common @test "sync: Flush all pending write operations on all disks" { sync diff --git a/tests/integration/users.bats b/tests/integration/utils/users.bats similarity index 95% rename from tests/integration/users.bats rename to tests/integration/utils/users.bats index 8f8ad383..885121a5 100644 --- a/tests/integration/users.bats +++ b/tests/integration/utils/users.bats @@ -3,7 +3,7 @@ # Copyright (C) 2024 Alexandre Pujol # SPDX-License-Identifier: GPL-2.0-only -load common +load ../common @test "users: Print logged in usernames" { users diff --git a/tests/integration/uuidd.bats b/tests/integration/utils/uuidd.bats similarity index 96% rename from tests/integration/uuidd.bats rename to tests/integration/utils/uuidd.bats index 9e3ac5ef..d3ab28cc 100644 --- a/tests/integration/uuidd.bats +++ b/tests/integration/utils/uuidd.bats @@ -3,7 +3,7 @@ # Copyright (C) 2024 Alexandre Pujol # SPDX-License-Identifier: GPL-2.0-only -load common +load ../common @test "uuidd: Generate a random UUID" { uuidd --random diff --git a/tests/integration/uuidgen.bats b/tests/integration/utils/uuidgen.bats similarity index 95% rename from tests/integration/uuidgen.bats rename to tests/integration/utils/uuidgen.bats index eb6465c0..838be5cb 100644 --- a/tests/integration/uuidgen.bats +++ b/tests/integration/utils/uuidgen.bats @@ -3,7 +3,7 @@ # Copyright (C) 2024 Alexandre Pujol # SPDX-License-Identifier: GPL-2.0-only -load common +load ../common @test "uuidgen: Create a random UUIDv4" { uuidgen --random diff --git a/tests/integration/who.bats b/tests/integration/utils/who.bats similarity index 96% rename from tests/integration/who.bats rename to tests/integration/utils/who.bats index c05995d0..b69fc2dd 100644 --- a/tests/integration/who.bats +++ b/tests/integration/utils/who.bats @@ -3,7 +3,7 @@ # Copyright (C) 2024 Alexandre Pujol # 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