fix tests
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Paul 2024-12-21 07:14:26 +01:00
parent 0130e47b34
commit dc09883c36
2 changed files with 8 additions and 8 deletions

View File

@ -1,6 +1,6 @@
use rustables::*;
use rustables::{expr::*, set::*, Batch, Chain, MsgType, ProtocolFamily, Rule, Table};
use std::{ffi::*, io::*, net::*};
use rustables::{expr::*, Chain, Rule, Table};
use std::{io::*, net::*};
const TABLE_NAME: &str = "ipblc4";
const CHAIN_NAME: &str = "ipblc";
@ -68,18 +68,18 @@ fn main() -> Result<()> {
let mut gexpr = RawExpression::default();
for e in cmprule.get_expressions().unwrap().iter() {
if let Some(ExpressionVariant::Cmp(ip)) = e.get_data() {
if let Some(ExpressionVariant::Cmp(_)) = e.get_data() {
gexpr = e.clone();
}
}
let rules = list_rules_for_chain(&chain).unwrap();
for mut rule in rules {
for rule in rules {
let handle = rule.get_handle().unwrap();
println!("handle {}", handle);
let exprs = rule.get_expressions().unwrap();
for expr in exprs.iter() {
if let Some(ExpressionVariant::Cmp(ip)) = expr.get_data() {
if let Some(ExpressionVariant::Cmp(_)) = expr.get_data() {
if expr.clone() == gexpr {
println!("{:?}", expr.get_data());
println!("test");

View File

@ -169,9 +169,9 @@ impl Context {
#[cfg(test)]
pub async fn get_blocklist_pending(&self) -> Vec<BlockIpData> {
let mut res: Vec<IpData> = vec![];
for (_, v) in self.blocklist.iter() {
res.push(v.ipdata.clone());
let mut res: Vec<BlockIpData> = vec![];
for (_, ipblock) in self.blocklist.iter() {
res.push(ipblock.clone());
}
res
}