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

@ -25,14 +25,26 @@ setup_file() {
sudo apt install -y pass
}
@test "apt: Remove a package (using 'purge' instead also removes its configuration files)" {
sudo apt remove -y pass
@test "apt: Remove a package and its configuration files" {
sudo apt purge -y pass
}
@test "apt: Upgrade all installed packages to their newest available versions" {
sudo apt upgrade -y
}
@test "apt: Upgrade installed packages, but remove obsolete packages and install additional packages to meet new dependencies" {
sudo apt dist-upgrade -y
}
@test "apt: Clean the local repository - removing package files (.deb) from interrupted downloads that can no longer be downloaded" {
sudo apt autoclean
}
@test "apt: Remove all packages that are no longer needed" {
sudo apt autoremove
}
@test "apt: List all packages" {
apt list
}
@ -41,6 +53,6 @@ setup_file() {
apt list --installed
}
@test "apt-moo: Print a cow easter egg" {
@test "apt: Print a cow easter egg" {
apt moo
}

View file

@ -0,0 +1,27 @@
#!/usr/bin/env bats
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
load ../common
@test "dpkg-query: List all installed packages" {
dpkg-query --list
}
@test "dpkg-query: List installed packages matching a pattern" {
dpkg-query --list 'libc6*'
}
@test "dpkg-query: List all files installed by a package" {
dpkg-query --listfiles libc6
}
@test "dpkg-query: Show information about a package" {
dpkg-query --status libc6
}
@test "dpkg-query: Search for packages that own files matching a pattern" {
dpkg-query --search /etc/ld.so.conf.d
}

View file

@ -0,0 +1,12 @@
#!/usr/bin/env bats
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
load ../common
@test "dpkg-reconfigure: Reconfigure one or more packages" {
sudo apt install -y pass
sudo dpkg-reconfigure pass
}