tests: Add platform handling for FreeBSD

FreeBSD doesn't have an easy mechanism to discover CPU features
currently. For tests declare we don't support anything we are asked
about.

Add the FreeBSD spelling of amd64 while we are here.

Type: improvement
Change-Id: I3eb5db856ee5cbc71250e47eee619e2f620de33a
Signed-off-by: Tom Jones <thj@freebsd.org>
This commit is contained in:
Tom Jones
2024-02-07 13:27:44 +00:00
committed by Ole Tr�an
parent ebe3a11ca7
commit e49e75a4b5

View File

@ -6,10 +6,15 @@ from asfframework import VppAsfTestCase
def checkX86():
return platform.machine() in ["x86_64", "AMD64"]
return platform.machine() in ["x86_64", "AMD64", "amd64"]
def skipVariant(variant):
# TODO: We don't have cpu feature detection on FreeBSD yet, so always return
# that we don't have the requested variant.
if platform.uname().system == "FreeBSD":
return False
with open("/proc/cpuinfo") as f:
cpuinfo = f.read()