diagnostic: add test for IPv6 minimum prefix
This commit is contained in:
parent
ee54f8f8d3
commit
03fe062973
1 changed files with 12 additions and 3 deletions
|
@ -720,7 +720,7 @@ impl AnalyzerModule for StyleAnalyzer {
|
||||||
|
|
||||||
impl StyleAnalyzer {
|
impl StyleAnalyzer {
|
||||||
/// Analyzes line issues in nftables configuration
|
/// Analyzes line issues in nftables configuration
|
||||||
///
|
///
|
||||||
/// Detects:
|
/// Detects:
|
||||||
/// - Lines exceeding maximum length
|
/// - Lines exceeding maximum length
|
||||||
/// - Trailing whitespace at end of lines
|
/// - Trailing whitespace at end of lines
|
||||||
|
@ -768,7 +768,7 @@ impl StyleAnalyzer {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Analyzes whitespace issues in nftables configuration
|
/// Analyzes whitespace issues in nftables configuration
|
||||||
///
|
///
|
||||||
/// Detects:
|
/// Detects:
|
||||||
/// - Too many consecutive empty lines
|
/// - Too many consecutive empty lines
|
||||||
/// - Trailing empty lines at end of file
|
/// - Trailing empty lines at end of file
|
||||||
|
@ -935,7 +935,7 @@ impl AnalyzerModule for SemanticAnalyzer {
|
||||||
|
|
||||||
impl SemanticAnalyzer {
|
impl SemanticAnalyzer {
|
||||||
/// Validates table declarations in nftables configuration
|
/// Validates table declarations in nftables configuration
|
||||||
///
|
///
|
||||||
/// Checks for:
|
/// Checks for:
|
||||||
/// - Valid table family (ip, ip6, inet, arp, bridge, netdev)
|
/// - Valid table family (ip, ip6, inet, arp, bridge, netdev)
|
||||||
/// - Duplicate table names
|
/// - Duplicate table names
|
||||||
|
@ -1609,5 +1609,14 @@ mod tests {
|
||||||
.iter()
|
.iter()
|
||||||
.any(|d| d.code == DiagnosticCode::InvalidCidrNotation)
|
.any(|d| d.code == DiagnosticCode::InvalidCidrNotation)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Test edge case: IPv6 minimum prefix
|
||||||
|
let source_ipv6_zero = "ip6 saddr ::/0 accept";
|
||||||
|
let diagnostics_ipv6_zero = analyzer.validate_cidr_notation(source_ipv6_zero);
|
||||||
|
assert!(
|
||||||
|
!diagnostics_ipv6_zero
|
||||||
|
.iter()
|
||||||
|
.any(|d| d.code == DiagnosticCode::InvalidCidrNotation)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue