-
Notifications
You must be signed in to change notification settings - Fork 71
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
1050: Redfish: Check snmpTrap port #688
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
408b0a2
to
b80464f
Compare
CI failed because this patch(1050 clang16) is not merged: #687 |
Check snmpTrap port 1. Allow empty port, eg: "snmp://9.41.166.76:". 2. Invalid ports and out of range ports are not allowed, eg: "snmp://9.41.166.76:ab" "snmp://9.41.166.76:-40" "snmp://9.41.166.76:65536". Test: 1. Empty port: curl -k -H "X-Auth-Token: $bmc_token" -X POST -D headers.txt https://${bmc}/redfish/v1/EventService/Subscriptions -d '{"Destination":"snmp://9.41.166.76:", "SubscriptionType":"SNMPTrap", "Protocol":"SNMPv2c"}' { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The resource has been created successfully.", "MessageArgs": [] , "MessageId": "Base.1.13.0.Created", "MessageSeverity": "OK", "Resolution": "None." } ] } 2. Invalid port: curl -k -H "X-Auth-Token: $bmc_token" -X POST -D headers.txt https://${bmc}/redfish/v1/EventService/Subscriptions -d '{"Destination":"snmp://9.41.166.76:ab", "SubscriptionType":"SNMPTrap", "Protocol":"SNMPv2c"}' { "Destination@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The value 'snmp://9.41.166.76:ab' for the property Destination is of a different format than the property can accept.", "MessageArgs": [ "snmp://9.41.166.76:ab", "Destination" ], "MessageId": "Base.1.13.0.PropertyValueFormatError", "MessageSeverity": "Warning", "Resolution": "Correct the value for the property in the request body and resubmit the request if the operation failed." } ] curl -k -H "X-Auth-Token: $bmc_token" -X POST -D headers.txt https://${bmc}/redfish/v1/EventService/Subscriptions -d '{"Destination":"snmp://9.41.166.76:-40", "SubscriptionType":"SNMPTrap", "Protocol":"SNMPv2c"}' { "Destination@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The value 'snmp://9.41.166.76:-40' for the property Destination is of a different format than the property can accept.", "MessageArgs": [ "snmp://9.41.166.76:-40", "Destination" ], "MessageId": "Base.1.13.0.PropertyValueFormatError", "MessageSeverity": "Warning", "Resolution": "Correct the value for the property in the request body and resubmit the request if the operation failed." } ] } 3. Out of range port: curl -k -H "X-Auth-Token: $bmc_token" -X POST -D headers.txt https://${bmc}/redfish/v1/EventService/Subscriptions -d '{"Destination":"snmp://9.41.166.76:65536", "SubscriptionType":"SNMPTrap", "Protocol":"SNMPv2c"}' { "Destination@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The value 'snmp://9.41.166.76:65536' for the property Destination is of a different format than the property can accept.", "MessageArgs": [ "snmp://9.41.166.76:65536", "Destination" ], "MessageId": "Base.1.13.0.PropertyValueFormatError", "MessageSeverity": "Warning", "Resolution": "Correct the value for the property in the request body and resubmit the request if the operation failed." } ] } Signed-off-by: Chicago Duan <duanzhijia01@inspur.com>
gtmills
approved these changes
May 23, 2023
@ChicagoDuan Is there an upstream change here ? |
Yes, upstream has the same problem, I will push it to the upstream. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check snmpTrap port
"snmp://9.41.166.76:".
"snmp://9.41.166.76:ab"
"snmp://9.41.166.76:-40"
"snmp://9.41.166.76:65536".
Test: