Skip to content

Conversation

chidanandpujar
Copy link
Collaborator

@chidanandpujar chidanandpujar commented Jul 29, 2024

Fix for jsnapy module execution with combination of config_file and juniper.device.pyez , when test yaml files are copied under custom_directory .

when using custom_directory option dir, we have make sure that testfiles and snapshots directories are present under custom_dir.

ls jsnapy_TEST_FILES/testfiles/
test_chassis_alarms.yml

ls jsnapy_TEST_FILES/snapshots/
10.220.15.151_PRE_show_chassis_alarms.xml

  vars:
    JSNAPy_dir: "{{ playbook_dir }}/jsnapy_TEST_FILES"

    - name: "Collect Pre Snapshot"
      juniper.device.jsnapy:
        dir: "{{ JSNAPy_dir }}"
        config_file: jsnapy_main.yml
        logfile: "{{ tlogfile }}"
        action: "snap_pre"
      register: test_pre
      ignore_errors: true

cat jsnapy_TEST_FILES/jsnapy_main.yml
  tests:
    - test_chassis_alarms.yml

cat jsnapy_TEST_FILES/testfiles/test_chassis_alarms.yml 
tests_include:
 - test_chassis_alarm_check
# - test_chassis_alarm_check_collect_text

test_chassis_alarm_check:
  - command: show chassis alarms

cat jsnapy_TEST_FILES/snapshots/x.x.x.x_PRE_show_chassis_alarms.xml 
<alarm-information><alarm-summary><no-active-alarms/></alarm-summary></alarm-information>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant