3.2 KiB
3.2 KiB
Quick Test Reference
Running Camera Tests
Option 1: Using the test script (Recommended)
# Set credentials
export ONVIF_TEST_ENDPOINT="http://192.168.1.201/onvif/device_service"
export ONVIF_TEST_USERNAME="service"
export ONVIF_TEST_PASSWORD="Service.1234"
# Run all Bosch FLEXIDOME tests
./run-camera-tests.sh
# Run specific test
./run-camera-tests.sh TestBoschFLEXIDOMEIndoor5100iIR_GetDeviceInformation
Option 2: Direct go test commands
# Run all camera tests
go test -v -run TestBoschFLEXIDOMEIndoor5100iIR
# Run specific test
go test -v -run TestBoschFLEXIDOMEIndoor5100iIR_GetStreamURI
# Run with race detection
go test -v -race -run TestBoschFLEXIDOMEIndoor5100iIR
# Run benchmarks
go test -v -bench=BenchmarkBoschFLEXIDOMEIndoor5100iIR -benchmem
Option 3: One-liner with credentials
ONVIF_TEST_ENDPOINT="http://192.168.1.201/onvif/device_service" \
ONVIF_TEST_USERNAME="service" \
ONVIF_TEST_PASSWORD="Service.1234" \
go test -v -run TestBoschFLEXIDOMEIndoor5100iIR
Test List
Device Tests
TestBoschFLEXIDOMEIndoor5100iIR_GetDeviceInformation- Device info retrievalTestBoschFLEXIDOMEIndoor5100iIR_GetSystemDateAndTime- System timeTestBoschFLEXIDOMEIndoor5100iIR_GetCapabilities- Capability discovery
Media Tests
TestBoschFLEXIDOMEIndoor5100iIR_GetProfiles- Media profiles (4 expected)TestBoschFLEXIDOMEIndoor5100iIR_GetStreamURI- RTSP stream URIsTestBoschFLEXIDOMEIndoor5100iIR_GetSnapshotURI- Snapshot URLsTestBoschFLEXIDOMEIndoor5100iIR_GetVideoEncoderConfiguration- Encoder settings
Imaging Tests
TestBoschFLEXIDOMEIndoor5100iIR_GetImagingSettings- Camera imaging parameters
Integration Tests
TestBoschFLEXIDOMEIndoor5100iIR_Initialize- Service discoveryTestBoschFLEXIDOMEIndoor5100iIR_FullWorkflow- Complete operation sequence
Performance Tests
BenchmarkBoschFLEXIDOMEIndoor5100iIR_GetDeviceInformation- Device info benchmarkBenchmarkBoschFLEXIDOMEIndoor5100iIR_GetStreamURI- Stream URI benchmark
Expected Test Results
All tests should PASS with the following outputs:
✓ Manufacturer: Bosch
✓ Model: FLEXIDOME indoor 5100i IR
✓ 4 Profiles found (1920x1080, 1536x864, 1280x720, 512x288)
✓ All profiles have RTSP stream URIs
✓ Snapshot URI available
✓ Video encoding: H264 @ 30fps, 5200kbps
✓ Default imaging: Brightness 128.0, Saturation 128.0, Contrast 128.0
Troubleshooting
Tests are skipped
Solution: Set environment variables with camera credentials
Connection timeout
Solutions:
- Verify camera IP address
- Check network connectivity
- Ensure firewall allows connection
Authentication failed
Solutions:
- Verify username and password
- Check user permissions on camera
Unexpected values
Note: Camera settings may differ based on:
- Firmware version
- Manual configuration changes
- Update test expectations if needed
Coverage Report
Generate test coverage:
go test -coverprofile=coverage.out -run TestBoschFLEXIDOMEIndoor5100iIR
go tool cover -html=coverage.out
Adding New Camera Tests
- Copy
bosch_flexidome_test.goto<vendor>_<model>_test.go - Update test function names
- Update expected values
- Run tests to verify
- Document in CAMERA_TESTS.md