3
�[g�N � @ 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 er�ddlmZ e� Zej� dko�ed�ZndZdZdd� Zdd� Zejje dd�G dd� de
��Zejje dd�G dd� de
��Zejje dd�G dd� de
��Zejje dd�G d d!� d!e
��Z ejje d"d�G d#d$� d$e
��Z!dS )%z$Tests specific to all BSD platforms.� N)�BSD)�FREEBSD)�NETBSD)�OPENBSD)�HAS_BATTERY)�TOLERANCE_SYS_MEM)�PsutilTestCase)�pytest)�retry_on_failure)�sh)�spawn_testproc)� terminate)�which)�getpagesize�museFc C sh t d| �}tr(||jd�d d� }nts0trF||jd�d 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)�cmdline�result� r �A/usr/local/lib64/python3.6/site-packages/psutil/tests/test_bsd.py�sysctl- s r c C s@ t d�}x&|jd�D ]}|j| �rP qW td��t|j� d �S )z+Thin wrapper around 'muse' cmdline utility.r �
zline not foundr )r �split�
startswithr r )�field�out�liner r r r < |