Skip to content

ignore-null: False has no impact when global level ignore-null is True and test case level ignore-level is False #421

@chidanandpujar

Description

@chidanandpujar
Global level ignore-null is True and test case level ignore-null is False.
              Global level ignore-null:True takes precedency and test case level ignore-null:False is ignored.
              False has no impact the on the test cases.


Case 1) 
(venv) root@masterhost:~/jsnapy/jsnapy/samples# cat test_ignore_null.yml 
check_chassis_fpc:
  - command: show chassis fpc
  - ignore-null: True
  - iterate: 
      xpath: //fpc[normalize-space(slot) = "0"]
      tests:
        - is-lt: cpu-total, 8
          info: "Test Succeeded!! cpu total is less than 8 and its value is {{post['cpu-total']}}"
          err: "Test Failed!!! cpu total is greater than or equal to 8 and its value is {{post['cpu-total']}}"
          ignore-null: False
        - is-gt: beta-cpu-total, 2
          info: "Test Succeeded!! cpu total is greater than 2 and its value is {{post['beta-cpu-total']}}"
          err: "Test Failed!!! cpu total is less than or equal to 2 and its value is {{post['beta-cpu-total']}}"
          ignore-null: False

(venv) root@masterhost:~/jsnapy/jsnapy/samples# jsnapy --check pre post -f main.yml -v
jsnapy.cfg file location used : /root/jsnapy/venv/etc/jsnapy
Configuration file location used : /root/jsnapy/venv/etc/jsnapy
*************************** Device: 10.220.10.163 ***************************
Tests Included: check_chassis_fpc 
************************* Command: show chassis fpc *************************
-----------------------Performing is-lt Test Operation-----------------------
Test Succeeded!! cpu total is less than 8 and its value is 3
PASS | All "cpu-total" is less than 8 [ 1 value matched ]
-----------------------Performing is-gt Test Operation-----------------------
SKIPPING!! Node <beta-cpu-total> not found at xpath <//fpc[normalize-space(slot) = "0"]> for IDs: {}
------------------------------- Final Result!! -------------------------------
check_chassis_fpc : Passed
Total No of tests passed: 1
Total No of tests failed: 0 
Overall Tests passed!!!

Metadata

Metadata

Labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions