edgexfoundry / device-usb-camera

Owner: Device WG
Apache License 2.0
12 stars 28 forks source link

feat: ability to disable RTSP server on startup via configuration #268

Closed marcpfuller closed 1 year ago

marcpfuller commented 1 year ago

If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/edgex-go/blob/main/.github/Contributing.md

PR Checklist

Please check if your PR fulfills the following requirements:

Testing Instructions

  1. run make test
  2. start up edgex using edgex-compose make run no-secty
  3. build device-usb-camera make build
  4. enable/ disable EnableRtspServer in canfiguration.yml
  5. verify Rtsp server starts and does not start when enabled/disabled

New Dependency Instructions (If applicable)

codecov-commenter commented 1 year ago

Codecov Report

Merging #268 (e5325cd) into main (040a5a6) will decrease coverage by 0.12%. The diff coverage is 0.00%.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@           Coverage Diff            @@
##            main    #268      +/-   ##
========================================
- Coverage   4.21%   4.10%   -0.12%     
========================================
  Files          8       8              
  Lines       1067    1096      +29     
========================================
  Hits          45      45              
- Misses      1022    1051      +29     
Files Changed Coverage Δ
internal/driver/driver.go 3.62% <0.00%> (-0.17%) :arrow_down:
vyshali-chitikeshi commented 1 year ago

Validation looks good both in secure and non-secure mode deployments. Below are more details

  1. When rtsp server disabled in configuration.yml file, streaming status, start streaming and stop
    streaming APIs gives error "Device resource rtsp server is not enabled" as expected.
  2. When rtsp server is enabled in configuration file, streaming status, start and stop streaming gives no error and works as expected. Also noticed below msg in logs "Starting rtsp authentication server on localhost:8000", This msg does not show up in logs when rtsp is disabled.
    1. Verified some general api's like camera status, camera info and camera status etc in both cases i.e. rtsp server enabled/disabled and they work correctly
    2. Negative test: Provided invalid value (something other than true/false) for rtsp server in configuration.yml file , noticed that it gave below error in logs, boot strapping exits before discovering cameras. I think this is expected. level=ERROR ts=2023-08-10T19:15:40.54388004Z app=device-usb-camera source=init.go:77 msg="ProtocolDriver init failed: failed to parse EnableRtspServer config: strconv.ParseBool: parsing \"abcd\": invalid syntax"
    3. Validated test cases from 1 to 4 both in secure and non secure modes, and results are same.
ajcasagrande commented 1 year ago

PR name should be updated. this is a feat. Also the current functionality is that it is enabled, so something like this:

feat: ability to disable RTSP server on startup via configuration