Skip to content

Latest commit

 

History

History
106 lines (79 loc) · 3.39 KB

File metadata and controls

106 lines (79 loc) · 3.39 KB

Testing Results: Multiple IPs and MACs Support

Test Summary

All tests passed successfully! ✅

Tests Performed

1. Database Schema Tests

  • ✅ Created new schema with auto-increment PK
  • ✅ Added UNIQUE constraint on (container_id, network_name)
  • ✅ Verified column order and data types

2. Multi-Network Insert Tests

  • ✅ Inserted container with 3 network interfaces
  • ✅ Each interface stored in separate row
  • ✅ All IPs and MACs preserved correctly

3. ON CONFLICT Tests

  • ✅ Attempted duplicate insert (correctly failed)
  • ✅ UPDATE via ON CONFLICT works
  • ✅ IP and MAC updated on network re-scan

4. Cleanup Tests

  • ✅ DELETE removes all interfaces for removed container
  • ✅ Container-specific cleanup preserves other containers
  • ✅ Network count verified after cleanup

5. Go Code Tests

  • ✅ Compiled successfully
  • ✅ Schema generation works
  • ✅ Docker scan logic updated correctly

6. React UI Tests

  • ✅ Built successfully
  • ✅ normalizeRow handles new column indices
  • ✅ Row keys use container_id + network for uniqueness

7. Integration Tests

  • ✅ Full workflow: init → scan → update → cleanup
  • ✅ API response format verified
  • ✅ Multiple networks displayed as separate rows

Sample Data

Example: Container with 3 Networks

Container web123 (nginx-prod) appears as 3 rows:

ID Container ID IP MAC Network
1 web123 172.17.0.5 02:42:ac:11:00:05 bridge
2 web123 192.168.50.10 02:42:c0:a8:32:0a frontend
3 web123 10.10.0.20 02:42:0a:0a:00:14 backend

Changes Made

  1. Database Schema (config/atlas_go/internal/db/setup.go & config/scripts/atlas_db_setup.sh)

    • Changed PK from TEXT to auto-increment INTEGER
    • Added container_id column
    • Added UNIQUE constraint on (container_id, network_name)
  2. Go Code (config/atlas_go/internal/scan/docker_scan.go)

    • Updated INSERT to use container_id column
    • Changed ON CONFLICT to handle (container_id, network_name)
    • Updated cleanup to use container_id field
  3. React UI (data/react-ui/src/components/HostsTable.jsx)

    • Updated normalizeRow to handle different column indices for docker vs hosts
    • Changed row key generation to use container_id + network
    • Each network interface now displays as separate row
  4. Documentation

    • Created MIGRATION_GUIDE.md with upgrade instructions
    • Updated README.md to highlight multi-network support
    • Added testing documentation

Deployment Readiness

The changes are production-ready:

  • ✅ All code compiles
  • ✅ All tests pass
  • ✅ UI builds successfully
  • ✅ Docker build ready
  • ✅ Migration guide provided
  • ✅ Backward compatibility noted

Migration Path

Users upgrading from previous versions can:

  1. Fresh install: Just pull the new image (recommended)
  2. Manual migration: Follow MIGRATION_GUIDE.md to preserve data

Performance Impact

  • ✅ No performance degradation expected
  • ✅ Queries remain fast (indexed on container_id)
  • ✅ UI handles additional rows efficiently
  • ℹ️ Storage increases linearly with number of networks per container

Next Steps

  1. Deploy to production
  2. Monitor for any edge cases
  3. Collect user feedback
  4. Consider future enhancements (e.g., network topology visualization)