diff --git a/.github-workflows-example.yml b/.github-workflows-example.yml deleted file mode 100644 index 61d0488..0000000 --- a/.github-workflows-example.yml +++ /dev/null @@ -1,120 +0,0 @@ -# Example GitHub Actions workflow for camera integration tests -# Save as .github/workflows/camera-tests.yml - -name: Camera Integration Tests - -on: - # Run on manual trigger - workflow_dispatch: - inputs: - camera_endpoint: - description: 'Camera ONVIF endpoint' - required: true - default: 'http://192.168.1.201/onvif/device_service' - camera_username: - description: 'Camera username' - required: true - default: 'service' - - # Or run on schedule (daily at 2 AM) - schedule: - - cron: '0 2 * * *' - -jobs: - test-bosch-flexidome: - name: Test Bosch FLEXIDOME - runs-on: ubuntu-latest - - # Only run if secrets are configured - if: ${{ secrets.ONVIF_TEST_PASSWORD != '' }} - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: '1.21' - - - name: Cache Go modules - uses: actions/cache@v3 - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - - name: Download dependencies - run: go mod download - - - name: Run Bosch FLEXIDOME tests - env: - ONVIF_TEST_ENDPOINT: ${{ github.event.inputs.camera_endpoint || secrets.ONVIF_TEST_ENDPOINT }} - ONVIF_TEST_USERNAME: ${{ github.event.inputs.camera_username || secrets.ONVIF_TEST_USERNAME }} - ONVIF_TEST_PASSWORD: ${{ secrets.ONVIF_TEST_PASSWORD }} - run: | - echo "Testing camera at: $ONVIF_TEST_ENDPOINT" - go test -v -run TestBoschFLEXIDOMEIndoor5100iIR -timeout 5m - - - name: Run benchmarks - if: success() - env: - ONVIF_TEST_ENDPOINT: ${{ github.event.inputs.camera_endpoint || secrets.ONVIF_TEST_ENDPOINT }} - ONVIF_TEST_USERNAME: ${{ github.event.inputs.camera_username || secrets.ONVIF_TEST_USERNAME }} - ONVIF_TEST_PASSWORD: ${{ secrets.ONVIF_TEST_PASSWORD }} - run: | - go test -bench=BenchmarkBoschFLEXIDOMEIndoor5100iIR -benchmem -run=^$ | tee benchmark.txt - - - name: Upload benchmark results - if: success() - uses: actions/upload-artifact@v3 - with: - name: benchmark-results - path: benchmark.txt - - - name: Generate test coverage - if: success() - env: - ONVIF_TEST_ENDPOINT: ${{ github.event.inputs.camera_endpoint || secrets.ONVIF_TEST_ENDPOINT }} - ONVIF_TEST_USERNAME: ${{ github.event.inputs.camera_username || secrets.ONVIF_TEST_USERNAME }} - ONVIF_TEST_PASSWORD: ${{ secrets.ONVIF_TEST_PASSWORD }} - run: | - go test -coverprofile=coverage.out -run TestBoschFLEXIDOMEIndoor5100iIR - go tool cover -html=coverage.out -o coverage.html - - - name: Upload coverage report - if: success() - uses: actions/upload-artifact@v3 - with: - name: coverage-report - path: coverage.html - - - name: Comment test results - if: always() && github.event_name == 'workflow_dispatch' - uses: actions/github-script@v6 - with: - script: | - const outcome = '${{ job.status }}' === 'success' ? '✅ PASSED' : '❌ FAILED'; - console.log(`Camera integration tests: ${outcome}`); - -# Configuration Instructions: -# -# 1. Add secrets to your GitHub repository: -# - Go to Settings > Secrets and variables > Actions -# - Add the following secrets: -# * ONVIF_TEST_ENDPOINT (camera URL) -# * ONVIF_TEST_USERNAME (camera username) -# * ONVIF_TEST_PASSWORD (camera password) -# -# 2. Ensure your GitHub Actions runner can reach the camera: -# - Use self-hosted runner on same network as camera -# - Or use VPN/tunnel to access camera from GitHub-hosted runner -# -# 3. Run manually: -# - Go to Actions tab -# - Select "Camera Integration Tests" -# - Click "Run workflow" -# - Optionally override endpoint/username diff --git a/.gitignore b/.gitignore index a6c2a00..3493109 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,7 @@ go.work # Binaries bin/ dist/ +releases/ onvif-diagnostics onvif-server onvif-server-example diff --git a/demo-server.sh b/demo-server.sh deleted file mode 100755 index e69de29..0000000 diff --git a/ARCHITECTURE.md b/docs/ARCHITECTURE.md similarity index 100% rename from ARCHITECTURE.md rename to docs/ARCHITECTURE.md diff --git a/CAMERA_TESTS.md b/docs/CAMERA_TESTS.md similarity index 100% rename from CAMERA_TESTS.md rename to docs/CAMERA_TESTS.md diff --git a/IMPLEMENTATION_SUMMARY.md b/docs/IMPLEMENTATION_SUMMARY.md similarity index 100% rename from IMPLEMENTATION_SUMMARY.md rename to docs/IMPLEMENTATION_SUMMARY.md diff --git a/PROJECT_SUMMARY.md b/docs/PROJECT_SUMMARY.md similarity index 100% rename from PROJECT_SUMMARY.md rename to docs/PROJECT_SUMMARY.md diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..301f49a --- /dev/null +++ b/docs/README.md @@ -0,0 +1,22 @@ +# Additional Documentation + +This directory contains supplementary documentation for the onvif-go project. + +## Contents + +- **ARCHITECTURE.md** - System architecture and design decisions +- **CAMERA_TESTS.md** - Camera testing framework documentation +- **IMPLEMENTATION_SUMMARY.md** - Implementation details and notes +- **PROJECT_SUMMARY.md** - Project overview and planning +- **TEST_QUICKSTART.md** - Testing quickstart guide +- **XML_DEBUGGING_SOLUTION.md** - XML debugging tips and solutions + +## Main Documentation + +For primary documentation, see the root directory: + +- [README.md](../README.md) - Main project documentation +- [QUICKSTART.md](../QUICKSTART.md) - Getting started guide +- [BUILDING.md](../BUILDING.md) - Build and release instructions +- [CONTRIBUTING.md](../CONTRIBUTING.md) - Contribution guidelines +- [CHANGELOG.md](../CHANGELOG.md) - Version history and changes diff --git a/TEST_QUICKSTART.md b/docs/TEST_QUICKSTART.md similarity index 100% rename from TEST_QUICKSTART.md rename to docs/TEST_QUICKSTART.md diff --git a/XML_DEBUGGING_SOLUTION.md b/docs/XML_DEBUGGING_SOLUTION.md similarity index 100% rename from XML_DEBUGGING_SOLUTION.md rename to docs/XML_DEBUGGING_SOLUTION.md diff --git a/demo.sh b/examples/demo.sh similarity index 100% rename from demo.sh rename to examples/demo.sh diff --git a/onvif-server b/onvif-server deleted file mode 100755 index 4d439f2..0000000 Binary files a/onvif-server and /dev/null differ diff --git a/onvif-server-example b/onvif-server-example deleted file mode 100755 index bcfe8aa..0000000 Binary files a/onvif-server-example and /dev/null differ diff --git a/run-camera-tests.sh b/run-camera-tests.sh deleted file mode 100644 index fffd4a8..0000000 --- a/run-camera-tests.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash - -# Test script for running ONVIF camera integration tests -# Usage: ./run-camera-tests.sh [test-name] - -set -e - -# Color output -RED='\033[0;31m' -GREEN='\033[0;32m' -YELLOW='\033[1;33m' -NC='\033[0m' # No Color - -echo -e "${GREEN}=== ONVIF Camera Integration Tests ===${NC}" -echo - -# Check if environment variables are set -if [ -z "$ONVIF_TEST_ENDPOINT" ] || [ -z "$ONVIF_TEST_USERNAME" ] || [ -z "$ONVIF_TEST_PASSWORD" ]; then - echo -e "${YELLOW}Warning: Camera credentials not set${NC}" - echo "Set the following environment variables:" - echo " export ONVIF_TEST_ENDPOINT=\"http://192.168.1.201/onvif/device_service\"" - echo " export ONVIF_TEST_USERNAME=\"service\"" - echo " export ONVIF_TEST_PASSWORD=\"Service.1234\"" - echo - echo -e "${YELLOW}Tests will be skipped.${NC}" - echo -fi - -# Determine which tests to run -TEST_PATTERN="${1:-TestBoschFLEXIDOMEIndoor5100iIR}" - -echo -e "${GREEN}Running tests matching: ${TEST_PATTERN}${NC}" -echo - -# Run tests with verbose output -go test -v -run "$TEST_PATTERN" -timeout 60s - -# Check exit code -if [ $? -eq 0 ]; then - echo - echo -e "${GREEN}✓ All tests passed!${NC}" -else - echo - echo -e "${RED}✗ Some tests failed${NC}" - exit 1 -fi