Browse Source

Old E2E workflows removed

James 1 month ago
parent
commit
24f9250478

+ 0 - 124
Tests/EndToEnd/AccessPointE2ETests.cs

@@ -1,124 +0,0 @@
-using Tests.EndToEnd.Infra;
-using Xunit.Abstractions;
-
-namespace Tests.EndToEnd;
-
-[Collection("Yaml CLI tests")]
-public class AccessPointYamlE2ETests(TempYamlCliFixture fs, ITestOutputHelper outputHelper)
-    : IClassFixture<TempYamlCliFixture>
-{
-    private async Task<(string, string)> ExecuteAsync(params string[] args)
-    {
-        outputHelper.WriteLine($"rpk {string.Join(" ", args)}");
-
-        var inputArgs = args.ToArray();
-        var output = await YamlCliTestHost.RunAsync(
-            inputArgs,
-            fs.Root,
-            outputHelper,
-            "config.yaml");
-
-        outputHelper.WriteLine(output);
-
-        var yaml = await File.ReadAllTextAsync(Path.Combine(fs.Root, "config.yaml"));
-        return (output, yaml);
-    }
-
-    [Fact]
-    public async Task accesspoints_cli_workflow_test()
-    {
-        // Add AP
-        var (output, yaml) = await ExecuteAsync("accesspoints", "add", "ap01");
-        Assert.Equal("Access Point 'ap01' added.\n", output);
-        Assert.Contains("name: ap01", yaml);
-
-        // Update AP
-        (output, yaml) = await ExecuteAsync(
-            "accesspoints", "set", "ap01",
-            "--model", "Unifi-U6-Lite",
-            "--speed", "1"
-        );
-        Assert.Equal("Access Point 'ap01' updated.\n", output);
-
-        Assert.Equal("""
-                     version: 1
-                     resources:
-                     - kind: AccessPoint
-                       model: Unifi-U6-Lite
-                       speed: 1
-                       name: ap01
-
-                     """, yaml);
-
-        // Add second AP
-        (output, yaml) = await ExecuteAsync("accesspoints", "add", "ap02");
-        Assert.Equal("Access Point 'ap02' added.\n", output);
-
-        (output, yaml) = await ExecuteAsync(
-            "accesspoints", "set", "ap02",
-            "--model", "Aruba-AP-515",
-            "--speed", "2.5"
-        );
-        Assert.Equal("Access Point 'ap02' updated.\n", output);
-
-        Assert.Equal("""
-                     version: 1
-                     resources:
-                     - kind: AccessPoint
-                       model: Unifi-U6-Lite
-                       speed: 1
-                       name: ap01
-                     - kind: AccessPoint
-                       model: Aruba-AP-515
-                       speed: 2.5
-                       name: ap02
-
-                     """, yaml);
-
-        // Get AP
-        (output, yaml) = await ExecuteAsync("accesspoints", "get", "ap01");
-        Assert.Equal("ap01  Model: Unifi-U6-Lite, Speed: 1Gbps\n", output);
-
-        // List APs
-        (output, yaml) = await ExecuteAsync("accesspoints", "list");
-        Assert.Equal("""
-                     ╭──────┬───────────────┬──────────────╮
-                     │ Name │ Model         │ Speed (Gbps) │
-                     ├──────┼───────────────┼──────────────┤
-                     │ ap01 │ Unifi-U6-Lite │ 1            │
-                     │ ap02 │ Aruba-AP-515  │ 2.5          │
-                     ╰──────┴───────────────┴──────────────╯
-
-                     """, output);
-
-        // Summary
-        (output, yaml) = await ExecuteAsync("accesspoints", "summary");
-        Assert.Equal("""
-                     ╭──────┬───────────────┬──────────────╮
-                     │ Name │ Model         │ Speed (Gbps) │
-                     ├──────┼───────────────┼──────────────┤
-                     │ ap01 │ Unifi-U6-Lite │ 1            │
-                     │ ap02 │ Aruba-AP-515  │ 2.5          │
-                     ╰──────┴───────────────┴──────────────╯
-
-                     """, output);
-
-        // Delete AP
-        (output, yaml) = await ExecuteAsync("accesspoints", "del", "ap02");
-        Assert.Equal("""
-                     Access Point 'ap02' deleted.
-
-                     """, output);
-
-        // List again
-        (output, yaml) = await ExecuteAsync("accesspoints", "list");
-        Assert.Equal("""
-                     ╭──────┬───────────────┬──────────────╮
-                     │ Name │ Model         │ Speed (Gbps) │
-                     ├──────┼───────────────┼──────────────┤
-                     │ ap01 │ Unifi-U6-Lite │ 1            │
-                     ╰──────┴───────────────┴──────────────╯
-
-                     """, output);
-    }
-}

+ 0 - 94
Tests/EndToEnd/DesktopYamlE2ETest.cs

@@ -1,94 +0,0 @@
-using Tests.EndToEnd.Infra;
-using Xunit.Abstractions;
-
-namespace Tests.EndToEnd;
-
-[Collection("Yaml CLI tests")]
-public class DesktopYamlE2ETests(TempYamlCliFixture fs, ITestOutputHelper outputHelper)
-    : IClassFixture<TempYamlCliFixture>
-{
-    private async Task<(string, string)> ExecuteAsync(params string[] args)
-    {
-        outputHelper.WriteLine($"rpk {string.Join(" ", args)}");
-
-        var inputArgs = args.ToArray();
-        var output = await YamlCliTestHost.RunAsync(
-            inputArgs,
-            fs.Root,
-            outputHelper,
-            "config.yaml"
-        );
-
-        outputHelper.WriteLine(output);
-
-        var yaml = await File.ReadAllTextAsync(Path.Combine(fs.Root, "config.yaml"));
-        return (output, yaml);
-    }
-
-    [Fact]
-    public async Task desktops_cli_workflow_test()
-    {
-        await File.WriteAllTextAsync(Path.Combine(fs.Root, "config.yaml"), "");
-
-        var (output, yaml) = await ExecuteAsync("desktops", "add", "workstation01");
-        Assert.Equal("Desktop 'workstation01' added.\n", output);
-        Assert.Contains("name: workstation01", yaml);
-    }
-
-    [Fact]
-    public async Task desktops_tree_cli_workflow_test()
-    {
-        await File.WriteAllTextAsync(Path.Combine(fs.Root, "config.yaml"), "");
-
-        // Add desktop
-        var (output, yaml) = await ExecuteAsync("desktops", "add", "workstation01");
-        Assert.Equal("Desktop 'workstation01' added.\n", output);
-        Assert.Contains("name: workstation01", yaml);
-
-        // Add systems
-        (output, yaml) = await ExecuteAsync("systems", "add", "sys01");
-        Assert.Equal("System 'sys01' added.\n", output);
-
-        (output, yaml) = await ExecuteAsync("systems", "add", "sys02");
-        Assert.Equal("System 'sys02' added.\n", output);
-
-        (output, yaml) = await ExecuteAsync("systems", "add", "sys03");
-        Assert.Equal("System 'sys03' added.\n", output);
-
-        // Attach systems to desktop
-        (output, yaml) = await ExecuteAsync("systems", "set", "sys01", "--runs-on", "workstation01");
-        Assert.Equal("System 'sys01' updated.\n", output);
-
-        (output, yaml) = await ExecuteAsync("systems", "set", "sys02", "--runs-on", "workstation01");
-        Assert.Equal("System 'sys02' updated.\n", output);
-
-        (output, yaml) = await ExecuteAsync("systems", "set", "sys03", "--runs-on", "workstation01");
-        Assert.Equal("System 'sys03' updated.\n", output);
-
-        // Add services
-        (output, yaml) = await ExecuteAsync("services", "add", "immich");
-        Assert.Equal("Service 'immich' added.\n", output);
-
-        (output, yaml) = await ExecuteAsync("services", "add", "paperless");
-        Assert.Equal("Service 'paperless' added.\n", output);
-
-        // Attach services to sys01
-        (output, yaml) = await ExecuteAsync("services", "set", "immich", "--runs-on", "sys01");
-        Assert.Equal("Service 'immich' updated.\n", output);
-
-        (output, yaml) = await ExecuteAsync("services", "set", "paperless", "--runs-on", "sys01");
-        Assert.Equal("Service 'paperless' updated.\n", output);
-
-        // Render tree
-        (output, yaml) = await ExecuteAsync("desktops", "tree", "workstation01");
-        Assert.Equal("""
-                     workstation01
-                     ├── System: sys01
-                     │   ├── Service: immich
-                     │   └── Service: paperless
-                     ├── System: sys02
-                     └── System: sys03
-
-                     """, output);
-    }
-}

+ 0 - 101
Tests/EndToEnd/ServerYamlE2ETests.cs

@@ -1,101 +0,0 @@
-using Tests.EndToEnd.Infra;
-using Xunit.Abstractions;
-
-namespace Tests.EndToEnd;
-
-[Collection("Yaml CLI tests")]
-public class ServerYamlE2ETests(TempYamlCliFixture fs, ITestOutputHelper outputHelper)
-    : IClassFixture<TempYamlCliFixture>
-{
-    private async Task<(string, string)> ExecuteAsync(params string[] args)
-    {
-        outputHelper.WriteLine($"rpk {string.Join(" ", args)}");
-
-        var inputArgs = args.ToArray();
-        var output = await YamlCliTestHost.RunAsync(
-            inputArgs,
-            fs.Root,
-            outputHelper,
-            "config.yaml"
-        );
-
-        outputHelper.WriteLine(output);
-
-        var yaml = await File.ReadAllTextAsync(Path.Combine(fs.Root, "config.yaml"));
-        return (output, yaml);
-    }
-
-    [Fact]
-    public async Task servers_cli_workflow_test()
-    {
-        await File.WriteAllTextAsync(Path.Combine(fs.Root, "config.yaml"), "");
-
-        // Add switch
-        var (output, yaml) = await ExecuteAsync("servers", "add", "node01");
-        Assert.Equal("Server 'node01' added.\n", output);
-        Assert.Contains("name: node01", yaml);
-    }
-
-    [Fact]
-    public async Task servers_tree_cli_workflow_test()
-    {
-        await File.WriteAllTextAsync(Path.Combine(fs.Root, "config.yaml"), "");
-        // Add switch
-        var (output, yaml) = await ExecuteAsync("servers", "add", "node01");
-        Assert.Equal("Server 'node01' added.\n", output);
-        Assert.Contains("name: node01", yaml);
-
-        (output, yaml) = await ExecuteAsync("systems", "add", "host01");
-        Assert.Equal("System 'host01' added.\n", output);
-
-        (output, yaml) = await ExecuteAsync("systems", "add", "host02");
-        Assert.Equal("System 'host02' added.\n", output);
-
-        (output, yaml) = await ExecuteAsync("systems", "add", "host03");
-        Assert.Equal("System 'host03' added.\n", output);
-
-        (output, yaml) = await ExecuteAsync(
-            "systems", "set", "host01",
-            "--runs-on", "node01"
-        );
-        Assert.Equal("System 'host01' updated.\n", output);
-        (output, yaml) = await ExecuteAsync(
-            "systems", "set", "host02",
-            "--runs-on", "node01"
-        );
-        Assert.Equal("System 'host02' updated.\n", output);
-        (output, yaml) = await ExecuteAsync(
-            "systems", "set", "host03",
-            "--runs-on", "node01"
-        );
-        Assert.Equal("System 'host03' updated.\n", output);
-
-
-        (output, yaml) = await ExecuteAsync("services", "add", "immich");
-        Assert.Equal("Service 'immich' added.\n", output);
-
-        (output, yaml) = await ExecuteAsync("services", "add", "paperless");
-        Assert.Equal("Service 'paperless' added.\n", output);
-
-        (output, yaml) = await ExecuteAsync(
-            "services", "set", "immich",
-            "--runs-on", "host01"
-        );
-
-        (output, yaml) = await ExecuteAsync(
-            "services", "set", "paperless",
-            "--runs-on", "host01"
-        );
-
-        (output, yaml) = await ExecuteAsync("servers", "tree", "node01");
-        Assert.Equal("""
-                     node01
-                     ├── System: host01
-                     │   ├── Service: immich
-                     │   └── Service: paperless
-                     ├── System: host02
-                     └── System: host03
-
-                     """, output);
-    }
-}

+ 0 - 220
Tests/EndToEnd/ServiceYamlE2ETests.cs

@@ -1,220 +0,0 @@
-using Tests.EndToEnd.Infra;
-using Xunit.Abstractions;
-
-namespace Tests.EndToEnd;
-
-[Collection("Yaml CLI tests")]
-public class ServiceYamlE2ETests(TempYamlCliFixture fs, ITestOutputHelper outputHelper)
-    : IClassFixture<TempYamlCliFixture>
-{
-    private async Task<(string, string)> ExecuteAsync(params string[] args)
-    {
-        outputHelper.WriteLine($"rpk {string.Join(" ", args)}");
-
-        var inputArgs = args.ToArray();
-        var output = await YamlCliTestHost.RunAsync(inputArgs, fs.Root, outputHelper, "config.yaml");
-
-        outputHelper.WriteLine(output);
-
-        var yaml = await File.ReadAllTextAsync(Path.Combine(fs.Root, "config.yaml"));
-        return (output, yaml);
-    }
-
-    [Fact]
-    public async Task services_cli_yaml_test()
-    {
-        await File.WriteAllTextAsync(Path.Combine(fs.Root, "config.yaml"), "");
-
-        // Add system
-        var (output, yaml) = await ExecuteAsync("services", "add", "immich");
-        Assert.Equal("Service 'immich' added.\n", output);
-        Assert.Equal("""
-                     version: 1
-                     resources:
-                     - kind: Service
-                       name: immich
-
-                     """, yaml);
-        (output, yaml) = await ExecuteAsync("systems", "add", "vm01");
-
-        // Update system
-        (output, yaml) = await ExecuteAsync("services", "set", "immich", "--ip", "192.168.10.14", "--port", "80",
-            "--protocol", "TCP", "--url", "http://timmoth.lan:80", "--runs-on", "vm01");
-
-        Assert.Equal("Service 'immich' updated.\n", output);
-
-        outputHelper.WriteLine(yaml);
-        Assert.Equal("""
-                     version: 1
-                     resources:
-                     - kind: Service
-                       network:
-                         ip: 192.168.10.14
-                         port: 80
-                         protocol: TCP
-                         url: http://timmoth.lan:80
-                       name: immich
-                       runsOn: vm01
-                     - kind: System
-                       name: vm01
-
-                     """, yaml);
-
-        // Delete system
-        (output, yaml) = await ExecuteAsync("services", "del", "immich");
-        Assert.Equal("""
-                     Service 'immich' deleted.
-
-                     """, output);
-
-        Assert.Equal("""
-                     version: 1
-                     resources:
-                     - kind: System
-                       name: vm01
-
-                     """, yaml);
-
-        // Ensure list is empty
-        (output, yaml) = await ExecuteAsync("services", "list");
-        Assert.Equal("""
-                     No Services found.
-
-                     """, output);
-    }
-
-    [Fact]
-    public async Task services_cli_workflow_test()
-    {
-        await File.WriteAllTextAsync(Path.Combine(fs.Root, "config.yaml"), "");
-
-        // Add system
-        var (output, yaml) = await ExecuteAsync("services", "add", "immich");
-        Assert.Equal("Service 'immich' added.\n", output);
-
-        (output, yaml) = await ExecuteAsync("servers", "add", "c6400");
-        Assert.Equal("Server 'c6400' added.\n", output);
-
-        (output, yaml) = await ExecuteAsync("systems", "add", "vm01");
-        Assert.Equal("System 'vm01' added.\n", output);
-        (output, yaml) = await ExecuteAsync("systems", "set", "vm01", "--runs-on", "c6400");
-
-
-        // Update system
-        (output, yaml) = await ExecuteAsync("services", "set", "immich", "--ip", "192.168.10.14", "--port", "80",
-            "--protocol", "TCP", "--url", "http://timmoth.lan:80", "--runs-on", "vm01");
-
-        Assert.Equal("Service 'immich' updated.\n", output);
-
-        // Get system by name
-        (output, yaml) = await ExecuteAsync("services", "get", "immich");
-        Assert.Equal("""
-                     immich  Ip: 192.168.10.14, Port: 80, Protocol: TCP, Url: http://timmoth.lan:80, 
-                     RunsOn: c6400/vm01
-
-                     """, output);
-
-        // List systems
-        (output, yaml) = await ExecuteAsync("services", "list");
-        Assert.Equal("""
-                     ╭────────┬───────────────┬──────┬──────────┬──────────────────────┬────────────╮
-                     │ Name   │ Ip            │ Port │ Protocol │ Url                  │ Runs On    │
-                     ├────────┼───────────────┼──────┼──────────┼──────────────────────┼────────────┤
-                     │ immich │ 192.168.10.14 │ 80   │ TCP      │ http://timmoth.lan:8 │ c6400/vm01 │
-                     │        │               │      │          │ 0                    │            │
-                     ╰────────┴───────────────┴──────┴──────────┴──────────────────────┴────────────╯
-
-                     """, output);
-
-        // Report systemså
-        (output, yaml) = await ExecuteAsync("services", "summary");
-        Assert.Equal("""
-                     ╭────────┬───────────────┬──────┬──────────┬──────────────────────┬────────────╮
-                     │ Name   │ Ip            │ Port │ Protocol │ Url                  │ Runs On    │
-                     ├────────┼───────────────┼──────┼──────────┼──────────────────────┼────────────┤
-                     │ immich │ 192.168.10.14 │ 80   │ TCP      │ http://timmoth.lan:8 │ c6400/vm01 │
-                     │        │               │      │          │ 0                    │            │
-                     ╰────────┴───────────────┴──────┴──────────┴──────────────────────┴────────────╯
-
-                     """, output);
-
-        // Delete system
-        (output, yaml) = await ExecuteAsync("services", "del", "immich");
-        Assert.Equal("""
-                     Service 'immich' deleted.
-
-                     """, output);
-
-        // Ensure list is empty
-        (output, yaml) = await ExecuteAsync("services", "list");
-        Assert.Equal("""
-                     No Services found.
-
-                     """, output);
-    }
-
-    [Fact]
-    public async Task services_subnets_cli_test()
-    {
-        await File.WriteAllTextAsync(Path.Combine(fs.Root, "config.yaml"), "");
-
-        // Add services
-        var (output, yaml) = await ExecuteAsync("services", "add", "svc1");
-        Assert.Equal("Service 'svc1' added.\n", output);
-
-        (output, yaml) = await ExecuteAsync("services", "add", "svc2");
-        Assert.Equal("Service 'svc2' added.\n", output);
-
-        (output, yaml) = await ExecuteAsync("services", "add", "svc3");
-        Assert.Equal("Service 'svc3' added.\n", output);
-
-        // Add system + server so RunsOn resolves
-        (output, yaml) = await ExecuteAsync("systems", "add", "vm01");
-        Assert.Equal("System 'vm01' added.\n", output);
-
-        (output, yaml) = await ExecuteAsync("servers", "add", "c6400");
-        Assert.Equal("Server 'c6400' added.\n", output);
-
-        (output, yaml) = await ExecuteAsync("systems", "set", "vm01", "--runs-on", "c6400");
-        Assert.Equal("System 'vm01' updated.\n", output);
-
-        // Assign IPs
-        (output, yaml) = await ExecuteAsync("services", "set", "svc1", "--ip", "192.168.10.10", "--port", "80",
-            "--protocol", "TCP", "--runs-on", "vm01");
-        Assert.Equal("Service 'svc1' updated.\n", output);
-
-        (output, yaml) = await ExecuteAsync("services", "set", "svc2", "--ip", "192.168.10.20", "--port", "443",
-            "--protocol", "TCP", "--runs-on", "vm01");
-        Assert.Equal("Service 'svc2' updated.\n", output);
-
-        (output, yaml) = await ExecuteAsync("services", "set", "svc3", "--ip", "10.0.0.5", "--port", "8080",
-            "--protocol", "TCP", "--runs-on", "vm01");
-        Assert.Equal("Service 'svc3' updated.\n", output);
-
-        // -----------------------------
-        // Test CIDR filter mode
-        // -----------------------------
-        (output, yaml) = await ExecuteAsync("services", "subnets", "--cidr", "192.168.10.0/24");
-
-        Assert.Equal("""
-                     Services in 192.168.10.0/24
-                     ╭──────┬───────────────┬─────────╮
-                     │ Name │ IP            │ Runs On │
-                     ├──────┼───────────────┼─────────┤
-                     │ svc1 │ 192.168.10.10 │ vm01    │
-                     │ svc2 │ 192.168.10.20 │ vm01    │
-                     ╰──────┴───────────────┴─────────╯
-
-                     """, output);
-
-        // -----------------------------
-        // Test subnet summary mode
-        // -----------------------------
-        (output, yaml) = await ExecuteAsync("services", "subnets");
-
-        Assert.Contains("Subnet", output);
-        Assert.Contains("Utilization", output);
-        Assert.Contains("192.168.10.0/24", output);
-        Assert.Contains("10.0.0.0/24", output);
-    }
-}

+ 0 - 117
Tests/EndToEnd/SwitchYamlE2ETests.cs

@@ -1,117 +0,0 @@
-using Tests.EndToEnd.Infra;
-using Xunit.Abstractions;
-
-namespace Tests.EndToEnd;
-
-[Collection("Yaml CLI tests")]
-public class SwitchYamlE2ETests(TempYamlCliFixture fs, ITestOutputHelper outputHelper)
-    : IClassFixture<TempYamlCliFixture>
-{
-    private async Task<(string, string)> ExecuteAsync(params string[] args)
-    {
-        outputHelper.WriteLine($"rpk {string.Join(" ", args)}");
-
-        var inputArgs = args.ToArray();
-        var output = await YamlCliTestHost.RunAsync(
-            inputArgs,
-            fs.Root,
-            outputHelper,
-            "config.yaml");
-
-        outputHelper.WriteLine(output);
-
-        var yaml = await File.ReadAllTextAsync(Path.Combine(fs.Root, "config.yaml"));
-        return (output, yaml);
-    }
-
-    [Fact]
-    public async Task switches_cli_workflow_test()
-    {
-        await File.WriteAllTextAsync(Path.Combine(fs.Root, "config.yaml"), "");
-
-        // Add switch
-        var (output, yaml) = await ExecuteAsync("switches", "add", "sw01");
-        Assert.Equal("Switch 'sw01' added.\n", output);
-        Assert.Contains("name: sw01", yaml);
-
-        (output, yaml) = await ExecuteAsync("switches", "set", "sw01", "--Model", "Netgear GS108", "--managed", "true",
-            "--poe", "true");
-        Assert.Equal("Switch 'sw01' updated.\n", output);
-        Assert.Equal("""
-                     version: 1
-                     resources:
-                     - kind: Switch
-                       model: Netgear GS108
-                       managed: true
-                       poe: true
-                       name: sw01
-
-                     """, yaml);
-
-        (output, yaml) = await ExecuteAsync("switches", "add", "sw02");
-        Assert.Equal("Switch 'sw02' added.\n", output);
-        Assert.Contains("name: sw02", yaml);
-
-        (output, yaml) = await ExecuteAsync("switches", "set", "sw02", "--Model", "TP-Link TL-SG108E", "--managed",
-            "false", "--poe", "false");
-        Assert.Equal("Switch 'sw02' updated.\n", output);
-
-        Assert.Equal("""
-                     version: 1
-                     resources:
-                     - kind: Switch
-                       model: Netgear GS108
-                       managed: true
-                       poe: true
-                       name: sw01
-                     - kind: Switch
-                       model: TP-Link TL-SG108E
-                       managed: false
-                       poe: false
-                       name: sw02
-
-                     """, yaml);
-
-        (output, yaml) = await ExecuteAsync("switches", "get", "sw01");
-        Assert.Equal("sw01  Model: Netgear GS108, Managed: Yes, PoE: Yes\n", output);
-
-
-        (output, yaml) = await ExecuteAsync("switches", "list");
-        Assert.Equal("""
-                     ╭──────┬───────────────────┬─────────┬─────┬───────┬──────────────╮
-                     │ Name │ Model             │ Managed │ PoE │ Ports │ Port Summary │
-                     ├──────┼───────────────────┼─────────┼─────┼───────┼──────────────┤
-                     │ sw01 │ Netgear GS108     │ yes     │ yes │ 0     │ Unknown      │
-                     │ sw02 │ TP-Link TL-SG108E │ no      │ no  │ 0     │ Unknown      │
-                     ╰──────┴───────────────────┴─────────┴─────┴───────┴──────────────╯
-
-                     """, output);
-
-        (output, yaml) = await ExecuteAsync("switches", "summary");
-        Assert.Contains("""
-                        ╭──────┬───────────────────┬─────────┬─────┬───────┬───────────┬──────────────╮
-                        │ Name │ Model             │ Managed │ PoE │ Ports │ Max Speed │ Port Summary │
-                        ├──────┼───────────────────┼─────────┼─────┼───────┼───────────┼──────────────┤
-                        │ sw01 │ Netgear GS108     │ yes     │ yes │ 0     │ 0G        │ Unknown      │
-                        │ sw02 │ TP-Link TL-SG108E │ no      │ no  │ 0     │ 0G        │ Unknown      │
-                        ╰──────┴───────────────────┴─────────┴─────┴───────┴───────────┴──────────────╯
-
-                        """, output);
-
-        (output, yaml) = await ExecuteAsync("switches", "del", "sw02");
-        Assert.Equal("""
-                     Switch 'sw02' deleted.
-
-                     """, output);
-
-        (output, yaml) = await ExecuteAsync("switches", "list");
-        Assert.Equal("""
-                     ╭──────┬───────────────┬─────────┬─────┬───────┬──────────────╮
-                     │ Name │ Model         │ Managed │ PoE │ Ports │ Port Summary │
-                     ├──────┼───────────────┼─────────┼─────┼───────┼──────────────┤
-                     │ sw01 │ Netgear GS108 │ yes     │ yes │ 0     │ Unknown      │
-                     ╰──────┴───────────────┴─────────┴─────┴───────┴──────────────╯
-
-                     """, output);
-    }
-}

+ 0 - 152
Tests/EndToEnd/SystemYamlE2ETests.cs

@@ -1,152 +0,0 @@
-using Tests.EndToEnd.Infra;
-using Xunit.Abstractions;
-
-namespace Tests.EndToEnd;
-
-[Collection("Yaml CLI tests")]
-public class SystemYamlE2ETests(TempYamlCliFixture fs, ITestOutputHelper outputHelper)
-    : IClassFixture<TempYamlCliFixture>
-{
-    private async Task<(string, string)> ExecuteAsync(params string[] args)
-    {
-        outputHelper.WriteLine($"rpk {string.Join(" ", args)}");
-
-        var inputArgs = args.ToArray();
-        var output = await YamlCliTestHost.RunAsync(
-            inputArgs,
-            fs.Root,
-            outputHelper,
-            "config.yaml");
-
-        outputHelper.WriteLine(output);
-
-        var yaml = await File.ReadAllTextAsync(Path.Combine(fs.Root, "config.yaml"));
-        return (output, yaml);
-    }
-
-    [Fact]
-    public async Task systems_cli_workflow_test()
-    {
-        await File.WriteAllTextAsync(Path.Combine(fs.Root, "config.yaml"), "");
-
-        var (output, yaml) = await ExecuteAsync("servers", "add", "hypervisor01");
-        (output, yaml) = await ExecuteAsync("systems", "add", "host01");
-        Assert.Equal("System 'host01' added.\n", output);
-        Assert.Equal("""
-                     version: 1
-                     resources:
-                     - kind: Server
-                       name: hypervisor01
-                     - kind: System
-                       name: host01
-
-                     """, yaml);
-
-        // Update system
-        (output, yaml) = await ExecuteAsync(
-            "systems", "set", "host01",
-            "--type", "baremetal",
-            "--os", "ubuntu-22.04",
-            "--cores", "4",
-            "--ram", "8192",
-            "--runs-on", "hypervisor01"
-        );
-
-        Assert.Equal("System 'host01' updated.\n", output);
-
-        outputHelper.WriteLine(yaml);
-        Assert.Equal("""
-                     version: 1
-                     resources:
-                     - kind: Server
-                       name: hypervisor01
-                     - kind: System
-                       type: baremetal
-                       os: ubuntu-22.04
-                       cores: 4
-                       ram: 8192
-                       name: host01
-                       runsOn: hypervisor01
-
-                     """, yaml);
-
-        // Get system by name
-        (output, yaml) = await ExecuteAsync("systems", "get", "host01");
-        Assert.Equal(
-            "host01  Type: baremetal, OS: ubuntu-22.04, Cores: 4, RAM: 8192GB, Storage: 0GB, \nRunsOn: hypervisor01\n",
-            output);
-
-        // List systems
-        (output, yaml) = await ExecuteAsync("systems", "list");
-        Assert.Equal("""
-                     ╭────────┬───────────┬────────────┬───────┬──────────┬────────────┬────────────╮
-                     │ Name   │ Type      │ OS         │ Cores │ RAM (GB) │ Storage    │ Runs On    │
-                     │        │           │            │       │          │ (GB)       │            │
-                     ├────────┼───────────┼────────────┼───────┼──────────┼────────────┼────────────┤
-                     │ host01 │ baremetal │ ubuntu-22. │ 4     │ 8192     │ 0          │ hypervisor │
-                     │        │           │ 04         │       │          │            │ 01         │
-                     ╰────────┴───────────┴────────────┴───────┴──────────┴────────────┴────────────╯
-
-                     """, output);
-
-        // Report systems
-        (output, yaml) = await ExecuteAsync("systems", "summary");
-        Assert.Equal("""
-                     ╭────────┬───────────┬────────────┬───────┬──────────┬────────────┬────────────╮
-                     │ Name   │ Type      │ OS         │ Cores │ RAM (GB) │ Storage    │ Runs On    │
-                     │        │           │            │       │          │ (GB)       │            │
-                     ├────────┼───────────┼────────────┼───────┼──────────┼────────────┼────────────┤
-                     │ host01 │ baremetal │ ubuntu-22. │ 4     │ 8192     │ 0          │ hypervisor │
-                     │        │           │ 04         │       │          │            │ 01         │
-                     ╰────────┴───────────┴────────────┴───────┴──────────┴────────────┴────────────╯
-
-                     """, output);
-
-        // Delete system
-        (output, yaml) = await ExecuteAsync("systems", "del", "host01");
-        Assert.Equal("""
-                     System 'host01' deleted.
-
-                     """, output);
-
-        // Ensure list is empty
-        (output, yaml) = await ExecuteAsync("systems", "list");
-        Assert.Equal("""
-                     No systems found.
-
-                     """, output);
-    }
-
-    [Fact]
-    public async Task system_tree_cli_workflow_test()
-    {
-        await File.WriteAllTextAsync(Path.Combine(fs.Root, "config.yaml"), "");
-
-        var (output, yaml) = await ExecuteAsync("systems", "add", "host01");
-        Assert.Equal("System 'host01' added.\n", output);
-
-        (output, yaml) = await ExecuteAsync("services", "add", "immich");
-        Assert.Equal("Service 'immich' added.\n", output);
-
-        (output, yaml) = await ExecuteAsync("services", "add", "paperless");
-        Assert.Equal("Service 'paperless' added.\n", output);
-
-        (output, yaml) = await ExecuteAsync(
-            "services", "set", "immich",
-            "--runs-on", "host01"
-        );
-
-        (output, yaml) = await ExecuteAsync(
-            "services", "set", "paperless",
-            "--runs-on", "host01"
-        );
-
-        (output, yaml) = await ExecuteAsync("systems", "tree", "host01");
-        Assert.Equal("""
-                     host01
-                     ├── Service: immich
-                     └── Service: paperless
-
-                     """, output);
-    }
-}

+ 0 - 127
Tests/EndToEnd/UpsYamlE2ETests.cs

@@ -1,127 +0,0 @@
-using Tests.EndToEnd.Infra;
-using Xunit.Abstractions;
-
-namespace Tests.EndToEnd;
-
-[Collection("Yaml CLI tests")]
-public class UpsYamlE2ETests(TempYamlCliFixture fs, ITestOutputHelper outputHelper)
-    : IClassFixture<TempYamlCliFixture>
-{
-    private async Task<(string, string)> ExecuteAsync(params string[] args)
-    {
-        outputHelper.WriteLine($"rpk {string.Join(" ", args)}");
-
-        var inputArgs = args.ToArray();
-        var output = await YamlCliTestHost.RunAsync(
-            inputArgs,
-            fs.Root,
-            outputHelper,
-            "config.yaml");
-
-        outputHelper.WriteLine(output);
-
-        var yaml = await File.ReadAllTextAsync(Path.Combine(fs.Root, "config.yaml"));
-        return (output, yaml);
-    }
-
-    [Fact]
-    public async Task ups_cli_workflow_test()
-    {
-        await File.WriteAllTextAsync(Path.Combine(fs.Root, "config.yaml"), "");
-
-        // Add UPS
-        var (output, yaml) = await ExecuteAsync("ups", "add", "ups01");
-        Assert.Equal("UPS 'ups01' added.\n", output);
-        Assert.Contains("name: ups01", yaml);
-
-        // Update UPS
-        (output, yaml) = await ExecuteAsync(
-            "ups", "set", "ups01",
-            "--model", "APC Smart-UPS 1500",
-            "--va", "1500"
-        );
-        Assert.Equal("UPS 'ups01' updated.\n", output);
-
-        Assert.Equal("""
-                     version: 1
-                     resources:
-                     - kind: Ups
-                       model: APC Smart-UPS 1500
-                       va: 1500
-                       name: ups01
-
-                     """, yaml);
-
-        // Add second UPS
-        (output, yaml) = await ExecuteAsync("ups", "add", "ups02");
-        Assert.Equal("UPS 'ups02' added.\n", output);
-        Assert.Contains("name: ups02", yaml);
-
-        (output, yaml) = await ExecuteAsync(
-            "ups", "set", "ups02",
-            "--model", "CyberPower CP1500PFCLCD",
-            "--va", "1500"
-        );
-        Assert.Equal("UPS 'ups02' updated.\n", output);
-
-        Assert.Equal("""
-                     version: 1
-                     resources:
-                     - kind: Ups
-                       model: APC Smart-UPS 1500
-                       va: 1500
-                       name: ups01
-                     - kind: Ups
-                       model: CyberPower CP1500PFCLCD
-                       va: 1500
-                       name: ups02
-
-                     """, yaml);
-
-        // Get UPS
-        (output, yaml) = await ExecuteAsync("ups", "get", "ups01");
-        Assert.Equal("ups01  Model: APC Smart-UPS 1500, VA: 1500\n", output);
-
-        // List UPS units
-        (output, yaml) = await ExecuteAsync("ups", "list");
-        Assert.Equal("""
-                     ╭───────┬─────────────────────────┬──────╮
-                     │ Name  │ Model                   │ VA   │
-                     ├───────┼─────────────────────────┼──────┤
-                     │ ups01 │ APC Smart-UPS 1500      │ 1500 │
-                     │ ups02 │ CyberPower CP1500PFCLCD │ 1500 │
-                     ╰───────┴─────────────────────────┴──────╯
-
-                     """, output);
-
-        // Summary
-        (output, yaml) = await ExecuteAsync("ups", "summary");
-        Assert.Contains("""
-                        ╭───────┬─────────────────────────┬──────╮
-                        │ Name  │ Model                   │ VA   │
-                        ├───────┼─────────────────────────┼──────┤
-                        │ ups01 │ APC Smart-UPS 1500      │ 1500 │
-                        │ ups02 │ CyberPower CP1500PFCLCD │ 1500 │
-                        ╰───────┴─────────────────────────┴──────╯
-
-                        """, output);
-
-        // Delete UPS
-        (output, yaml) = await ExecuteAsync("ups", "del", "ups02");
-        Assert.Equal("""
-                     UPS 'ups02' deleted.
-
-                     """, output);
-
-        // List again
-        (output, yaml) = await ExecuteAsync("ups", "list");
-        Assert.Equal("""
-                     ╭───────┬────────────────────┬──────╮
-                     │ Name  │ Model              │ VA   │
-                     ├───────┼────────────────────┼──────┤
-                     │ ups01 │ APC Smart-UPS 1500 │ 1500 │
-                     ╰───────┴────────────────────┴──────╯
-
-                     """, output);
-    }
-}