Your IP : 3.145.179.30
3
��JZcE � @ 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�ejd�Zej� dkr�ed�Zq�dZndZdd� Zdd� Zeje d�G dd� dej��Zeje d�G dd� dej��Zeje d�G dd� dej��Zeje d�G d d!� d!ej��Ze d"k�r�ee!� dS )#z$Tests specific to all BSD platforms.� N)�BSD)�FREEBSD)�NETBSD)�OPENBSD)�get_test_subprocess)�HAS_BATTERY)�MEMORY_TOLERANCE)�
reap_children)�retry_before_failing)�run_test_module_by_name)�sh)�unittest)�which�SC_PAGE_SIZE�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 � /usr/lib64/python3.6/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 )Zfield�out�liner r r r : s
zBSD onlyc @ s� e Zd ZdZedd� �Zedd� �Zeje d�dd� �Z
d d
� Zejed� d�d
d� �Z
ejed� d�dd� �Zdd� ZdS )�BSDSpecificTestCasez)Generic tests common to all BSD variants.c C s t � j| _d S )N)r �pid)�clsr r r �
setUpClassN s zBSDSpecificTestCase.setUpClassc C s
t � d S )N)r )r# r r r �
tearDownClassR s z!BSDSpecificTestCase.tearDownClassz -o lstart doesn't work on NETBSDc C sP t d| j �}|jdd�j� }tj| j�j� }tjdtj |��}| j
||� d S )Nzps -o lstart -p %sZSTARTED� z%a %b %e %H:%M:%S %Y)r r"