feat(profile): add vmstat
This commit is contained in:
parent
771dd9b589
commit
c85ed58fa9
2 changed files with 52 additions and 0 deletions
27
apparmor.d/groups/procps/vmstat
Normal file
27
apparmor.d/groups/procps/vmstat
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
# 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}/vmstat
|
||||
profile vmstat @{exec_path} {
|
||||
include <abstractions/base>
|
||||
include <abstractions/consoles>
|
||||
|
||||
@{exec_path} mr,
|
||||
|
||||
@{sys}/block/ r,
|
||||
@{sys}/devices/system/node/ r,
|
||||
|
||||
@{PROC}/diskstats r,
|
||||
@{PROC}/slabinfo r,
|
||||
@{PROC}/uptime r,
|
||||
@{PROC}/vmstat r,
|
||||
|
||||
include if exists <local/vmstat>
|
||||
}
|
||||
|
||||
# vim:syntax=apparmor
|
||||
25
tests/integration/procps/vmstat.bats
Normal file
25
tests/integration/procps/vmstat.bats
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#!/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 "vmstat: Display virtual memory statistics" {
|
||||
vmstat
|
||||
vmstat --active
|
||||
vmstat --forks
|
||||
}
|
||||
|
||||
@test "vmstat: Display disk statistics" {
|
||||
vmstat --disk
|
||||
vmstat --disk-sum
|
||||
}
|
||||
|
||||
@test "vmstat: Display slabinfo" {
|
||||
sudo vmstat --slabs
|
||||
}
|
||||
|
||||
@test "vmstat: Display reports every second for 3 times" {
|
||||
vmstat 1 3
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue