feat(profile): add free
This commit is contained in:
parent
8042dd4a34
commit
6b5fad404b
2 changed files with 37 additions and 0 deletions
19
apparmor.d/groups/procps/free
Normal file
19
apparmor.d/groups/procps/free
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
# apparmor.d - Full set of apparmor profiles
|
||||||
|
# Copyright (C) 2025 Alexandre Pujol <alexandre@pujol.io>
|
||||||
|
# SPDX-License-Identifier: GPL-2.0-only
|
||||||
|
|
||||||
|
abi <abi/4.0>,
|
||||||
|
|
||||||
|
include <tunables/global>
|
||||||
|
|
||||||
|
@{exec_path} = @{bin}/free
|
||||||
|
profile free @{exec_path} {
|
||||||
|
include <abstractions/base>
|
||||||
|
include <abstractions/consoles>
|
||||||
|
|
||||||
|
@{exec_path} mr,
|
||||||
|
|
||||||
|
include if exists <local/free>
|
||||||
|
}
|
||||||
|
|
||||||
|
# vim:syntax=apparmor
|
||||||
18
tests/integration/procps/free.bats
Normal file
18
tests/integration/procps/free.bats
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
#!/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 "free: Display system memory" {
|
||||||
|
free
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "free: Display memory in GB" {
|
||||||
|
free -g
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "free: Display memory in human-readable units" {
|
||||||
|
free -h
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue