public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Gabriel Goller <g.goller@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH proxmox-ve-rs v5 21/22] ve-config: add integrations tests
Date: Wed, 16 Jul 2025 15:07:47 +0200	[thread overview]
Message-ID: <20250716130837.585796-27-g.goller@proxmox.com> (raw)
In-Reply-To: <20250716130837.585796-1-g.goller@proxmox.com>

Add integration tests for the full cycle from section-config to FRR
config file for both openfabric and ospf. It tests everything
end-to-end, from reading the configuration file to converting it into
a FabricConfig and then serializing an FRR configuration from it.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
---
 proxmox-ve-config/Cargo.toml                  |   3 +
 .../fabric/cfg/openfabric_default/fabrics.cfg |  18 +++
 .../cfg/openfabric_dualstack/fabrics.cfg      |  22 +++
 .../cfg/openfabric_ipv6_only/fabrics.cfg      |  18 +++
 .../cfg/openfabric_loopback/fabrics.cfg       |  18 +++
 .../fabrics.cfg                               |  25 ++++
 .../cfg/openfabric_multi_fabric/fabrics.cfg   |  25 ++++
 .../fabrics.cfg                               |  25 ++++
 .../openfabric_verification_fail/fabrics.cfg  |  12 ++
 .../tests/fabric/cfg/ospf_default/fabrics.cfg |  13 ++
 .../cfg/ospf_loopback_prefix_fail/fabrics.cfg |  17 +++
 .../fabric/cfg/ospf_multi_fabric/fabrics.cfg  |  25 ++++
 .../cfg/ospf_verification_fail/fabrics.cfg    |  13 ++
 proxmox-ve-config/tests/fabric/helper.rs      |  43 ++++++
 proxmox-ve-config/tests/fabric/main.rs        | 141 ++++++++++++++++++
 .../fabric__openfabric_default_pve.snap       |  34 +++++
 .../fabric__openfabric_default_pve1.snap      |  33 ++++
 .../fabric__openfabric_dualstack_pve.snap     |  46 ++++++
 .../fabric__openfabric_ipv6_only_pve.snap     |  34 +++++
 .../fabric__openfabric_multi_fabric_pve1.snap |  49 ++++++
 .../snapshots/fabric__ospf_default_pve.snap   |  32 ++++
 .../snapshots/fabric__ospf_default_pve1.snap  |  28 ++++
 .../fabric__ospf_multi_fabric_pve1.snap       |  45 ++++++
 23 files changed, 719 insertions(+)
 create mode 100644 proxmox-ve-config/tests/fabric/cfg/openfabric_default/fabrics.cfg
 create mode 100644 proxmox-ve-config/tests/fabric/cfg/openfabric_dualstack/fabrics.cfg
 create mode 100644 proxmox-ve-config/tests/fabric/cfg/openfabric_ipv6_only/fabrics.cfg
 create mode 100644 proxmox-ve-config/tests/fabric/cfg/openfabric_loopback/fabrics.cfg
 create mode 100644 proxmox-ve-config/tests/fabric/cfg/openfabric_loopback_prefix_fail/fabrics.cfg
 create mode 100644 proxmox-ve-config/tests/fabric/cfg/openfabric_multi_fabric/fabrics.cfg
 create mode 100644 proxmox-ve-config/tests/fabric/cfg/openfabric_same_net_on_same_node/fabrics.cfg
 create mode 100644 proxmox-ve-config/tests/fabric/cfg/openfabric_verification_fail/fabrics.cfg
 create mode 100644 proxmox-ve-config/tests/fabric/cfg/ospf_default/fabrics.cfg
 create mode 100644 proxmox-ve-config/tests/fabric/cfg/ospf_loopback_prefix_fail/fabrics.cfg
 create mode 100644 proxmox-ve-config/tests/fabric/cfg/ospf_multi_fabric/fabrics.cfg
 create mode 100644 proxmox-ve-config/tests/fabric/cfg/ospf_verification_fail/fabrics.cfg
 create mode 100644 proxmox-ve-config/tests/fabric/helper.rs
 create mode 100644 proxmox-ve-config/tests/fabric/main.rs
 create mode 100644 proxmox-ve-config/tests/fabric/snapshots/fabric__openfabric_default_pve.snap
 create mode 100644 proxmox-ve-config/tests/fabric/snapshots/fabric__openfabric_default_pve1.snap
 create mode 100644 proxmox-ve-config/tests/fabric/snapshots/fabric__openfabric_dualstack_pve.snap
 create mode 100644 proxmox-ve-config/tests/fabric/snapshots/fabric__openfabric_ipv6_only_pve.snap
 create mode 100644 proxmox-ve-config/tests/fabric/snapshots/fabric__openfabric_multi_fabric_pve1.snap
 create mode 100644 proxmox-ve-config/tests/fabric/snapshots/fabric__ospf_default_pve.snap
 create mode 100644 proxmox-ve-config/tests/fabric/snapshots/fabric__ospf_default_pve1.snap
 create mode 100644 proxmox-ve-config/tests/fabric/snapshots/fabric__ospf_multi_fabric_pve1.snap

diff --git a/proxmox-ve-config/Cargo.toml b/proxmox-ve-config/Cargo.toml
index ac8f9f69e154..d5663f953614 100644
--- a/proxmox-ve-config/Cargo.toml
+++ b/proxmox-ve-config/Cargo.toml
@@ -31,3 +31,6 @@ proxmox-sortable-macro = "1"
 
 [features]
 frr = ["dep:proxmox-frr"]
+
+[dev-dependencies]
+insta = "1.21"
diff --git a/proxmox-ve-config/tests/fabric/cfg/openfabric_default/fabrics.cfg b/proxmox-ve-config/tests/fabric/cfg/openfabric_default/fabrics.cfg
new file mode 100644
index 000000000000..3df8450a9faa
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/cfg/openfabric_default/fabrics.cfg
@@ -0,0 +1,18 @@
+openfabric_fabric: uwu
+        hello_interval 4
+        ip_prefix 192.168.2.0/24
+
+openfabric_node: uwu_pve
+        interfaces name=ens20,hello_multiplier=50
+        interfaces name=ens19
+        ip 192.168.2.8
+
+openfabric_node: uwu_pve1
+        interfaces name=ens19
+        interfaces name=ens20
+        ip 192.168.2.9
+
+openfabric_node: uwu_pve2
+        interfaces name=ens19
+        interfaces name=ens20
+        ip 192.168.2.10
diff --git a/proxmox-ve-config/tests/fabric/cfg/openfabric_dualstack/fabrics.cfg b/proxmox-ve-config/tests/fabric/cfg/openfabric_dualstack/fabrics.cfg
new file mode 100644
index 000000000000..fe1e986af793
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/cfg/openfabric_dualstack/fabrics.cfg
@@ -0,0 +1,22 @@
+openfabric_fabric: uwu
+        hello_interval 4
+        ip_prefix 192.168.2.0/24
+        ip6_prefix 2001:db8::0/64
+
+openfabric_node: uwu_pve
+        interfaces name=ens20,hello_multiplier=50
+        interfaces name=ens19
+        ip 192.168.2.8
+        ip6 2001:db8::1
+
+openfabric_node: uwu_pve1
+        interfaces name=ens19
+        interfaces name=ens20
+        ip 192.168.2.9
+        ip6 2001:db8::2
+
+openfabric_node: uwu_pve2
+        interfaces name=ens19
+        interfaces name=ens20
+        ip 192.168.2.10
+        ip6 2001:db8::3
diff --git a/proxmox-ve-config/tests/fabric/cfg/openfabric_ipv6_only/fabrics.cfg b/proxmox-ve-config/tests/fabric/cfg/openfabric_ipv6_only/fabrics.cfg
new file mode 100644
index 000000000000..286a5a31c861
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/cfg/openfabric_ipv6_only/fabrics.cfg
@@ -0,0 +1,18 @@
+openfabric_fabric: uwu
+        hello_interval 4
+        ip6_prefix a:b::0/75
+
+openfabric_node: uwu_pve
+        interfaces name=ens20,hello_multiplier=50
+        interfaces name=ens19
+        ip6 a:b::a
+
+openfabric_node: uwu_pve1
+        interfaces name=ens19
+        interfaces name=ens20
+        ip6 a:b::b
+
+openfabric_node: uwu_pve2
+        interfaces name=ens19
+        interfaces name=ens20
+        ip6 a:b::c
diff --git a/proxmox-ve-config/tests/fabric/cfg/openfabric_loopback/fabrics.cfg b/proxmox-ve-config/tests/fabric/cfg/openfabric_loopback/fabrics.cfg
new file mode 100644
index 000000000000..ea93eb7dad9c
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/cfg/openfabric_loopback/fabrics.cfg
@@ -0,0 +1,18 @@
+openfabric_fabric: test
+        hello_interval 4
+        ip_prefix 192.168.2.0/28
+
+openfabric_node: test_pve
+        interfaces name=ens20,hello_multiplier=50
+        interfaces name=ens19
+        ip 192.168.2.8
+
+openfabric_node: test_pve1
+        interfaces name=ens19
+        interfaces name=ens20
+        ip 192.168.2.20
+
+openfabric_node: test_pve2
+        interfaces name=ens19
+        interfaces name=ens20
+        ip 192.168.2.10
diff --git a/proxmox-ve-config/tests/fabric/cfg/openfabric_loopback_prefix_fail/fabrics.cfg b/proxmox-ve-config/tests/fabric/cfg/openfabric_loopback_prefix_fail/fabrics.cfg
new file mode 100644
index 000000000000..46acd1d4d45c
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/cfg/openfabric_loopback_prefix_fail/fabrics.cfg
@@ -0,0 +1,25 @@
+openfabric_fabric: test
+        hello_interval 4
+        ip_prefix 192.168.2.0/28
+
+openfabric_node: test_pve
+        fabric_id test
+        interfaces name=ens20,hello_multiplier=50
+        interfaces name=ens19
+        node_id pve
+        ip 192.168.2.8
+
+openfabric_node: test_pve1
+        fabric_id test
+        interfaces name=ens19
+        interfaces name=ens20
+        node_id pve1
+        ip 192.168.2.20
+
+openfabric_node: test_pve2
+        fabric_id test
+        interfaces name=ens19
+        interfaces name=ens20
+        node_id pve2
+        ip 192.168.2.10
+
diff --git a/proxmox-ve-config/tests/fabric/cfg/openfabric_multi_fabric/fabrics.cfg b/proxmox-ve-config/tests/fabric/cfg/openfabric_multi_fabric/fabrics.cfg
new file mode 100644
index 000000000000..dcfdfa7780f7
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/cfg/openfabric_multi_fabric/fabrics.cfg
@@ -0,0 +1,25 @@
+openfabric_fabric: test1
+        hello_interval 4
+        ip_prefix 192.168.2.0/24
+
+openfabric_fabric: test2
+        hello_interval 4
+        ip_prefix 192.168.1.0/24
+
+openfabric_node: test1_pve
+        interfaces name=ens20,hello_multiplier=50
+        interfaces name=ens19,
+        ip 192.168.2.8
+
+openfabric_node: test1_pve1
+        interfaces name=ens19
+        ip 192.168.2.9
+
+openfabric_node: test2_pve
+        interfaces name=ens22,hello_multiplier=50
+        interfaces name=ens21
+        ip 192.168.1.8
+
+openfabric_node: test2_pve1
+        interfaces name=ens21
+        ip 192.168.1.9
diff --git a/proxmox-ve-config/tests/fabric/cfg/openfabric_same_net_on_same_node/fabrics.cfg b/proxmox-ve-config/tests/fabric/cfg/openfabric_same_net_on_same_node/fabrics.cfg
new file mode 100644
index 000000000000..dcfdfa7780f7
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/cfg/openfabric_same_net_on_same_node/fabrics.cfg
@@ -0,0 +1,25 @@
+openfabric_fabric: test1
+        hello_interval 4
+        ip_prefix 192.168.2.0/24
+
+openfabric_fabric: test2
+        hello_interval 4
+        ip_prefix 192.168.1.0/24
+
+openfabric_node: test1_pve
+        interfaces name=ens20,hello_multiplier=50
+        interfaces name=ens19,
+        ip 192.168.2.8
+
+openfabric_node: test1_pve1
+        interfaces name=ens19
+        ip 192.168.2.9
+
+openfabric_node: test2_pve
+        interfaces name=ens22,hello_multiplier=50
+        interfaces name=ens21
+        ip 192.168.1.8
+
+openfabric_node: test2_pve1
+        interfaces name=ens21
+        ip 192.168.1.9
diff --git a/proxmox-ve-config/tests/fabric/cfg/openfabric_verification_fail/fabrics.cfg b/proxmox-ve-config/tests/fabric/cfg/openfabric_verification_fail/fabrics.cfg
new file mode 100644
index 000000000000..5f26a9c18438
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/cfg/openfabric_verification_fail/fabrics.cfg
@@ -0,0 +1,12 @@
+openfabric_fabric: uwu
+        ip_prefix 192.168.2.0/24
+
+openfabric_node: uwu1_pve
+        interfaces name=ens20,hello_multiplier=50
+        interfaces name=ens19
+        ip 192.168.2.8
+
+openfabric_node: uwu_pve1
+        interfaces name=ens19
+        interfaces name=ens20
+        ip 192.168.2.9
diff --git a/proxmox-ve-config/tests/fabric/cfg/ospf_default/fabrics.cfg b/proxmox-ve-config/tests/fabric/cfg/ospf_default/fabrics.cfg
new file mode 100644
index 000000000000..8f2d0547bee6
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/cfg/ospf_default/fabrics.cfg
@@ -0,0 +1,13 @@
+ospf_fabric: test
+        area 0
+        ip_prefix 10.10.10.10/24
+
+ospf_node: test_pve
+        interfaces name=ens18,ip=4.4.4.4/24
+        interfaces name=ens19
+        ip 10.10.10.1
+
+ospf_node: test_pve1
+        interfaces name=ens19
+        ip 10.10.10.2
+
diff --git a/proxmox-ve-config/tests/fabric/cfg/ospf_loopback_prefix_fail/fabrics.cfg b/proxmox-ve-config/tests/fabric/cfg/ospf_loopback_prefix_fail/fabrics.cfg
new file mode 100644
index 000000000000..8e3b8ba10d39
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/cfg/ospf_loopback_prefix_fail/fabrics.cfg
@@ -0,0 +1,17 @@
+ospf_fabric: test
+        ip_prefix 192.168.2.0/16
+
+ospf_node: test_pve
+        interfaces name=ens20
+        interfaces name=ens19
+        ip 192.168.2.8
+
+ospf_node: test_pve1
+        interfaces name=ens19
+        interfaces name=ens20
+        ip 192.168.3.20
+
+ospf_node: test_pve2
+        interfaces name=ens19,ip=3.3.3.2/31
+        interfaces name=ens20,ip=3.3.3.4/31
+        ip 192.169.2.10
diff --git a/proxmox-ve-config/tests/fabric/cfg/ospf_multi_fabric/fabrics.cfg b/proxmox-ve-config/tests/fabric/cfg/ospf_multi_fabric/fabrics.cfg
new file mode 100644
index 000000000000..36dd573f72e0
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/cfg/ospf_multi_fabric/fabrics.cfg
@@ -0,0 +1,25 @@
+ospf_fabric: test
+        area 0
+        ip_prefix 192.168.2.0/24
+
+ospf_fabric: ceph
+        area 1
+        ip_prefix 192.168.1.0/24
+
+ospf_node: test_pve
+        interfaces name=ens20,
+        interfaces name=ens19,ip=3.3.3.4/31
+        ip 192.168.2.8
+
+ospf_node: test_pve1
+        interfaces name=ens19
+        ip 192.168.2.9
+
+ospf_node: ceph_pve
+        interfaces name=ens22
+        interfaces name=ens21
+        ip 192.168.1.8
+
+ospf_node: ceph_pve1
+        interfaces name=ens21
+        ip 192.168.1.9
diff --git a/proxmox-ve-config/tests/fabric/cfg/ospf_verification_fail/fabrics.cfg b/proxmox-ve-config/tests/fabric/cfg/ospf_verification_fail/fabrics.cfg
new file mode 100644
index 000000000000..d1a45094fbc2
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/cfg/ospf_verification_fail/fabrics.cfg
@@ -0,0 +1,13 @@
+ospf_fabric: test
+        area 0
+        ip_prefix 10.10.10.0/24
+
+ospf_node: test_pve
+        interfaces name=dummy0
+        interfaces name=ens18
+        ip 10.10.10.1
+
+ospf_node: test1_pve1
+        interfaces name=dummy0
+        interfaces name=ens19
+        ip 10.10.10.2
diff --git a/proxmox-ve-config/tests/fabric/helper.rs b/proxmox-ve-config/tests/fabric/helper.rs
new file mode 100644
index 000000000000..93404b8eb7af
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/helper.rs
@@ -0,0 +1,43 @@
+#[allow(unused_macros)]
+macro_rules! get_fabrics_config {
+    () => {{
+        // Get current function name
+        fn f() {}
+        fn type_name_of<T>(_: T) -> &'static str {
+            std::any::type_name::<T>()
+        }
+        let mut name = type_name_of(f);
+
+        // Find and cut the rest of the path
+        name = match &name[..name.len() - 3].rfind(':') {
+            Some(pos) => &name[pos + 1..name.len() - 3],
+            None => &name[..name.len() - 3],
+        };
+        let real_filename = format!("tests/fabric/cfg/{name}/fabrics.cfg");
+        &std::fs::read_to_string(real_filename).expect("cannot find config file")
+    }};
+}
+
+#[allow(unused_macros)]
+macro_rules! reference_name {
+    ($suffix:expr) => {{
+        // Get current function name
+        fn f() {}
+        fn type_name_of<T>(_: T) -> &'static str {
+            std::any::type_name::<T>()
+        }
+        let mut name = type_name_of(f);
+
+        // Find and cut the rest of the path
+        name = match &name[..name.len() - 3].rfind(':') {
+            Some(pos) => &name[pos + 1..name.len() - 3],
+            None => &name[..name.len() - 3],
+        };
+        format!("{name}_{}", $suffix)
+    }};
+}
+
+#[allow(unused_imports)]
+pub(crate) use get_fabrics_config;
+#[allow(unused_imports)]
+pub(crate) use reference_name;
diff --git a/proxmox-ve-config/tests/fabric/main.rs b/proxmox-ve-config/tests/fabric/main.rs
new file mode 100644
index 000000000000..47bbbeb77886
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/main.rs
@@ -0,0 +1,141 @@
+#![cfg(feature = "frr")]
+use proxmox_frr::serializer::dump;
+use proxmox_ve_config::sdn::{
+    fabric::{section_config::node::NodeId, FabricConfig},
+    frr::FrrConfigBuilder,
+};
+
+mod helper;
+
+/*
+ * Use the macros `helper::get_section_config!()` to get the section config as a string. This uses
+ * the function name and checks for "/resources/cfg/{function-name}/fabrics.cfg" files.
+ * With the `helper::reference_name!("<hostname>")` macro you can get the snapshot file of the
+ * function for this specific hostname.
+ */
+
+#[test]
+fn openfabric_default() {
+    let config = FabricConfig::parse_section_config(helper::get_fabrics_config!()).unwrap();
+
+    let mut frr_config = FrrConfigBuilder::default()
+        .add_fabrics(config.clone())
+        .build(NodeId::from_string("pve".to_owned()).expect("invalid nodeid"))
+        .expect("error building frr config");
+
+    let mut output = dump(&frr_config).expect("error dumping stuff");
+
+    insta::assert_snapshot!(helper::reference_name!("pve"), output);
+
+    frr_config = FrrConfigBuilder::default()
+        .add_fabrics(config.clone())
+        .build(NodeId::from_string("pve1".to_owned()).expect("invalid nodeid"))
+        .expect("error building frr config");
+
+    output = dump(&frr_config).expect("error dumping stuff");
+
+    insta::assert_snapshot!(helper::reference_name!("pve1"), output);
+}
+
+#[test]
+fn ospf_default() {
+    let config = FabricConfig::parse_section_config(helper::get_fabrics_config!()).unwrap();
+
+    let mut frr_config = FrrConfigBuilder::default()
+        .add_fabrics(config.clone())
+        .build(NodeId::from_string("pve".to_owned()).expect("invalid nodeid"))
+        .expect("error building frr config");
+
+    let mut output = dump(&frr_config).expect("error dumping stuff");
+
+    insta::assert_snapshot!(helper::reference_name!("pve"), output);
+
+    frr_config = FrrConfigBuilder::default()
+        .add_fabrics(config)
+        .build(NodeId::from_string("pve1".to_owned()).expect("invalid nodeid"))
+        .expect("error building frr config");
+
+    output = dump(&frr_config).expect("error dumping stuff");
+
+    insta::assert_snapshot!(helper::reference_name!("pve1"), output);
+}
+
+#[test]
+fn openfabric_verification_fail() {
+    let result = FabricConfig::parse_section_config(helper::get_fabrics_config!());
+    assert!(result.is_err());
+}
+
+#[test]
+fn ospf_verification_fail() {
+    let result = FabricConfig::parse_section_config(helper::get_fabrics_config!());
+    assert!(result.is_err());
+}
+
+#[test]
+fn openfabric_loopback_prefix_fail() {
+    let result = FabricConfig::parse_section_config(helper::get_fabrics_config!());
+    assert!(result.is_err());
+}
+
+#[test]
+fn ospf_loopback_prefix_fail() {
+    let result = FabricConfig::parse_section_config(helper::get_fabrics_config!());
+    assert!(result.is_err());
+}
+
+#[test]
+fn openfabric_multi_fabric() {
+    let config = FabricConfig::parse_section_config(helper::get_fabrics_config!()).unwrap();
+
+    let frr_config = FrrConfigBuilder::default()
+        .add_fabrics(config)
+        .build(NodeId::from_string("pve1".to_owned()).expect("invalid nodeid"))
+        .expect("error building frr config");
+
+    let output = dump(&frr_config).expect("error dumping stuff");
+
+    insta::assert_snapshot!(helper::reference_name!("pve1"), output);
+}
+
+#[test]
+fn ospf_multi_fabric() {
+    let config = FabricConfig::parse_section_config(helper::get_fabrics_config!()).unwrap();
+
+    let frr_config = FrrConfigBuilder::default()
+        .add_fabrics(config)
+        .build(NodeId::from_string("pve1".to_owned()).expect("invalid nodeid"))
+        .expect("error building frr config");
+
+    let output = dump(&frr_config).expect("error dumping stuff");
+
+    insta::assert_snapshot!(helper::reference_name!("pve1"), output);
+}
+
+#[test]
+fn openfabric_dualstack() {
+    let config = FabricConfig::parse_section_config(helper::get_fabrics_config!()).unwrap();
+
+    let frr_config = FrrConfigBuilder::default()
+        .add_fabrics(config)
+        .build(NodeId::from_string("pve".to_owned()).expect("invalid nodeid"))
+        .expect("error building frr config");
+
+    let output = dump(&frr_config).expect("error dumping stuff");
+
+    insta::assert_snapshot!(helper::reference_name!("pve"), output);
+}
+
+#[test]
+fn openfabric_ipv6_only() {
+    let config = FabricConfig::parse_section_config(helper::get_fabrics_config!()).unwrap();
+
+    let frr_config = FrrConfigBuilder::default()
+        .add_fabrics(config)
+        .build(NodeId::from_string("pve".to_owned()).expect("invalid nodeid"))
+        .expect("error building frr config");
+
+    let output = dump(&frr_config).expect("error dumping stuff");
+
+    insta::assert_snapshot!(helper::reference_name!("pve"), output);
+}
diff --git a/proxmox-ve-config/tests/fabric/snapshots/fabric__openfabric_default_pve.snap b/proxmox-ve-config/tests/fabric/snapshots/fabric__openfabric_default_pve.snap
new file mode 100644
index 000000000000..98eb50415e36
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/snapshots/fabric__openfabric_default_pve.snap
@@ -0,0 +1,34 @@
+---
+source: proxmox-ve-config/tests/fabric/main.rs
+expression: output
+snapshot_kind: text
+---
+router openfabric uwu
+ net 49.0001.1921.6800.2008.00
+exit
+!
+interface dummy_uwu
+ ip router openfabric uwu
+ openfabric passive
+exit
+!
+interface ens19
+ ip router openfabric uwu
+ openfabric hello-interval 4
+exit
+!
+interface ens20
+ ip router openfabric uwu
+ openfabric hello-interval 4
+ openfabric hello-multiplier 50
+exit
+!
+access-list pve_openfabric_uwu_ips permit 192.168.2.0/24
+!
+route-map pve_openfabric permit 100
+ match ip address pve_openfabric_uwu_ips
+ set src 192.168.2.8
+exit
+!
+ip protocol openfabric route-map pve_openfabric
+!
diff --git a/proxmox-ve-config/tests/fabric/snapshots/fabric__openfabric_default_pve1.snap b/proxmox-ve-config/tests/fabric/snapshots/fabric__openfabric_default_pve1.snap
new file mode 100644
index 000000000000..4453ac49377f
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/snapshots/fabric__openfabric_default_pve1.snap
@@ -0,0 +1,33 @@
+---
+source: proxmox-ve-config/tests/fabric/main.rs
+expression: output
+snapshot_kind: text
+---
+router openfabric uwu
+ net 49.0001.1921.6800.2009.00
+exit
+!
+interface dummy_uwu
+ ip router openfabric uwu
+ openfabric passive
+exit
+!
+interface ens19
+ ip router openfabric uwu
+ openfabric hello-interval 4
+exit
+!
+interface ens20
+ ip router openfabric uwu
+ openfabric hello-interval 4
+exit
+!
+access-list pve_openfabric_uwu_ips permit 192.168.2.0/24
+!
+route-map pve_openfabric permit 100
+ match ip address pve_openfabric_uwu_ips
+ set src 192.168.2.9
+exit
+!
+ip protocol openfabric route-map pve_openfabric
+!
diff --git a/proxmox-ve-config/tests/fabric/snapshots/fabric__openfabric_dualstack_pve.snap b/proxmox-ve-config/tests/fabric/snapshots/fabric__openfabric_dualstack_pve.snap
new file mode 100644
index 000000000000..48ac9092045e
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/snapshots/fabric__openfabric_dualstack_pve.snap
@@ -0,0 +1,46 @@
+---
+source: proxmox-ve-config/tests/fabric/main.rs
+expression: output
+snapshot_kind: text
+---
+router openfabric uwu
+ net 49.0001.1921.6800.2008.00
+exit
+!
+interface dummy_uwu
+ ipv6 router openfabric uwu
+ ip router openfabric uwu
+ openfabric passive
+exit
+!
+interface ens19
+ ipv6 router openfabric uwu
+ ip router openfabric uwu
+ openfabric hello-interval 4
+exit
+!
+interface ens20
+ ipv6 router openfabric uwu
+ ip router openfabric uwu
+ openfabric hello-interval 4
+ openfabric hello-multiplier 50
+exit
+!
+access-list pve_openfabric_uwu_ips permit 192.168.2.0/24
+!
+ipv6 access-list pve_openfabric_uwu_ip6s permit 2001:db8::/64
+!
+route-map pve_openfabric permit 100
+ match ip address pve_openfabric_uwu_ips
+ set src 192.168.2.8
+exit
+!
+route-map pve_openfabric6 permit 110
+ match ipv6 address pve_openfabric_uwu_ip6s
+ set src 2001:db8::1
+exit
+!
+ip protocol openfabric route-map pve_openfabric
+!
+ipv6 protocol openfabric route-map pve_openfabric6
+!
diff --git a/proxmox-ve-config/tests/fabric/snapshots/fabric__openfabric_ipv6_only_pve.snap b/proxmox-ve-config/tests/fabric/snapshots/fabric__openfabric_ipv6_only_pve.snap
new file mode 100644
index 000000000000..d7ab1d7e2a61
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/snapshots/fabric__openfabric_ipv6_only_pve.snap
@@ -0,0 +1,34 @@
+---
+source: proxmox-ve-config/tests/fabric/main.rs
+expression: output
+snapshot_kind: text
+---
+router openfabric uwu
+ net 49.0001.0000.0000.000a.00
+exit
+!
+interface dummy_uwu
+ ipv6 router openfabric uwu
+ openfabric passive
+exit
+!
+interface ens19
+ ipv6 router openfabric uwu
+ openfabric hello-interval 4
+exit
+!
+interface ens20
+ ipv6 router openfabric uwu
+ openfabric hello-interval 4
+ openfabric hello-multiplier 50
+exit
+!
+ipv6 access-list pve_openfabric_uwu_ip6s permit a:b::/75
+!
+route-map pve_openfabric6 permit 100
+ match ipv6 address pve_openfabric_uwu_ip6s
+ set src a:b::a
+exit
+!
+ipv6 protocol openfabric route-map pve_openfabric6
+!
diff --git a/proxmox-ve-config/tests/fabric/snapshots/fabric__openfabric_multi_fabric_pve1.snap b/proxmox-ve-config/tests/fabric/snapshots/fabric__openfabric_multi_fabric_pve1.snap
new file mode 100644
index 000000000000..ad6c6db8eb8b
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/snapshots/fabric__openfabric_multi_fabric_pve1.snap
@@ -0,0 +1,49 @@
+---
+source: proxmox-ve-config/tests/fabric/main.rs
+expression: output
+snapshot_kind: text
+---
+router openfabric test1
+ net 49.0001.1921.6800.2009.00
+exit
+!
+router openfabric test2
+ net 49.0001.1921.6800.2009.00
+exit
+!
+interface dummy_test1
+ ip router openfabric test1
+ openfabric passive
+exit
+!
+interface dummy_test2
+ ip router openfabric test2
+ openfabric passive
+exit
+!
+interface ens19
+ ip router openfabric test1
+ openfabric hello-interval 4
+exit
+!
+interface ens21
+ ip router openfabric test2
+ openfabric hello-interval 4
+exit
+!
+access-list pve_openfabric_test1_ips permit 192.168.2.0/24
+!
+access-list pve_openfabric_test2_ips permit 192.168.1.0/24
+!
+route-map pve_openfabric permit 100
+ match ip address pve_openfabric_test1_ips
+ set src 192.168.2.9
+exit
+!
+route-map pve_openfabric permit 110
+ match ip address pve_openfabric_test2_ips
+ set src 192.168.1.9
+exit
+!
+ip protocol openfabric route-map pve_openfabric
+!
diff --git a/proxmox-ve-config/tests/fabric/snapshots/fabric__ospf_default_pve.snap b/proxmox-ve-config/tests/fabric/snapshots/fabric__ospf_default_pve.snap
new file mode 100644
index 000000000000..a303f31f3d1a
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/snapshots/fabric__ospf_default_pve.snap
@@ -0,0 +1,32 @@
+---
+source: proxmox-ve-config/tests/fabric/main.rs
+expression: output
+snapshot_kind: text
+---
+router ospf
+ ospf router-id 10.10.10.1
+exit
+!
+interface dummy_test
+ ip ospf area 0
+ ip ospf passive
+exit
+!
+interface ens18
+ ip ospf area 0
+exit
+!
+interface ens19
+ ip ospf area 0
+ ip ospf network point-to-point
+exit
+!
+access-list pve_ospf_test_ips permit 10.10.10.10/24
+!
+route-map pve_ospf permit 100
+ match ip address pve_ospf_test_ips
+ set src 10.10.10.1
+exit
+!
+ip protocol ospf route-map pve_ospf
+!
diff --git a/proxmox-ve-config/tests/fabric/snapshots/fabric__ospf_default_pve1.snap b/proxmox-ve-config/tests/fabric/snapshots/fabric__ospf_default_pve1.snap
new file mode 100644
index 000000000000..46c30b22abdf
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/snapshots/fabric__ospf_default_pve1.snap
@@ -0,0 +1,28 @@
+---
+source: proxmox-ve-config/tests/fabric/main.rs
+expression: output
+snapshot_kind: text
+---
+router ospf
+ ospf router-id 10.10.10.2
+exit
+!
+interface dummy_test
+ ip ospf area 0
+ ip ospf passive
+exit
+!
+interface ens19
+ ip ospf area 0
+ ip ospf network point-to-point
+exit
+!
+access-list pve_ospf_test_ips permit 10.10.10.10/24
+!
+route-map pve_ospf permit 100
+ match ip address pve_ospf_test_ips
+ set src 10.10.10.2
+exit
+!
+ip protocol ospf route-map pve_ospf
+!
diff --git a/proxmox-ve-config/tests/fabric/snapshots/fabric__ospf_multi_fabric_pve1.snap b/proxmox-ve-config/tests/fabric/snapshots/fabric__ospf_multi_fabric_pve1.snap
new file mode 100644
index 000000000000..1d2a7c3c272d
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/snapshots/fabric__ospf_multi_fabric_pve1.snap
@@ -0,0 +1,45 @@
+---
+source: proxmox-ve-config/tests/fabric/main.rs
+expression: output
+snapshot_kind: text
+---
+router ospf
+ ospf router-id 192.168.1.9
+exit
+!
+interface dummy_ceph
+ ip ospf area 1
+ ip ospf passive
+exit
+!
+interface dummy_test
+ ip ospf area 0
+ ip ospf passive
+exit
+!
+interface ens19
+ ip ospf area 0
+ ip ospf network point-to-point
+exit
+!
+interface ens21
+ ip ospf area 1
+ ip ospf network point-to-point
+exit
+!
+access-list pve_ospf_ceph_ips permit 192.168.1.0/24
+!
+access-list pve_ospf_test_ips permit 192.168.2.0/24
+!
+route-map pve_ospf permit 100
+ match ip address pve_ospf_ceph_ips
+ set src 192.168.1.9
+exit
+!
+route-map pve_ospf permit 110
+ match ip address pve_ospf_test_ips
+ set src 192.168.2.9
+exit
+!
+ip protocol ospf route-map pve_ospf
+!
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  parent reply	other threads:[~2025-07-16 13:14 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-16 13:07 [pve-devel] [PATCH access-control/cluster/docs/gui-tests/manager/network/proxmox{, -firewall, -ve-rs, -perl-rs, -widget-toolkit} v5 00/76] Add SDN Fabrics Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH proxmox v5 1/4] network-types: initial commit Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH proxmox v5 2/4] network-types: make cidr and mac-address types usable by the api Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH proxmox v5 3/4] network-types: add api types for ipv4/6 Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH proxmox v5 4/4] network-types: add CIDR overlap detection for IPv4 and IPv6 Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH proxmox-firewall v5 1/1] firewall: nftables: migrate to proxmox-network-types Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH proxmox-ve-rs v5 01/22] ve-config: move types " Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH proxmox-ve-rs v5 02/22] sdn-types: initial commit Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH proxmox-ve-rs v5 03/22] frr: create proxmox-frr crate Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH proxmox-ve-rs v5 04/22] frr: add common frr types Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH proxmox-ve-rs v5 05/22] frr: add openfabric types Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH proxmox-ve-rs v5 06/22] frr: add ospf types Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH proxmox-ve-rs v5 07/22] frr: add route-map types Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH proxmox-ve-rs v5 08/22] frr: add generic types over openfabric and ospf Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH proxmox-ve-rs v5 09/22] frr: add serializer for all FRR types Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH proxmox-ve-rs v5 10/22] config: sdn: fabrics: add section types Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH proxmox-ve-rs v5 11/22] config: sdn: fabrics: add node " Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH proxmox-ve-rs v5 12/22] config: sdn: fabrics: add interface name struct Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH proxmox-ve-rs v5 13/22] config: sdn: fabrics: add openfabric properties Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH proxmox-ve-rs v5 14/22] config: sdn: fabrics: add ospf properties Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH proxmox-ve-rs v5 15/22] config: sdn: fabrics: add api types Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH proxmox-ve-rs v5 16/22] config: sdn: fabrics: add section config Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH proxmox-ve-rs v5 17/22] config: sdn: fabrics: add fabric config Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH proxmox-ve-rs v5 18/22] common: sdn: fabrics: implement validation Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH proxmox-ve-rs v5 19/22] sdn: fabrics: config: add conversion from / to section config Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH proxmox-ve-rs v5 20/22] sdn: fabrics: implement FRR configuration generation Gabriel Goller
2025-07-16 13:07 ` Gabriel Goller [this message]
2025-07-16 13:07 ` [pve-devel] [PATCH proxmox-ve-rs v5 22/22] ve-config: remove serde_plain and serde_with Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH proxmox-perl-rs v5 1/5] pve-rs: Add PVE::RS::SDN::Fabrics module Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH proxmox-perl-rs v5 2/5] pve-rs: sdn: fabrics: add api methods Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH proxmox-perl-rs v5 3/5] pve-rs: sdn: fabrics: add frr config generation Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH proxmox-perl-rs v5 4/5] pve-rs: sdn: fabrics: add helper to generate ifupdown2 configuration Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH proxmox-perl-rs v5 5/5] pve-rs: sdn: fabrics: add helper for network API endpoint Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH pve-cluster v5 1/1] cfs: add fabrics.cfg to observed files Gabriel Goller
2025-07-16 14:02   ` [pve-devel] applied: " Thomas Lamprecht
2025-07-16 14:41   ` [pve-devel] " Thomas Lamprecht
2025-07-16 13:07 ` [pve-devel] [PATCH pve-access-control v5 1/1] permissions: add ACL paths for SDN fabrics Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH pve-network v5 01/21] sdn: fix value returned by pending_config Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH pve-network v5 02/21] debian: add dependency to proxmox-perl-rs Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH pve-network v5 03/21] fabrics: add fabrics module Gabriel Goller
2025-07-16 13:07 ` [pve-devel] [PATCH pve-network v5 04/21] refactor: controller: move frr methods into helper Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-network v5 05/21] frr: add new helpers for reloading frr configuration Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-network v5 06/21] controllers: define new api for frr config generation Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-network v5 07/21] sdn: add frr config generation helpers Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-network v5 08/21] sdn: api: add check for rewriting frr configuration Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-network v5 09/21] test: isis: add test for standalone configuration Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-network v5 10/21] sdn: frr: add daemon status to frr helper Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-network v5 11/21] sdn: commit fabrics config to running configuration Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-network v5 12/21] fabrics: generate ifupdown configuration Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-network v5 13/21] fabrics: add jsonschema for fabrics and nodes Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-network v5 14/21] api: fabrics: add root-level module Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-network v5 15/21] api: fabrics: add fabric submodule Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-network v5 16/21] api: fabrics: add node submodule Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-network v5 17/21] api: fabrics: add fabricnode submodule Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-network v5 18/21] controller: evpn: add fabrics integration Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-network v5 19/21] zone: vxlan: " Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-network v5 20/21] test: fabrics: add test cases for ospf and openfabric + evpn Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-network v5 21/21] frr: bump frr config version to 10.3.1 Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH proxmox-widget-toolkit v5 1/1] network selector: add type parameter Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-manager v5 01/18] api: use new sdn config generation functions Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-manager v5 02/18] ui: fabrics: add model definitions for fabrics Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-manager v5 03/18] fabric: add common interface panel Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-manager v5 04/18] fabric: add OpenFabric interface properties Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-manager v5 05/18] fabric: add OSPF " Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-manager v5 06/18] fabric: add generic node edit panel Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-manager v5 07/18] fabric: add OpenFabric node edit Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-manager v5 08/18] fabric: add OSPF " Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-manager v5 09/18] fabric: add generic fabric edit panel Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-manager v5 10/18] fabric: add OpenFabric " Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-manager v5 11/18] fabric: add OSPF " Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-manager v5 12/18] fabrics: Add main FabricView Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-manager v5 13/18] utils: avoid line-break in pending changes message Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-manager v5 14/18] ui: permissions: add ACL path for fabrics Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-manager v5 15/18] api: network: add include_sdn / fabric type Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-manager v5 16/18] ui: add sdn networks to ceph / migration Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-manager v5 17/18] ui: sdn: add evpn controller fabric integration Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-manager v5 18/18] ui: sdn: vxlan: add fabric property Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-gui-tests v5 1/1] pve: add sdn/fabrics screenshots Gabriel Goller
2025-07-16 13:08 ` [pve-devel] [PATCH pve-docs v5 1/1] fabrics: add initial documentation for sdn fabrics Gabriel Goller
2025-07-18  7:37   ` Gabriel Goller
2025-07-18  7:51     ` Thomas Lamprecht
2025-07-18  8:09       ` Gabriel Goller
2025-07-17  0:10 ` [pve-devel] applied-series: [PATCH access-control/cluster/docs/gui-tests/manager/network/proxmox{, -firewall, -ve-rs, -perl-rs, -widget-toolkit} v5 00/76] Add SDN Fabrics Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250716130837.585796-27-g.goller@proxmox.com \
    --to=g.goller@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal