-
Notifications
You must be signed in to change notification settings - Fork 8
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
Ipconfig bare i63 #78
Conversation
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 comments on the code, but in addition to that:
- There is also a section which you didn't change that is impacted. The new sample configs don't have a
Host Name
field as typical when of our prior examples. Thus the logic of theDNS Suffix
is wrong as it attempts to prepend an empty hostname since the parser normally would have a value for it. - You probably want to create a unit test for the parser to test the logic. You can see a sample at
datastore/importers/nmdb-import-ping/Parser.test.cpp
. I can also create it for you if want, but it will take me a bit to get time for it.
…works Fix for error when parsing default gateways
I think that I've fixed it such that it can parse ipconfig output without failing, though I still need to go back and account for the changes in fields when parsing bare ipconfig vs ipconfig /all. |
addIfaceIp will no longer attempt to prepend hostnames for bare ipconfig output
I made some fixes/changes based on your suggestions, though I haven't made any test cases yet as I would need to make the parser rules protected rather than private, and I would rather save that for last. I think this does cover all but the tests. As for tests, I was thinking of covering these sorts of cases. Do you have any ideas for others that should be covered?
|
I'll prefix: us adding test cases is "new" and we've been doing this as we modify code, so why I made mention of it and why you see there aren't a lot existing. Generally speaking, what we've been doing is having tests which cover the parts of the parser (this covers probably 4-7 of your list). So they are more unit test oriented. Definitely have "good cases" (they pass) and possibly "bad cases" (they fail). The good cases are basically what the rule is codified to parse. In some cases, the rules have an attached predicate and you can also examine/test the state of the object after a particular parse path. If possible, have a few bad cases which cover instance we explicitly are aware of and want to prevent a refactor from allowing. The parser is pretty good at failing on "bad cases" because of formatting on it's own. If reasonable, a few interesting whole parser test cases (this covers probably 1-3 of your list) could be added to help a developer understand the general overall structure of the data and some interesting corner cases. However, in many cases it is not reasonable to codify (e.g., a router/switch config) so it's a judgement call. We do run changes through a separate, independent, regression testing so it is covered somewhat there as well. That said, for parts, probably test:
Don't worry about testing |
Related to issue #63
Adds support for parsing the
ipconfig
command without/all
or/all /allcompartments