-
-
Notifications
You must be signed in to change notification settings - Fork 38
Added support to TAP mode in OpenVPN status parsing #49
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
Conversation
8373eba
to
b238e04
Compare
tests/test_openvpn.py
Outdated
@@ -19,15 +19,19 @@ def test_parse(self): | |||
self.assertEqual(p.metric, 'static') | |||
|
|||
def test_json_dict(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't look right, the two test files look different in number of links and nodes, therefore you'd better have two separate tests and not mix things up to avoid confusion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nemesisdesign I edited the second test file to have exactly the same number of links and nodes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(see my comment above) I think something is not right in the code, the decrease of code coverage is a hint, it should not happen since you have not added any new line of code, so I think some lines of code that were tested before are not being tested now.
Could you try to do as suggested and ensure both tests have their own test function and are really executed?
b238e04
to
c3bd53f
Compare
tests/static/openvpn-2-links-tap.txt
Outdated
@@ -0,0 +1,12 @@ | |||
OpenVPN CLIENT LIST | |||
Updated,Fri Oct 20 12:52:38 2017 | |||
Common Name,Real Address,Bytes Received,Bytes Sent,Connected Since |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see only 2 nodes here, am I missing something?
tests/test_openvpn.py
Outdated
@@ -19,15 +19,19 @@ def test_parse(self): | |||
self.assertEqual(p.metric, 'static') | |||
|
|||
def test_json_dict(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(see my comment above) I think something is not right in the code, the decrease of code coverage is a hint, it should not happen since you have not added any new line of code, so I think some lines of code that were tested before are not being tested now.
Could you try to do as suggested and ensure both tests have their own test function and are really executed?
c3bd53f
to
f3079c7
Compare
f3079c7
to
13e9fe7
Compare
@nemesisdesign There seems to be some problem with the openvpn-status. As the number of nodes it is showing is wrong. It is counting the virtual addresses as one node too, therefore doubling the number. Check Travis once. |
13e9fe7
to
79d9023
Compare
79d9023
to
e7283ee
Compare
netdiff/parsers/openvpn.py
Outdated
for route in data.routing_table.values() | ||
if route.real_address == client.real_address | ||
if not isinstance(route.virtual_address, ( | ||
ipaddress.IPv4Network, ipaddress.IPv6Network)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove this check @nemesisdesign? Checking for the instances? This has been suggested by @tonyseek
e7283ee
to
826cfe4
Compare
1 similar comment
826cfe4
to
d695192
Compare
1 similar comment
@nemesisdesign Can it be merged? |
No description provided.