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/blackbox/__pycache__/traffic_replay.cpython-310.pyc
o

�/a��@s�dZddlZddlZddlmZdZdZdZejdZ	ejdZ
ejd	Zd
ee
fZej
�ed�Zej
�ed�ZGd
d�de�ZdS)z!Blackbox tests for traffic_replay�N)�BlackboxTestCasez$python/samba/tests/blackbox/testdatazscript/traffic_replayz!--fixed-password=trafficreplay01%�SERVER�PASSWORD�USERNAMEz-U%s%%%sztraffic-sample-very-short.modelztraffic_replay-%s.expectedc@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�TrafficLearnerTestscCs"d}dt|ttf}|�|�dS)Nz
--clean-up�%s %s %s %s)�SCRIPT�CREDSr�	check_run��self�options�command�r�E/usr/lib/python3/dist-packages/samba/tests/blackbox/traffic_replay.py�tearDown&szTrafficLearnerTests.tearDowncCsBd}dt|tttf}|�|�dtt|tttf}|�|�dS)zEEnsure the generate users only option functions correctly
           �[--generate-users-only --number-of-users 20 --number-of-groups 5 --average-groups-per-user 2�%s %s %s %s %sz%s %s %s %s %s %sN)r�FIXEDr	rr
�MODELrrrr�test_generate_users_only+s
�
�z,TrafficLearnerTests.test_generate_users_onlyc	Cs�tdgdgddggd�f�D]@\}}|���0}ttd|ddg|tttg}|�|�tt	|��
�}t|��
�}|�||�Wd�n1sIwYqdS)	z?Ensure a summary file is generated and the contents are correct�--random-seed=3z--random-seed=4z--conversation-persistence=0.5)rz--old-scalez--conversation-persistence=0.95z--traffic-summaryz-D1�-S0.1N)�	enumerate�mktemprrrr	rr
�open�EXPECTED_OUTPUT�read�assertStringsEqual)r�i�opts�outputr�expected�actualrrr�test_summary_generation7s.��
���
���z+TrafficLearnerTests.test_summary_generationcCsttttg}|�|d�dS)z>Ensure a summary file with no fixed password fails
           �N)rrr	r�check_exit_code�rrrrr�test_summary_replay_no_fixedMsz0TrafficLearnerTests.test_summary_replay_no_fixedcCs tttddttg}|�|�dS)z7Ensure a model can be replayed against a DC
           z-D2rN)rrrr	rr
r'rrr�test_model_replaySs�z%TrafficLearnerTests.test_model_replaycCsBd}dt|ttf}|�|d�dtt|ttf}|�|d�dS)zOEnsure the generate users only fails if no fixed_password supplied"
           rrr%rN)rr	rr&rrrrr�$test_generate_users_only_no_password\s
z8TrafficLearnerTests.test_generate_users_only_no_passwordN)	�__name__�
__module__�__qualname__rrr$r(r)r*rrrrr$s	r)�__doc__�os�tempfile�samba.testsr�DATA_DIRrr�environrr�USERr	�path�joinrrrrrrr�<module>s