From: Gabriel Goller <g.goller@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH proxmox-ve-rs v2 15/15] ve-config: add integrations tests
Date: Fri, 4 Apr 2025 18:28:27 +0200 [thread overview]
Message-ID: <20250404162908.563060-17-g.goller@proxmox.com> (raw)
In-Reply-To: <20250404162908.563060-1-g.goller@proxmox.com>
Add integration tests for the full cycle from section-config to FRR
config file for both openfabric and ospf.
Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
---
proxmox-ve-config/Cargo.toml | 3 +
proxmox-ve-config/debian/control | 2 +
.../tests/fabric/cfg/openfabric_default.cfg | 24 ++++
.../cfg/openfabric_loopback_prefix_fail.cfg | 24 ++++
.../fabric/cfg/openfabric_multi_fabric.cfg | 33 +++++
.../cfg/openfabric_verification_fail.cfg | 16 +++
.../tests/fabric/cfg/ospf_default.cfg | 16 +++
...f_interface_properties_validation_fail.cfg | 10 ++
.../fabric/cfg/ospf_loopback_prefix_fail.cfg | 23 +++
.../tests/fabric/cfg/ospf_multi_fabric.cfg | 33 +++++
.../fabric/cfg/ospf_verification_fail.cfg | 17 +++
proxmox-ve-config/tests/fabric/helper.rs | 43 ++++++
proxmox-ve-config/tests/fabric/main.rs | 132 ++++++++++++++++++
.../fabric__openfabric_default_pve.snap | 36 +++++
.../fabric__openfabric_default_pve1.snap | 32 +++++
.../fabric__openfabric_multi_fabric_pve1.snap | 48 +++++++
.../snapshots/fabric__ospf_default_pve.snap | 31 ++++
.../snapshots/fabric__ospf_default_pve1.snap | 27 ++++
.../fabric__ospf_multi_fabric_pve1.snap | 48 +++++++
19 files changed, 598 insertions(+)
create mode 100644 proxmox-ve-config/tests/fabric/cfg/openfabric_default.cfg
create mode 100644 proxmox-ve-config/tests/fabric/cfg/openfabric_loopback_prefix_fail.cfg
create mode 100644 proxmox-ve-config/tests/fabric/cfg/openfabric_multi_fabric.cfg
create mode 100644 proxmox-ve-config/tests/fabric/cfg/openfabric_verification_fail.cfg
create mode 100644 proxmox-ve-config/tests/fabric/cfg/ospf_default.cfg
create mode 100644 proxmox-ve-config/tests/fabric/cfg/ospf_interface_properties_validation_fail.cfg
create mode 100644 proxmox-ve-config/tests/fabric/cfg/ospf_loopback_prefix_fail.cfg
create mode 100644 proxmox-ve-config/tests/fabric/cfg/ospf_multi_fabric.cfg
create mode 100644 proxmox-ve-config/tests/fabric/cfg/ospf_verification_fail.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_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 70c25312ac6d..74d32df49d9d 100644
--- a/proxmox-ve-config/Cargo.toml
+++ b/proxmox-ve-config/Cargo.toml
@@ -29,3 +29,6 @@ proxmox-sortable-macro = "0.1.3"
[features]
frr = ["dep:proxmox-frr" ]
+
+[dev-dependencies]
+insta = "1.21"
diff --git a/proxmox-ve-config/debian/control b/proxmox-ve-config/debian/control
index d0940b2c8ac5..d251fda43367 100644
--- a/proxmox-ve-config/debian/control
+++ b/proxmox-ve-config/debian/control
@@ -7,6 +7,7 @@ Build-Depends-Arch: cargo:native <!nocheck>,
rustc:native <!nocheck>,
libstd-rust-dev <!nocheck>,
librust-anyhow-1+default-dev <!nocheck>,
+ librust-insta-1+json-dev (>= 1.21-~~),
librust-log-0.4+default-dev <!nocheck>,
librust-nix-0.26+default-dev <!nocheck>,
librust-proxmox-network-types-0.1+default-dev <!nocheck>,
@@ -37,6 +38,7 @@ Multi-Arch: same
Depends:
${misc:Depends},
librust-anyhow-1+default-dev,
+ librust-insta-1+json-dev (>= 1.21-~~),
librust-log-0.4+default-dev,
librust-nix-0.26+default-dev,
librust-proxmox-network-types-0.1+default-dev,
diff --git a/proxmox-ve-config/tests/fabric/cfg/openfabric_default.cfg b/proxmox-ve-config/tests/fabric/cfg/openfabric_default.cfg
new file mode 100644
index 000000000000..676862e3ce45
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/cfg/openfabric_default.cfg
@@ -0,0 +1,24 @@
+fabric: uwu
+ hello_interval 4
+ loopback_prefix 192.168.2.0/24
+
+node: uwu_pve
+ fabric_id uwu
+ interfaces name=ens20,passive=1,hello_interval=3,hello_multiplier=50
+ interfaces name=ens19,passive=1,csnp_interval=100
+ node_id pve
+ router_id 192.168.2.8
+
+node: uwu_pve1
+ fabric_id uwu
+ interfaces name=ens19
+ interfaces name=ens20
+ node_id pve1
+ router_id 192.168.2.9
+
+node: uwu_pve2
+ fabric_id uwu
+ interfaces name=ens19
+ interfaces name=ens20
+ node_id pve2
+ router_id 192.168.2.10
diff --git a/proxmox-ve-config/tests/fabric/cfg/openfabric_loopback_prefix_fail.cfg b/proxmox-ve-config/tests/fabric/cfg/openfabric_loopback_prefix_fail.cfg
new file mode 100644
index 000000000000..e795c1524f9b
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/cfg/openfabric_loopback_prefix_fail.cfg
@@ -0,0 +1,24 @@
+fabric: test
+ hello_interval 4
+ loopback_prefix 192.168.2.0/28
+
+node: test_pve
+ fabric_id test
+ interfaces name=ens20,passive=1,hello_interval=3,hello_multiplier=50
+ interfaces name=ens19,passive=1,csnp_interval=100
+ node_id pve
+ router_id 192.168.2.8
+
+node: test_pve1
+ fabric_id test
+ interfaces name=ens19
+ interfaces name=ens20
+ node_id pve1
+ router_id 192.168.2.20
+
+node: test_pve2
+ fabric_id test
+ interfaces name=ens19
+ interfaces name=ens20
+ node_id pve2
+ router_id 192.168.2.10
diff --git a/proxmox-ve-config/tests/fabric/cfg/openfabric_multi_fabric.cfg b/proxmox-ve-config/tests/fabric/cfg/openfabric_multi_fabric.cfg
new file mode 100644
index 000000000000..0c39505f44e5
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/cfg/openfabric_multi_fabric.cfg
@@ -0,0 +1,33 @@
+fabric: test1
+ hello_interval 4
+ loopback_prefix 192.168.2.0/24
+
+node: test1_pve
+ fabric_id test1
+ interfaces name=ens20,passive=1,hello_interval=3,hello_multiplier=50
+ interfaces name=ens19,passive=1,csnp_interval=100
+ node_id pve
+ router_id 192.168.2.8
+
+node: test1_pve1
+ fabric_id test1
+ interfaces name=ens19
+ node_id pve1
+ router_id 192.168.2.9
+
+fabric: test2
+ hello_interval 4
+ loopback_prefix 192.168.1.0/24
+
+node: test2_pve
+ fabric_id test2
+ interfaces name=ens20,passive=1,hello_interval=3,hello_multiplier=50
+ interfaces name=ens19,passive=1,csnp_interval=100
+ node_id pve
+ router_id 192.168.1.8
+
+node: test2_pve1
+ fabric_id test2
+ interfaces name=ens20
+ node_id pve1
+ router_id 192.168.1.9
diff --git a/proxmox-ve-config/tests/fabric/cfg/openfabric_verification_fail.cfg b/proxmox-ve-config/tests/fabric/cfg/openfabric_verification_fail.cfg
new file mode 100644
index 000000000000..00383bb24851
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/cfg/openfabric_verification_fail.cfg
@@ -0,0 +1,16 @@
+fabric: uwu
+ loopback_prefix 192.168.2.0/24
+
+node: uwu1_pve
+ fabric_id uwu1
+ interfaces name=ens20,passive=1,hello_interval=3,hello_multiplier=50
+ interfaces name=ens19,passive=1,csnp_interval=100
+ node_id pve
+ router_id 192.168.2.8
+
+node: uwu_pve1
+ fabric_id uwu
+ interfaces name=ens19
+ interfaces name=ens20
+ node_id pve1
+ router_id 192.168.2.9
diff --git a/proxmox-ve-config/tests/fabric/cfg/ospf_default.cfg b/proxmox-ve-config/tests/fabric/cfg/ospf_default.cfg
new file mode 100644
index 000000000000..d726c50a1642
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/cfg/ospf_default.cfg
@@ -0,0 +1,16 @@
+fabric: test
+ area 0
+ loopback_prefix 10.10.10.10/24
+
+node: test_pve
+ fabric_id test
+ interfaces name=ens18,passive=false,ip=4.4.4.4/24
+ interfaces name=ens19,passive=false,unnumbered=true
+ node_id pve
+ router_id 10.10.10.1
+
+node: test_pve1
+ fabric_id test
+ interfaces name=ens19,passive=false,unnumbered=true
+ node_id pve1
+ router_id 10.10.10.2
diff --git a/proxmox-ve-config/tests/fabric/cfg/ospf_interface_properties_validation_fail.cfg b/proxmox-ve-config/tests/fabric/cfg/ospf_interface_properties_validation_fail.cfg
new file mode 100644
index 000000000000..afa3f36b38e7
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/cfg/ospf_interface_properties_validation_fail.cfg
@@ -0,0 +1,10 @@
+fabric: test
+ area 0
+ loopback_prefix 10.10.10.0/24
+
+node: test_pve
+ fabric_id test
+ interfaces name=dummy0,passive=true
+ interfaces name=ens18,passive=false
+ node_id pve
+ router_id 10.10.10.1
diff --git a/proxmox-ve-config/tests/fabric/cfg/ospf_loopback_prefix_fail.cfg b/proxmox-ve-config/tests/fabric/cfg/ospf_loopback_prefix_fail.cfg
new file mode 100644
index 000000000000..7d170b6f7c4b
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/cfg/ospf_loopback_prefix_fail.cfg
@@ -0,0 +1,23 @@
+fabric: test
+ loopback_prefix 192.168.2.0/16
+
+node: test_pve
+ fabric_id test
+ interfaces name=ens20,passive=1,unnumbered=true
+ interfaces name=ens19,passive=1,unnumbered=true
+ node_id pve
+ router_id 192.168.2.8
+
+node: test_pve1
+ fabric_id test
+ interfaces name=ens19,unnumbered=true
+ interfaces name=ens20,unnumbered=true
+ node_id pve1
+ router_id 192.168.3.20
+
+node: test_pve2
+ fabric_id test
+ interfaces name=ens19,ip=3.3.3.2/31
+ interfaces name=ens20,ip=3.3.3.4/31
+ node_id pve2
+ router_id 192.169.2.10
diff --git a/proxmox-ve-config/tests/fabric/cfg/ospf_multi_fabric.cfg b/proxmox-ve-config/tests/fabric/cfg/ospf_multi_fabric.cfg
new file mode 100644
index 000000000000..0fb62bb2c9d8
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/cfg/ospf_multi_fabric.cfg
@@ -0,0 +1,33 @@
+fabric: test
+ area 0
+ loopback_prefix 192.168.2.0/24
+
+node: test_pve
+ fabric_id test
+ interfaces name=ens20,passive=1,unnumbered=true
+ interfaces name=ens19,passive=1,unnumbered=false,ip=3.3.3.4/31
+ node_id pve
+ router_id 192.168.2.8
+
+node: test_pve1
+ fabric_id test
+ interfaces name=ens19,unnumbered=true
+ node_id pve1
+ router_id 192.168.2.9
+
+fabric: ceph
+ area 1
+ loopback_prefix 192.168.1.0/24
+
+node: ceph_pve
+ fabric_id ceph
+ interfaces name=ens20,passive=1,unnumbered=true
+ interfaces name=ens19,passive=1,unnumbered=true
+ node_id pve
+ router_id 192.168.1.8
+
+node: ceph_pve1
+ fabric_id ceph
+ interfaces name=ens20,unnumbered=true
+ node_id pve1
+ router_id 192.168.1.9
diff --git a/proxmox-ve-config/tests/fabric/cfg/ospf_verification_fail.cfg b/proxmox-ve-config/tests/fabric/cfg/ospf_verification_fail.cfg
new file mode 100644
index 000000000000..f09636231320
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/cfg/ospf_verification_fail.cfg
@@ -0,0 +1,17 @@
+fabric: test
+ area 0
+ loopback_prefix 10.10.10.0/24
+
+node: test_pve
+ fabric_id test
+ interfaces name=dummy0,passive=true,unnumbered=true
+ interfaces name=ens18,passive=false,unnumbered=true
+ node_id pve
+ router_id 10.10.10.1
+
+node: test1_pve1
+ fabric_id test1
+ interfaces name=dummy0,passive=true,unnumbered=true
+ interfaces name=ens19,passive=false,unnumbered=true
+ node_id pve1
+ router_id 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..f307c1b96b25
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/helper.rs
@@ -0,0 +1,43 @@
+#[allow(unused_macros)]
+macro_rules! get_section_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}.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_section_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..2865b73266ea
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/main.rs
@@ -0,0 +1,132 @@
+#![cfg(feature = "frr")]
+use proxmox_frr::serializer::dump;
+use proxmox_ve_config::sdn::fabric::openfabric::OpenFabricSectionConfig;
+use proxmox_ve_config::sdn::fabric::ospf::OspfSectionConfig;
+use proxmox_ve_config::sdn::fabric::{FabricConfig, FrrConfigBuilder, Valid};
+
+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}.cfg" files.
+ * WIth the helper::reference_name!("<hostname>") macro you can get the snapshot file of this
+ * function for this specific hostname.
+ */
+
+#[test]
+fn openfabric_default() {
+ let openfabric =
+ <Valid<OpenFabricSectionConfig>>::parse_section_config("", &helper::get_section_config!())
+ .unwrap();
+
+ let config = FabricConfig::with_openfabric(openfabric);
+ let mut frr_config = FrrConfigBuilder::default()
+ .add_fabrics(config.clone())
+ .build("pve".parse().expect("valid id"))
+ .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("pve1".parse().expect("valid id"))
+ .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 ospf = <Valid<OspfSectionConfig>>::parse_section_config("", &helper::get_section_config!())
+ .unwrap();
+
+ let config = FabricConfig::with_ospf(ospf);
+ let mut frr_config = FrrConfigBuilder::default()
+ .add_fabrics(config.clone())
+ .build("pve".parse().expect("valid id"))
+ .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("pve1".parse().expect("valid id"))
+ .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 =
+ <Valid<OpenFabricSectionConfig>>::parse_section_config("", &helper::get_section_config!());
+ assert!(result.is_err());
+}
+
+#[test]
+fn ospf_verification_fail() {
+ let result =
+ <Valid<OspfSectionConfig>>::parse_section_config("", &helper::get_section_config!());
+ assert!(result.is_err());
+}
+
+#[test]
+fn openfabric_loopback_prefix_fail() {
+ let result =
+ <Valid<OpenFabricSectionConfig>>::parse_section_config("", &helper::get_section_config!());
+ assert!(result.is_err());
+}
+
+#[test]
+fn ospf_loopback_prefix_fail() {
+ let result =
+ <Valid<OspfSectionConfig>>::parse_section_config("", &helper::get_section_config!());
+ assert!(result.is_err());
+}
+
+#[test]
+fn openfabric_multi_fabric() {
+ let openfabric =
+ <Valid<OpenFabricSectionConfig>>::parse_section_config("", &helper::get_section_config!())
+ .unwrap();
+
+ let config = FabricConfig::with_openfabric(openfabric);
+ let frr_config = FrrConfigBuilder::default()
+ .add_fabrics(config.clone())
+ .build("pve1".parse().expect("valid id"))
+ .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 ospf = <Valid<OspfSectionConfig>>::parse_section_config("", &helper::get_section_config!())
+ .unwrap();
+
+ let config = FabricConfig::with_ospf(ospf);
+ let frr_config = FrrConfigBuilder::default()
+ .add_fabrics(config.clone())
+ .build("pve1".parse().expect("valid id"))
+ .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_interface_properties_validation_fail() {
+ let ospf = <Valid<OspfSectionConfig>>::parse_section_config("", &helper::get_section_config!());
+ assert!(ospf.is_err());
+}
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..dfce9ac99ffe
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/snapshots/fabric__openfabric_default_pve.snap
@@ -0,0 +1,36 @@
+---
+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 passive
+ openfabric hello-interval 4
+ openfabric csnp-interval 100
+exit
+!
+interface ens20
+ ip router openfabric uwu
+ openfabric passive
+ openfabric hello-interval 3
+ openfabric hello-multiplier 50
+exit
+!
+access-list openfabric_uwu_ips permit 192.168.2.0/24
+!
+route-map openfabric permit 100
+ match ip address openfabric_uwu_ips
+ set src 192.168.2.8
+exit
+!
+ip protocol openfabric route-map 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..5b30380ad47a
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/snapshots/fabric__openfabric_default_pve1.snap
@@ -0,0 +1,32 @@
+---
+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 openfabric_uwu_ips permit 192.168.2.0/24
+!
+route-map openfabric permit 100
+ match ip address openfabric_uwu_ips
+ set src 192.168.2.9
+exit
+!
+ip protocol openfabric route-map openfabric
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..35d48e869164
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/snapshots/fabric__openfabric_multi_fabric_pve1.snap
@@ -0,0 +1,48 @@
+---
+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 ens20
+ ip router openfabric test2
+ openfabric hello-interval 4
+exit
+!
+access-list openfabric_test1_ips permit 192.168.2.0/24
+!
+access-list openfabric_test2_ips permit 192.168.1.0/24
+!
+route-map openfabric permit 100
+ match ip address openfabric_test1_ips
+ set src 192.168.2.9
+exit
+!
+route-map openfabric permit 110
+ match ip address openfabric_test2_ips
+ set src 192.168.1.9
+exit
+!
+ip protocol openfabric route-map 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..83b4006e6124
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/snapshots/fabric__ospf_default_pve.snap
@@ -0,0 +1,31 @@
+---
+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 ospf_test_ips permit 10.10.10.10/24
+!
+route-map ospf permit 100
+ match ip address ospf_test_ips
+ set src 10.10.10.1
+exit
+!
+ip protocol ospf route-map 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..c574bd9d99bd
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/snapshots/fabric__ospf_default_pve1.snap
@@ -0,0 +1,27 @@
+---
+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 ospf_test_ips permit 10.10.10.10/24
+!
+route-map ospf permit 100
+ match ip address ospf_test_ips
+ set src 10.10.10.2
+exit
+!
+ip protocol ospf route-map 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..22afba916120
--- /dev/null
+++ b/proxmox-ve-config/tests/fabric/snapshots/fabric__ospf_multi_fabric_pve1.snap
@@ -0,0 +1,48 @@
+---
+source: proxmox-ve-config/tests/fabric/main.rs
+expression: output
+snapshot_kind: text
+---
+router ospf
+ ospf router-id 192.168.2.9
+exit
+!
+router ospf
+ ospf router-id 192.168.2.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 ens20
+ ip ospf area 1
+ ip ospf network point-to-point
+exit
+!
+access-list ospf_ceph_ips permit 192.168.1.0/24
+!
+access-list ospf_test_ips permit 192.168.2.0/24
+!
+route-map ospf permit 100
+ match ip address ospf_test_ips
+ set src 192.168.2.9
+exit
+!
+route-map ospf permit 110
+ match ip address ospf_ceph_ips
+ set src 192.168.1.9
+exit
+!
+ip protocol ospf route-map ospf
--
2.39.5
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2025-04-04 16:34 UTC|newest]
Thread overview: 76+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-04 16:28 [pve-devel] [PATCH access-control/cluster/docs/gui-tests/manager/network/proxmox{, -ve-rs, -perl-rs} v2 00/57] Add SDN Fabrics Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH proxmox v2 1/1] serde: add string_as_bool module for boolean string parsing Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH proxmox-ve-rs v2 01/15] sdn-types: initial commit Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH proxmox-ve-rs v2 02/15] frr: create proxmox-frr crate Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH proxmox-ve-rs v2 03/15] frr: add common frr types Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH proxmox-ve-rs v2 04/15] frr: add openfabric types Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH proxmox-ve-rs v2 05/15] frr: add ospf types Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH proxmox-ve-rs v2 06/15] frr: add route-map types Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH proxmox-ve-rs v2 07/15] frr: add generic types over openfabric and ospf Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH proxmox-ve-rs v2 08/15] frr: add serializer for all FRR types Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH proxmox-ve-rs v2 09/15] ve-config: add common section-config types for OpenFabric and OSPF Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH proxmox-ve-rs v2 10/15] ve-config: add openfabric section-config Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH proxmox-ve-rs v2 11/15] ve-config: add ospf section-config Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH proxmox-ve-rs v2 12/15] ve-config: add FRR conversion helpers for openfabric and ospf Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH proxmox-ve-rs v2 13/15] ve-config: add validation for section-config Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH proxmox-ve-rs v2 14/15] ve-config: add section-config to frr types conversion Gabriel Goller
2025-04-04 16:28 ` Gabriel Goller [this message]
2025-04-04 16:28 ` [pve-devel] [PATCH proxmox-perl-rs v2 1/7] perl-rs: sdn: initial fabric infrastructure Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH proxmox-perl-rs v2 2/7] perl-rs: sdn: add CRUD helpers for OpenFabric fabric management Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH proxmox-perl-rs v2 3/7] perl-rs: sdn: OpenFabric perlmod methods Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH proxmox-perl-rs v2 4/7] perl-rs: sdn: implement Openfabric interface file generation Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH proxmox-perl-rs v2 5/7] perl-rs: sdn: add CRUD helpers for OSPF fabric management Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH proxmox-perl-rs v2 6/7] perl-rs: sdn: OSPF perlmod methods Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH proxmox-perl-rs v2 7/7] perl-rs: sdn: implement OSPF interface file configuration generation Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH pve-cluster v2 1/1] cluster: add sdn fabrics config files Gabriel Goller
2025-04-04 17:03 ` [pve-devel] applied: " Thomas Lamprecht
2025-04-04 16:28 ` [pve-devel] [PATCH pve-access-control v2 1/1] permissions: add ACL paths for SDN fabrics Gabriel Goller
2025-04-04 17:20 ` Thomas Lamprecht
2025-04-07 7:24 ` Fabian Grünbichler
2025-04-07 8:12 ` Thomas Lamprecht
2025-04-07 8:51 ` Stefan Hanreich
2025-04-07 9:27 ` Fabian Grünbichler
2025-04-07 9:44 ` Stefan Hanreich
2025-04-11 11:12 ` Stefan Hanreich
2025-04-11 11:14 ` Stefan Hanreich
2025-04-11 16:51 ` Stefan Hanreich
2025-04-07 9:34 ` Thomas Lamprecht
2025-04-07 10:08 ` Stefan Hanreich
2025-04-07 10:12 ` Thomas Lamprecht
2025-04-07 11:41 ` Gilberto Ferreira via pve-devel
[not found] ` <CAOKSTBsu8vrw8_nSu_LozwNwTc+ReTb6TEg3K_iM8uYh9oRRFg@mail.gmail.com>
2025-04-07 11:59 ` Stefan Hanreich
2025-04-07 12:22 ` Gilberto Ferreira via pve-devel
2025-04-04 16:28 ` [pve-devel] [PATCH pve-network v2 01/19] sdn: fix value returned by pending_config Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH pve-network v2 02/19] debian: add dependency to proxmox-perl-rs Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH pve-network v2 03/19] fabrics: add fabrics module Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH pve-network v2 04/19] refactor: controller: move frr methods into helper Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH pve-network v2 05/19] frr: add new helpers for reloading frr configuration Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH pve-network v2 06/19] controllers: implement new api for frr config generation Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH pve-network v2 07/19] sdn: add frr config generation helper Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH pve-network v2 08/19] test: isis: add test for standalone configuration Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH pve-network v2 09/19] sdn: frr: add daemon status to frr helper Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH pve-network v2 10/19] sdn: commit fabrics config to running configuration Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH pve-network v2 11/19] fabrics: generate ifupdown configuration Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH pve-network v2 12/19] api: fabrics: add common helpers Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH pve-network v2 13/19] api: openfabric: add api endpoints Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH pve-network v2 14/19] api: openfabric: add node endpoints Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH pve-network v2 15/19] api: ospf: add fabric endpoints Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH pve-network v2 16/19] api: ospf: add node endpoints Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH pve-network v2 17/19] api: fabrics: add module / subfolder Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH pve-network v2 18/19] test: fabrics: add test cases for ospf and openfabric + evpn Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH pve-network v2 19/19] frr: bump frr config version to 10.2.1 Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH pve-manager v2 01/11] api: use new generalized frr and etc network config helper functions Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH pve-manager v2 02/11] fabric: add common interface panel Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH pve-manager v2 03/11] fabric: add OpenFabric interface properties Gabriel Goller
2025-04-04 16:28 ` [pve-devel] [PATCH pve-manager v2 04/11] fabric: add OSPF " Gabriel Goller
2025-04-04 16:29 ` [pve-devel] [PATCH pve-manager v2 05/11] fabric: add generic node edit panel Gabriel Goller
2025-04-04 16:29 ` [pve-devel] [PATCH pve-manager v2 06/11] fabric: add generic fabric " Gabriel Goller
2025-04-04 16:29 ` [pve-devel] [PATCH pve-manager v2 07/11] fabric: add OpenFabric " Gabriel Goller
2025-04-04 16:29 ` [pve-devel] [PATCH pve-manager v2 08/11] fabric: add OSPF " Gabriel Goller
2025-04-04 16:29 ` [pve-devel] [PATCH pve-manager v2 09/11] fabrics: Add main FabricView Gabriel Goller
2025-04-04 16:29 ` [pve-devel] [PATCH pve-manager v2 10/11] utils: avoid line-break in pending changes message Gabriel Goller
2025-04-04 16:29 ` [pve-devel] [PATCH pve-manager v2 11/11] ui: permissions: add ACL paths for fabrics Gabriel Goller
2025-04-04 16:29 ` [pve-devel] [PATCH pve-gui-tests v2 1/1] pve: add sdn/fabrics screenshots Gabriel Goller
2025-04-04 16:29 ` [pve-devel] [PATCH pve-docs v2 1/1] fabrics: add initial documentation for sdn fabrics Gabriel Goller
2025-04-07 8:53 ` [pve-devel] [PATCH access-control/cluster/docs/gui-tests/manager/network/proxmox{, -ve-rs, -perl-rs} v2 00/57] Add SDN Fabrics Friedrich Weber
2025-04-07 9:39 ` Stefan Hanreich
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=20250404162908.563060-17-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