Skip to content

Conversation

@chidanandpujar
Copy link
Collaborator

@chidanandpujar chidanandpujar commented Jul 17, 2024

Added to support to save the failed test result files to a user specified directory - dest_dir: "{{ backup_dir }}"
with filename format for issue #676

<hostname>_<test_name>.text

Ex:

    - name: "Check after PRE - POST check"
      juniper.device.jsnapy:
        dir: "{{ JSNAPy_dir }}"
        test_files:
          - system_util_baseline.yml
          - verify_ospf_neighbor.yml
          - test_chassis_alarms.yml
        logfile: "{{tlogfile}}"
        action: "snapcheck"
        dest_dir: "{{ backup_dir }}"
      register: test_check
      tags:
        - jsnapy

test file: system_util_baseline.yml

test details:

cat jsnapy_TEST_FILES/system_util_baseline.yml 
tests_include:
  - check_core_dumps
  - check_system_memory_usage
    #- check_system_resource_usage

check_core_dumps:
  - command: show system core-dumps
  - iterate:
      xpath: multi-routing-engine-item
      id: re-name
      tests:
        - no-diff: directory-list/output

check_system_memory_usage:
  - command: show system memory
  - iterate:
      xpath: multi-routing-engine-item 
      id: re-name
      tests:
        # - delta: system-memory-free, 10%
        - in-range: system-memory-information/system-memory-summary-information/system-memory-free-percent, 70,99

Failed test: check_system_memory_usage

backup_dir/x.x.x.x_check_system_memory_usage_False.text

cat backup_dir/x.x.x.x_check_system_memory_usage_False.text 
[{'xpath': 'multi-routing-engine-item', 'testoperation': 'in-range', 'passed': [], 'failed': [{'id': {}, 'pre': {}, 'post': {}, 'actual_node_value': None, 'xpath_error': True}], 'test_name': 'check_system_memory_usage', 'node_name': 'system-memory-information/system-memory-summary-information/system-memory-free-percent', 'expected_node_value': [70.0, 99.0], 'result': False, 'count': {'pass': 0, 'fail': 1}}]

@chidanandpujar chidanandpujar changed the title support to save the failed tests to dest_dir for local connection support to save the failed tests to dest_dir for local and pyez connection Aug 5, 2024
@dineshbaburam91 dineshbaburam91 merged commit b90771b into Juniper:master Aug 5, 2024
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.

2 participants