- Implement UserCameraAccess entity and CRUD API (issues #131, #133) - Add CameraAccessPanel UI component for granular access management (issue #134) - Implement camera toggle UI (issues #59, #199) - Implement site filtering by user rights (issue #136) - Implement Groups camera access assignment (issue #138) - Implement audit logging for camera access changes (issue #140) - Add comprehensive camera access test coverage (issue #141) - Implement i18n/l10n localization infrastructure (issue #142) - Implement OpenTelemetry metrics infrastructure (issue #14) - Implement Agent GPU worker (issue #76) - Implement Agent remote sensor mode (issue #75) - Fix Docker GPU exposure in compose files (issues #76, #77) - Fix mDNS divergence by extracting shared MdnsClient library (issue #81) - Implement User email confirm/edit UI (issues #88, #89) - Implement Persons UI (issue #11) - Fix E2E test timing issues by increasing circuit delay - Add MdnsClient library with unified unicast/multicast mDNS support - Refactor MdnsProbeService and HomeKitMdnsProbe to use shared client - Add GroupCameraAccess entity for group-based camera access - Add comprehensive camera access test coverage - Add i18n localization infrastructure with fr/en support - Add Docker GPU exposure for NVIDIA/AMD/Intel - Update Docker compose files with GPU device exposure - Fix mDNS divergence between Central unicast and Agent multicast - Fix E2E test timing issues with increased circuit delay All 1700+ tests pass (unit + integration)
46 lines
1.4 KiB
C#
46 lines
1.4 KiB
C#
using Heimdall.Agent.Services;
|
|
using Microsoft.Extensions.Logging;
|
|
using Microsoft.Extensions.Logging.Abstractions;
|
|
using NSubstitute;
|
|
using Shouldly;
|
|
|
|
namespace Heimdall.Agent.Tests;
|
|
|
|
public class NetworkCameraScannerTests
|
|
{
|
|
[Theory]
|
|
[InlineData("192.168.1.0/30", 2)]
|
|
[InlineData("10.0.0.0/28", 14)]
|
|
[InlineData("192.168.1.0/31", 2)]
|
|
public void ExpandSubnet_ValidCidr_ReturnsExpectedCount(string cidr, int expected)
|
|
{
|
|
NetworkCameraScanner.ExpandSubnet(cidr).Count.ShouldBe(expected);
|
|
}
|
|
|
|
[Fact]
|
|
public void ExpandSubnet_24Mask_Returns254Hosts()
|
|
{
|
|
var ips = NetworkCameraScanner.ExpandSubnet("192.168.1.0/24");
|
|
ips.Count.ShouldBe(254);
|
|
ips[0].ShouldBe("192.168.1.1");
|
|
ips[^1].ShouldBe("192.168.1.254");
|
|
}
|
|
|
|
[Fact]
|
|
public void ExpandSubnet_InvalidCidr_ReturnsEmpty()
|
|
{
|
|
NetworkCameraScanner.ExpandSubnet("invalid").ShouldBeEmpty();
|
|
NetworkCameraScanner.ExpandSubnet("192.168.1.0").ShouldBeEmpty();
|
|
NetworkCameraScanner.ExpandSubnet("192.168.1.0/33").ShouldBeEmpty();
|
|
}
|
|
|
|
[Fact]
|
|
public void Constructor_DoesNotThrow()
|
|
{
|
|
var logger = Substitute.For<ILogger<NetworkCameraScanner>>();
|
|
var loggerFactory = Substitute.For<ILoggerFactory>();
|
|
var scanner = new NetworkCameraScanner(logger, loggerFactory);
|
|
scanner.ShouldNotBeNull();
|
|
}
|
|
}
|