diff options
| author | Donatas Abraitis <donatas.abraitis@gmail.com> | 2021-03-02 09:30:06 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-02 09:30:06 +0200 |
| commit | c103ac43dea8087e33e62dec69cee2d79e362ed5 (patch) | |
| tree | 82dc7576b9642d50ae050803cbf274fc8229acf7 /tests/topotests/lib/snmptest.py | |
| parent | 3ca7090fdcdda8dc8ab0d96ed1a2c7a0a700aaf3 (diff) | |
| parent | 5980ad0ae0352ba3865ee17cd9bf97bc65e35474 (diff) | |
Merge pull request #8172 from donaldsharp/more_pytest_bgp
More pytest stuff
Diffstat (limited to 'tests/topotests/lib/snmptest.py')
| -rw-r--r-- | tests/topotests/lib/snmptest.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/topotests/lib/snmptest.py b/tests/topotests/lib/snmptest.py index 5112500e0b..e6b140a0e2 100644 --- a/tests/topotests/lib/snmptest.py +++ b/tests/topotests/lib/snmptest.py @@ -86,12 +86,11 @@ class SnmpTester(object): def _get_snmp_oid(snmp_output): tokens = snmp_output.strip().split() -# if len(tokens) > 5: -# return None - + # if len(tokens) > 5: + # return None # third token is the value of the object - return tokens[0].split('.',1)[1] + return tokens[0].split(".", 1)[1] def _parse_multiline(self, snmp_output): results = snmp_output.strip().split("\r\n") @@ -142,7 +141,11 @@ class SnmpTester(object): print("FAIL: missing oid key {}".format(oid)) return False if results_dict[oid] != values[index]: - print("FAIL{} {} |{}| == |{}|".format(oid, index, results_dict[oid], values[index])) + print( + "FAIL{} {} |{}| == |{}|".format( + oid, index, results_dict[oid], values[index] + ) + ) return False index += 1 return True |
