summaryrefslogtreecommitdiffstats
path: root/test/util.py
diff options
context:
space:
mode:
authorTom Jones <thj@freebsd.org>2024-02-07 13:29:51 +0000
committerOle Tr�an <otroan@employees.org>2024-03-26 15:15:02 +0000
commit4941afb4f96a20df7dc8b6688f7921a3d713b77d (patch)
treec5d10fa450f76d9ceeb97f2a04f4e1540f4ac7f9 /test/util.py
parente49e75a4b5ff10063fd9e1681375f193e0e49ff0 (diff)
tests: Add support for getting corefile patterns on FreeBSD
Type: improvement Change-Id: I960edc05a9a77eb55f67cb1ec01d2b3122298ef8 Signed-off-by: Tom Jones <thj@freebsd.org>
Diffstat (limited to 'test/util.py')
-rw-r--r--test/util.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/util.py b/test/util.py
index 8e4c9079631..59957a74e91 100644
--- a/test/util.py
+++ b/test/util.py
@@ -5,6 +5,7 @@ import logging
import socket
from socket import AF_INET6
import os.path
+import platform
from copy import deepcopy
from collections import UserDict
@@ -109,8 +110,13 @@ def is_core_present(tempdir):
def get_core_pattern():
- with open("/proc/sys/kernel/core_pattern", "r") as f:
- corefmt = f.read().strip()
+ if platform.uname().system == "FreeBSD":
+ import sysctl
+
+ corefmt = sysctl.filter("kern.corefile")[0].value
+ elif platform.uname().system == "Linux":
+ with open("/proc/sys/kernel/core_pattern", "r") as f:
+ corefmt = f.read().strip()
return corefmt