Add camera test framework and initial tests for Bosch FLEXIDOME indoor 5100i IR

- Introduced a new directory `testdata/captures/` containing captured XML archives and README documentation for the camera test framework.
- Added a mock server implementation to replay captured SOAP responses for testing.
- Created automated tests for Bosch FLEXIDOME indoor 5100i IR using captured responses, validating device information, system date and time, capabilities, and profiles.
- Implemented enhanced device features tests, covering hostname, DNS, NTP, network interfaces, scopes, and user management.
- Added support for enhanced media and imaging features, including video and audio sources, and imaging options.
- Updated types to include new configurations and options for network, imaging, and device capabilities.
This commit is contained in:
ProtoTess
2025-11-11 02:10:04 +00:00
parent 3340094f4f
commit 3bf078ed3f
27 changed files with 5701 additions and 147 deletions
+82
View File
@@ -206,6 +206,16 @@ client, err := onvif.NewClient(
| `GetSystemDateAndTime()` | Get device system time |
| `SystemReboot()` | Reboot the device |
| `Initialize()` | Discover and cache service endpoints |
| `GetHostname()` | Get device hostname configuration |
| `SetHostname()` | Set device hostname |
| `GetDNS()` | Get DNS configuration |
| `GetNTP()` | Get NTP configuration |
| `GetNetworkInterfaces()` | Get network interface configuration |
| `GetScopes()` | Get configured discovery scopes |
| `GetUsers()` | Get list of user accounts |
| `CreateUsers()` | Create new user accounts |
| `DeleteUsers()` | Delete user accounts |
| `SetUser()` | Modify existing user account |
### Media Service
@@ -215,6 +225,12 @@ client, err := onvif.NewClient(
| `GetStreamURI()` | Get RTSP/HTTP stream URI |
| `GetSnapshotURI()` | Get snapshot image URI |
| `GetVideoEncoderConfiguration()` | Get video encoder settings |
| `GetVideoSources()` | Get all video sources |
| `GetAudioSources()` | Get all audio sources |
| `GetAudioOutputs()` | Get all audio outputs |
| `CreateProfile()` | Create new media profile |
| `DeleteProfile()` | Delete media profile |
| `SetVideoEncoderConfiguration()` | Set video encoder configuration |
### PTZ Service
@@ -227,6 +243,12 @@ client, err := onvif.NewClient(
| `GetStatus()` | Get current PTZ status and position |
| `GetPresets()` | Get list of PTZ presets |
| `GotoPreset()` | Move to a preset position |
| `SetPreset()` | Save current position as preset |
| `RemovePreset()` | Delete a preset |
| `GotoHomePosition()` | Move to home position |
| `SetHomePosition()` | Set current position as home |
| `GetConfiguration()` | Get PTZ configuration |
| `GetConfigurations()` | Get all PTZ configurations |
### Imaging Service
@@ -235,6 +257,10 @@ client, err := onvif.NewClient(
| `GetImagingSettings()` | Get imaging settings (brightness, contrast, etc.) |
| `SetImagingSettings()` | Set imaging settings |
| `Move()` | Perform focus move operations |
| `GetOptions()` | Get available imaging options and ranges |
| `GetMoveOptions()` | Get available focus move options |
| `StopFocus()` | Stop focus movement |
| `GetImagingStatus()` | Get current imaging/focus status |
### Discovery Service
@@ -415,6 +441,62 @@ Contributions are welcome! Please feel free to submit a Pull Request. For major
- [ ] Performance benchmarks
- [ ] CLI tool for camera management
## Debugging Tools
### 🔍 Diagnostic Utility
Comprehensive camera testing and analysis with optional XML capture:
```bash
go build -o onvif-diagnostics ./cmd/onvif-diagnostics/
# Standard diagnostic report
./onvif-diagnostics \
-endpoint "http://camera-ip/onvif/device_service" \
-username "admin" \
-password "pass" \
-verbose
# With raw SOAP XML capture for debugging
./onvif-diagnostics \
-endpoint "http://camera-ip/onvif/device_service" \
-username "admin" \
-password "pass" \
-capture-xml \
-verbose
```
**Generates**:
- `camera-logs/Manufacturer_Model_Firmware_timestamp.json` - Diagnostic report
- `camera-logs/Manufacturer_Model_Firmware_xmlcapture_timestamp.tar.gz` - Raw XML (with `-capture-xml`)
**See**: `XML_DEBUGGING_SOLUTION.md` for complete debugging workflow
### 🧪 Camera Test Framework
Automated regression testing using captured camera responses:
```bash
# 1. Capture from camera
./onvif-diagnostics -endpoint "http://camera/onvif/device_service" \
-username "user" -password "pass" -capture-xml
# 2. Generate test
go build -o generate-tests ./cmd/generate-tests/
./generate-tests -capture camera-logs/*_xmlcapture_*.tar.gz -output testdata/captures/
# 3. Run tests
go test -v ./testdata/captures/
```
**Benefits**:
- Test without physical cameras
- Prevent regressions across camera models
- Fast CI/CD integration
- Real camera response validation
**See**: `testdata/captures/README.md` for complete testing guide
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.