Files
napalm-bsd/tests/fixtures/freebsd-vm/COMMANDS.txt
christianmanivong e8468a292a
CI / test (3.10) (push) Successful in 26s
CI / test (3.11) (push) Successful in 24s
CI / test (3.12) (push) Successful in 26s
CI / test (3.10) (pull_request) Successful in 25s
CI / test (3.11) (pull_request) Successful in 24s
CI / test (3.12) (pull_request) Successful in 25s
feat: packages, services and updates
The write side NetOrk/netork#799 needs, on both drivers.

- Packages: get_packages (FreeBSD `pkg query` with the repository as
  source, nothing on a classic system without pkg; OpenBSD `pkg_info`),
  install_package / uninstall_package as root (`pkg install`/`pkg
  delete`, `pkg_add -I`/`pkg_delete`), names checked before anything is
  sent, a failure raised with what the tool printed.
- Updates: get_available_updates. FreeBSD `pkg upgrade -n`, with
  `security` from VuXML (`pkg audit`: True for a listed package, False for
  any other, None when the audit could not run); OpenBSD `pkg_add -u -n
  -v` (no security verdict). Base-system patches are one `base-system`
  entry, as decided in #799: OpenBSD's `syspatch -c`, and on a classic
  FreeBSD what `freebsd-update` has fetched; on pkgbase the base system is
  packages from FreeBSD-base.
- Services: get_services lists the enabled ones (FreeBSD `service ...
  status` as root, as root-only pidfiles hide daemons otherwise, without
  root when sudo refuses; OpenBSD `rcctl check`), manage_service runs
  start/stop/restart/enable/disable as root and returns success and
  output.

Fixtures recorded on the FreeBSD 15.1 and OpenBSD 7.9 VMs with genuinely
outdated packages (FreeBSD pointed at the latest branch, an OpenBSD
package taken back to its release build). Checked live on both, including
a service restart and installing and removing a package.
2026-10-08 09:59:04 +02:00

46 lines
1.2 KiB
Plaintext

uname -a
freebsd-version -kru
sysctl -n kern.hostname kern.osrelease hw.model hw.ncpu hw.physmem kern.boottime
kenv -q smbios.system.product
kenv -q smbios.system.serial
kenv -q smbios.system.uuid
ifconfig -a
netstat -rnW -f inet
netstat -rnW -f inet6
arp -an
ndp -an
sockstat -l -4 -6 -P tcp,udp -q
pkg -N
pkg repos -l
pkg info
pkg query '%n\t%v\t%o\t%R\t%c'
sudo pkg update -q
pkg version -vRL=
sudo pkg upgrade -n
sudo pkg upgrade -n -r FreeBSD-base
pkg audit -F -q
service -e
sudo service -l
sysrc -a
sysrc -n qemu_guest_agent_enable
sudo service qemu-guest-agent status
cat /etc/passwd
ps -axww -o user,pid,ppid,%cpu,%mem,vsz,rss,stat,lstart,command
cat /etc/crontab
df -k
swapinfo -k
sysctl -n vm.loadavg
which snmpd bsnmpd
freebsd-update -h
id
sockstat -46lq -P tcp,udp
sudo sockstat -46lq -P tcp,udp
pkg version -vRL= (repo FreeBSD-ports -> latest)
sudo pkg upgrade -n (repo -> latest)
pkg query -e '%a = 0' '%n\t%v\t%R\t%sb\t%c'
service -e; service -l | head -5
pkg query '%n\t%v\t%R\t%sb\t%c'
for s in $(service -e); do n=${s##*/}; printf "%s\t%s\n" "$n" "$(service $n status 2>&1 | head -1)"; done
sudo pkg audit -Fq
sudo for s in $(service -e); do n=${s##*/}; printf "%s\t%s\n" "$n" "$(service $n status 2>&1 | head -1)"; done