Skip to content
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

rfb: add unittests for nom7 parsers #8272

Closed
wants to merge 1 commit into from

Conversation

hsadia538
Copy link
Contributor

Link to redmine ticket:

Describe changes:

  • Add unit tests for rfb protocol

@hsadia538
Copy link
Contributor Author

Currently, the unit tests are written for the following parse functions:
Screenshot 2022-12-09 at 11 33 24 PM

More parse functions can be incorporated but some of them would be testing the same value e.g parse_security_type_selection , parse_server_security_type , parse_supported_security_types are quite similar as all of them return the security type selected or asked (the difference is only in context).

The packet buffers I have used are actually coming from an rfb pcap that I found in suricata verify. Should I add the reference somewhere in the file?

Apart from this, the main intention of this PR is to gather feedback on the approach and whether should I try doing the same for other tests that I will write, etc (including formatting, readability, and other factors that matter)

}

//done
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did not mean to commit these comments. Will remove them now( I added this for parsers whose unit tests are there)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git tip: git add -p <path to file> to manually select which changes should be staged for commit

@@ -36,7 +36,7 @@ pub enum RFBGlobalState {
TSVncResponse,
TCSecurityResult,
TSClientInit,
Message
Message,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please split formatting changes from the test additions into separate commits

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.Will address in next PR

@jufajardini jufajardini added the outreachy Contributions made by Outreachy applicants label Dec 10, 2022
@hsadia538
Copy link
Contributor Author

Followed by #8276

@hsadia538 hsadia538 closed this Dec 12, 2022
@hsadia538 hsadia538 deleted the rfb-unittests-5741-v1 branch January 11, 2023 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
outreachy Contributions made by Outreachy applicants
Development

Successfully merging this pull request may close these issues.

3 participants