HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/samba/tests/__pycache__/process_limits.cpython-310.pyc
o

�/a��@sHdZddlZddlmZddlmZddlmZmZGdd�de�Z	dS)z�Tests limits on processes forked by fork on accept in the standard process
   model.
   NOTE: This test runs in an environment with an artificially low setting for
         smbd max processes
�N)�TestCase)�SamDB)�LdbError�ERR_OPERATIONS_ERRORcs8eZdZ�fdd�Z�fdd�Zdd�Zdd�Z�ZS)	�StandardModelProcessLimitTestsc�tt|���dS�N)�superr�setUp��self��	__class__��</usr/lib/python3/dist-packages/samba/tests/process_limits.pyr
!�z$StandardModelProcessLimitTests.setUpcrr)r	r�tearDownrr
rrr$rz'StandardModelProcessLimitTests.tearDowncCsF|j|��d�}|�d|��|��f�tdtjd|��|d�S)N��template�%s\%sz
ldaps://%s�SERVER)�url�lp�credentials)	�insta_creds�get_credentials�set_bind_dn�
get_domain�get_usernamer�os�environ�get_loadparm)r�credsrrr�simple_bind's��z*StandardModelProcessLimitTests.simple_bindc
Cs�|j|��d�}|�d|��|��f�g}ztd�D]	}|�|���q|�d�Wn't	yS}z|j
\}}|tkr>�|�d�sI|�d�sI�WYd}~nd}~ww|D]}~qVdS)Nrr�z<Processes not limited, able to make more than 20 connections�!NT_STATUS_CONNECTION_DISCONNECTED�NT_STATUS_CONNECTION_RESET)
rrrrr�range�appendr#�failr�argsr�endswith)rr"�connections�_�e�errno�estr�crrr�test_process_limits0s2��

����z2StandardModelProcessLimitTests.test_process_limits)�__name__�
__module__�__qualname__r
rr#r2�
__classcell__rrr
rrs
	r)
�__doc__r�samba.testsr�samba.samdbr�ldbrrrrrrr�<module>s