mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2026-11-02 08:10:02 -06:00
changes
This commit is contained in:
1 parent
07a6e949aa
commit
0b1fb8b72e
1 file changed
+48
-2
@@ -3430,8 +3430,9 @@ fn recompile_effective_network_bandwidths(
|
||||
.map(|node| (node.node_id.as_str(), node))
|
||||
.collect::<HashMap<_, _>>();
|
||||
let selected_attachment_caps = selected_attachment_rate_caps(ui_state, effective);
|
||||
let use_compatibility_export_rates =
|
||||
canonical.ingress_kind != TopologyCanonicalIngressKind::NativeIntegration;
|
||||
let use_compatibility_export_rates = canonical.ingress_kind
|
||||
!= TopologyCanonicalIngressKind::NativeIntegration
|
||||
|| canonical.source.starts_with("uisp/");
|
||||
for node in root.values_mut() {
|
||||
recompile_effective_bandwidths_for_value(
|
||||
node,
|
||||
@@ -4571,6 +4572,51 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn native_uisp_compatibility_export_rates_still_cap_ap_nodes() {
|
||||
let mut root = sample_effective_bandwidth_tree();
|
||||
let canonical = TopologyCanonicalStateFile {
|
||||
source: "uisp/full".to_string(),
|
||||
ingress_kind: TopologyCanonicalIngressKind::NativeIntegration,
|
||||
nodes: vec![
|
||||
canonical_node_with_rate_source(
|
||||
"site-hoodoo",
|
||||
"Hoodoo Hill",
|
||||
774,
|
||||
774,
|
||||
TopologyCanonicalRateInputSource::AttachmentMax,
|
||||
),
|
||||
canonical_node_with_rate_source(
|
||||
"ap-thunderhill",
|
||||
"HoodooHill-Thunderhill",
|
||||
214,
|
||||
773,
|
||||
TopologyCanonicalRateInputSource::CompatibilityExport,
|
||||
),
|
||||
],
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
super::recompile_effective_network_bandwidths(
|
||||
&mut root,
|
||||
&canonical,
|
||||
&TopologyEditorStateFile::default(),
|
||||
&TopologyEffectiveStateFile::default(),
|
||||
);
|
||||
|
||||
let ap = root["Hoodoo Hill"]["children"]["HoodooHill-Thunderhill"]
|
||||
.as_object()
|
||||
.expect("AP node should exist");
|
||||
assert_eq!(
|
||||
super::node_bandwidth_mbps(ap, "downloadBandwidthMbps"),
|
||||
Some(214)
|
||||
);
|
||||
assert_eq!(
|
||||
super::node_bandwidth_mbps(ap, "uploadBandwidthMbps"),
|
||||
Some(773)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn native_operator_override_rates_still_cap_nodes() {
|
||||
let mut root = sample_effective_bandwidth_tree();
|
||||
|
||||
Reference in new issue
Block a user