Open chidanandpujar opened 2 months ago
issue is when jsnapy test yaml files are missing or path is incorrect, ansible jsnapy module fails to report errors .
TASK [Collect Pre Snapshot] ***********************************************************************************************************************************************
ok: [x.x.x.x]
TASK [Print the full test response] ***************************************************************************************************************************************
ok: [x.x.x.x] => {
"test_pre": {
"action": "snap_pre",
"changed": false,
"failed": false,
"msg": "The snap_pre action successfully executed."
}
}
TASK [Check Pre Snapshot] *************************************************************************************************************************************************
ok: [x.x.x.x] => {
"changed": false,
"msg": "All assertions passed"
}
PLAY RECAP ****************************************************************************************************************************************************************
x.x.x.x : ok=9 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
cat jsnapy_TEST_FILES/jsnapy_main.yml
tests:
- /root/ansible_jsnapy_issue/ansible-junos-stdlib/tests/test_chassis_alarms.yml
~/ansible_jsnapy_issue/ansible-junos-stdlib/tests# ls -lrt /root/ansible_jsnapy_issue/ansible-junos-stdlib/tests/test_chassis_alarms.yml
ls: cannot access '/root/ansible_jsnapy_issue/ansible-junos-stdlib/tests/test_chassis_alarms.yml': No such file or directory
ls ~/ansible_jsnapy_issue/venv/etc/jsnapy/snapshots/
README
This can be checked using jsnapy python module.
python test_config_pre.py
ERROR!! File /root/ansible_jsnapy_issue/ansible-junos-stdlib/tests/test_chassis_alarms.yml is not found for extracting test case
ERROR!! File /root/ansible_jsnapy_issue/ansible-junos-stdlib/tests/test_chassis_alarms.yml is not found for extracting test case
ERROR!! File /root/ansible_jsnapy_issue/ansible-junos-stdlib/tests/test_chassis_alarms.yml not found for testing
------------------------------- Final Result!! -------------------------------
Total No of tests passed: 0
Total No of tests failed: 0
None of the test cases executed !!!
-----------check----------
Tested on 10.220.15.151
Final result: None
Total passed: 0
Total failed: 0
After providing the correcting tests yaml file path.
cat jsnapy_TEST_FILES/jsnapy_main.yml
tests:
- /root/ansible_jsnapy_issue/ansible-junos-stdlib/tests/jsnapy_TEST_FILES/test_chassis_alarms.yml
~/ansible_jsnapy_issue/ansible-junos-stdlib/tests# ls -l /root/ansible_jsnapy_issue/ansible-junos-stdlib/tests/jsnapy_TEST_FILES/test_chassis_alarms.yml
TASK [Collect Pre Snapshot] ***********************************************************************************************************************************************
ok: [x.x.x.x]
TASK [Print the full test response] ***************************************************************************************************************************************
ok: [x.x.x.x] => {
"test_pre": {
"action": "snap_pre",
"changed": false,
"failed": false,
"msg": "The snap_pre action successfully executed."
}
}
TASK [Check Pre Snapshot] *************************************************************************************************************************************************
ok: [x.x.x.x] => {
"changed": false,
"msg": "All assertions passed"
}
PLAY RECAP ****************************************************************************************************************************************************************
x.x.x.x : ok=9 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
~/ansible_jsnapy_issue/ansible-junos-stdlib/tests# ls ~/ansible_jsnapy_issue/venv/etc/jsnapy/snapshots/
x.x.x.x_PRE_show_chassis_alarms.xml README
Issue Type
Module Name
juniper.device.jsnapy
juniper.device collection and Python libraries version
OS / Environment
JUNOS Evolved
Summary
juniper.device.jsnapy fails with config_file option and juniper.device.pyez
Steps to reproduce
Expected results
Actual results