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

Best Effort User Input Validation Checks #34

Merged
merged 10 commits into from
Mar 11, 2018
Merged

Conversation

kb1lqc
Copy link
Member

@kb1lqc kb1lqc commented Mar 11, 2018

Pulling in #30 for best effort user input validation.

  • Checks all current user input options for valid types and values where applicable
  • Some checks are not easy/possible at this time such as timeout being a NoneType due to default argparse values.
  • No unit testing of the values yet but manual testing performed
  • mtu size set to RFC 791 min/max
  • callsign set to min of 3 characters and max of 7 characters
  • Updated argparse types where applicable

kb1lqc added 10 commits March 11, 2018 00:02
* Added checkUserInput()
* Checked callsign
* Checked ID
* Checked IP Address
* Added baud rate value and type checking
* Changed argparse input type to integer
* Expect boolean on `l`, `--loopback` option
* Convert mtu to int at argparse
* Check mtu for int
* Bheck for mtu >= 68 bytes
* Check for mtu <= 65535 bytes
* Went back and added helpful information for each exception where
possible to indicate to user what happened.
* Updated some value checking to be more pythonic
* Check that the serial port path is a string
* Check for integer and NoneType values, however, Nonetype is currently
impossible to get per design of argparse options
* Check for integer value creater than or equal to zero
…ead timeout

* Added writetimeout checks similar to readtimeout
* Fixed read timeout notes to remove copy/paste errors
* Used copy paste erros with mtu arguments being checked for timeouts
* Fixed if checks which were missing ending colon
@kb1lqc kb1lqc added enhancement New feature or request testing labels Mar 11, 2018
@kb1lqc kb1lqc self-assigned this Mar 11, 2018
@kb1lqc kb1lqc changed the base branch from master to develop March 11, 2018 18:47
@kb1lqc kb1lqc merged commit 3d4126e into FaradayRF:develop Mar 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant