CiscoTestAutomation / pyats

Cisco DevNet pyATS Test Framework Bug Tracker
Apache License 2.0
152 stars 32 forks source link

Support for adding custom log file to archived file when using easpy #243

Closed muthvar1 closed 4 months ago

muthvar1 commented 4 months ago

I have a set of use cases where I extract some log files and other data from the DUT. These files need to be added to the archive directory that is eventually added to the tarball/zipped file in the easypy runtime environment.

pyats run job pyats_easypy.py --testbed-file testbed.yaml --archive-dir=${PWD}/results

ls -lrt -rw-rw-r-- 1 user user 1348 Jul 10 15:35 custom_logfile1.csv -rw-rw-r-- 1 user user 1331 Jul 10 15:35 custom_logfile2.csv

ls -lrt results/ total 228 -rw-rw-r-- 1 user user 12735 Jul 10 13:04 pyats_easypy.2024Jul10_13:04:05.232130.zip

I need a way to add some custom files that would eventually be included in the zip file above.

Harishv01 commented 4 months ago

Hi,

The documentation provided below explains that the runtime object includes several attributes, including runtime.archive, which can be used to specify files to be included in the archive. This directly addresses your requirement to add custom files to the archive directory.

https://pubhub.devnetcloud.com/media/pyats/docs/easypy/behavior.html#runtime

muthvar1 commented 4 months ago

Thank you. I believe easypy also passes this argument to aetest test script.

Harishv01 commented 4 months ago

Please let me know if you need any further assistance or may close this ticket. Thank you.

muthvar1 commented 4 months ago

Thank you. You may close the ticket. Thanks once again

Harishv01 commented 4 months ago

As you mentioned to close this ticket, Hence, I am closing it. Thank you.