B
=_P @ s d Z ddlZddlZddlZddlZddlZddlmZ ddlmZ ddlmZ ddlm Z ddl
mZ ddl
mZ dd l
m
Z
dd
l
mZ ddl
mZ ddl
mZ dd
l
mZ ddl
mZ ddl
mZ erddlmZ e Ze dkredrdndZndZdZdd Zdd Zee dG dd de
Zee dG dd de
Zee dG dd de
Zee dG d d! d!e
Zee d"G d#d$ d$e
Z e!d%krdd&l"m#Z# e#e$ dS )'z$Tests specific to all BSD platforms. N)BSD)FREEBSD)NETBSD)OPENBSD)spawn_testproc)HAS_BATTERY)PsutilTestCase)retry_on_failure)sh)TOLERANCE_SYS_MEM) terminate)unittest)which)getpagesizemuseTFc C sh t d| }tr(||dd d }nts0trF||dd d }yt|S tk
rb |S X dS )zmExpects a sysctl command with an argument and parse the result
returning only the value of interest.
zsysctl z: N= )r
r findr r int
ValueError)cmdlineresult r H/opt/alt/python37/lib64/python3.7/site-packages/psutil/tests/test_bsd.pysysctl- s r c C s@ t d}x&|dD ]}|| rP qW tdt| d S )z+Thin wrapper around 'muse' cmdline utility.r
zline not foundr )r
split
startswithr r )Zfieldoutliner r r r <