-
Notifications
You must be signed in to change notification settings - Fork 2
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
Tests for AdminNetworkPolicy #388
Tests for AdminNetworkPolicy #388
Conversation
Fixed a small bug in handling named ports in ANP
hi @tanyaveksler ,
|
Hi @shireenf-ibm,
|
it's okay to have the hard-coded input instead of YAMLs, but the expected output should better be in a file and not hard-coded, as this is going to be more difficult to update following changes in output.. |
…s - creating pod and namespace resources per test; reading expected results from file. Added more tests from policy assistant.
@shireenf-ibm , please look at |
from the description I think the actual results are correct , for ANPs the low priority takes precedence;
|
I see, however, since multiple
you may choose to write the results and compare with expected files |
OK, I see that lower priority has higher precedence. Then, another test results look incorrect. Look at the test |
by debugging I see that the problem is that the ANPs has no names, but when saving them in the policy-engine, I have a map from anp-name to its object; since both have the same empty ( |
@tanyaveksler updated base branch to return error for anp objects without names |
Added more tests, including BANP tests, currently commented out.
…ol-analyzer into tests_for_admin_netpolicy
Moved all parsed resources tests to a separate file.
@adisos and @shireenf-ibm: I addressed your comments, the PR is ready for your review. |
// } | ||
return res | ||
} | ||
|
||
func CreatePodK8sObject(pod *v1.Pod) parser.K8sObject { |
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.
should these funcs be exported?
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.
They shouldn't :)
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.
small typos..
Co-authored-by: Adi Sosnovich <82078442+adisos@users.noreply.github.com>
Co-authored-by: Adi Sosnovich <82078442+adisos@users.noreply.github.com>
removed unneeded change.
Added some ANP tests from policy-assistant.
Fixed a small bug in handling named ports in ANP