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 d6b549b1e..7bc0e740b 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 fbfb6667d..e7e0fc3d5 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 7155c5aa9..41627dc67 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 bcdfbe1b8..a27bdf98d 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 171ee98a9..2f284070a 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 1b97ba445..3ee1fe218 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 d93b1a690..3d07619b2 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 60bf6ea45..f932e9129 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 656a3407b..0bdd625c4 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 2c15658ad..38924920a 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 30019825a..65779b617 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 6bb275bb6..b36abb62d 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 da634982a..9d796ff07 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 dca00b62a..a0822a516 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 41150ef7f..bb2b2a659 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 67bf5907d..68e48d9a4 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 0816fd45e..7fff472ee 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 065dba5f5..eda5f5b09 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 f5444fced..85bee2fd6 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 6dcf4b4d7..625f5f9bb 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 81a9f76a6..ccdadc6e3 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 a97ad53cb..b0f3430ea 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 722b3204b..f2880666d 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 4dc3e20b7..4093526a9 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 d09599065..eb60d890d 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 021906602..1b86dd41f 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 23094478c..1fc43c76c 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 9f2e26885..03cc4730f 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 8f8ad383d..885121a58 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 9e3ac5ef0..d3ab28cc0 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 eb6465c04..838be5cbc 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 c05995d0e..b69fc2dd1 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