File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/runners/__pycache__/test.cpython-310.pyc
o
�N�g� � @ sL d Z ddlZdd� Zdd� Zddd �Zd
d� Zdd
d�Zdd� Zdd� ZdS )zM
This runner is used only for test purposes and serves no production purpose
� Nc O s dd� |� � D �}| |d�}|S )z�
Output the given args and kwargs
Kwargs will be filtered for 'private' keynames.
CLI Example:
.. code-block:: bash
salt-run test.arg foo bar=baz
c S s i | ]\}}|� d �s||�qS )�__)�
startswith)�.0�k�v� r �E/opt/saltstack/salt/lib/python3.10/site-packages/salt/runners/test.py�
<dictcomp> s zarg.<locals>.<dictcomp>��args�kwargs)�items�r r �retr r r �arg s
�r c O s | |d�}|S )z
Output the given args and kwargs
CLI Example:
.. code-block:: bash
salt-run test.arg foo __bar=baz
r
r r r r r �raw_arg s �r �usc C s g d�g d�d�}|� | d�S )z�
Return common metasyntactic variables for the given locality
CLI Example:
.. code-block:: bash
salt-run test.metasyntactic locality=uk
)�foo�barZbazZquxZquuxZquuzZcorgeZgraultZgarplyZwaldoZfredZplughZxyzzyZthud)ZwibbleZwobbleZwubbleZflob)r �ukN)�get)Zlocality�lookupr r r �
metasyntactic. s �r c C s t d� dS )zv
Print 'foo' and return 'bar'
CLI Example:
.. code-block:: bash
salt-run test.stdout_print
r r )�printr r r r �stdout_printN s
r �
c C s t | � t�| � dS )z}
Sleep t seconds, then return True
CLI Example:
.. code-block:: bash
salt-run test.sleep s_time=5
T)r �time�sleep)Zs_timer r r r \ s
r c C s: d} t dd�D ]}t�dd|� d�id� t�d� q| S ) z�
Fire a stream of 100 test events, then return True
CLI Example:
.. code-block:: bash
salt-run test.stream
T� �d �messagez
Runner is z% doneZprogressg�������?)�rangeZ
__jid_event__Z
fire_eventr r )r �ir r r �streamk s
r# c C s t S )z�
.. versionadded:: 2018.3.0
Return the configuration options of the master.
CLI Example:
.. code-block:: bash
salt-run test.get_opts
)Z__opts__r r r r �get_opts| s r$ )r )r ) �__doc__r r r r r r r# r$ r r r r �<module> s