Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 393 fix1 #415

Merged
merged 13 commits into from
Jul 19, 2024
Merged

Conversation

chidanandpujar
Copy link
Collaborator

@chidanandpujar chidanandpujar commented Jun 6, 2024

What does this PR do

fix for jsnapy side for issue #393
Fix for #327

What issues does this PR fix or reference?

Previous Behavior

Remove this section if not relevant
user specified info/err message in the test yaml file is not updated to the test results

New Behavior

Remove this section if not relevant
User specified info/err message in the testcase yaml file is updated to the tes results

Tests written?

Yes/No
Yes

python test_snmp.py 
Connecting to device x.x.x.x ................
Taking snapshot of RPC: get-configuration
**************************** Device: x.x.x.x ****************************
Tests Included: test_snmp_config 
*************************RPC is get-configuration*************************
ERROR!! Nodes are not present in given <Xpath> : </configuration/snmp>
FAIL | All "community[name='mycommunity']" do not exists at xpath "/configuration/snmp" [ 0 value matched / 1 value failed ]
------------------------------- Final Result!! -------------------------------
test_snmp_config : Failed
Total No of tests passed: 0
Total No of tests failed: 1 
Overall Tests failed!!! 
Tested on x.x.x.x
Final result:  Failed
Total passed:  0
Total failed: 1
[{'xpath': '/configuration/snmp', 'testoperation': 'exists', 'passed': [], 'failed': [{'id': {}, 'pre': {}, 'post': {}, 'actual_node_value': None, 'xpath_error': True}], 'test_name': 'test_snmp_config', 'node_name': "community[name='mycommunity']", 'err': "SNMP community ''mycommunity' is not configured!", 'result': False, 'count': {'pass': 0, 'fail': 1}}]

~/ansible_release_v105_final/jsnapy/tests# cat /var/tmp/debug_jsnapy_issue_ansible
==================get_tests=============
Get tests response<jnpr.jsnapy.operator.Operator object at 0x7fd5b46ba6e0>
Get tests responsedefaultdict(<class 'list'>, {'get-configuration': [{'xpath': '/configuration/snmp', 'testoperation': 'exists', 'passed': [], 'failed': [{'id': {}, 'pre': {}, 'post': {}, 'actual_node_value': None, 'xpath_error': True}], 'test_name': 'test_snmp_config', 'node_name': "community[name='mycommunity']", 'err': "SNMP community ''mycommunity' is not configured!", 'result': False, 'count': {'pass': 0, 'fail': 1}}]})
Get tests response{'test_snmp_config': False}

TASK [debug] **************************************************************************************************************************************************************
ok: [x.x.x.x] => {
    "test_check": {
        "changed": false,
        "failed": false,
        "get-configuration": [
            {
                "count": {
                    "fail": 1,
                    "pass": 0
                },
                "err": "SNMP community ''mycommunity' is not configured!",
                "failed": [
                    {
                        "actual_node_value": null,
                        "id": {},
                        "post": {},
                        "pre": {},
                        "xpath_error": true
                    }
                ],
                "node_name": "community[name='mycommunity']",
                "passed": [],
                "result": false,
                "test_name": "test_snmp_config",
                "testoperation": "exists",
                "xpath": "/configuration/snmp"
            }
        ]
    }
}

Fixed Juniper#327
Fixed Juniper#330 commented out deletion test results
Fixed Juniper#327
Fixed Juniper#330 commented out deletion test results
Fixed Juniper#327
Fixed Juniper#330 commented out deletion test results
Copy link
Collaborator

@dineshbaburam91 dineshbaburam91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@dineshbaburam91 dineshbaburam91 merged commit c7d2487 into Juniper:master Jul 19, 2024
4 checks passed
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