Skip to content

Commit

Permalink
Fix BGP route deletion and enable rdb tests in CI (#399)
Browse files Browse the repository at this point in the history
* Fix BGP route deletion

The closure in remove_bgp_prefixes() was incorrectly returning false
when Path.bgp was None.  This caused static route paths to be
incorrectly deleted during BGP path deletion.

Signed-off-by: Trey Aspelund <[email protected]>

* Enable rdb tests in CI

Signed-off-by: Trey Aspelund <[email protected]>

* Update test db/log filepath

Move db/log out of a subdirectory to align with bgp tests, so
buildomat scripts are happy and consistent.

Signed-off-by: Trey Aspelund <[email protected]>

---------

Signed-off-by: Trey Aspelund <[email protected]>
  • Loading branch information
taspelund authored Oct 26, 2024
1 parent 985a9fb commit 85fa52c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
26 changes: 26 additions & 0 deletions .github/buildomat/jobs/test-rdb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
#:
#: name = "test-rdb"
#: variety = "basic"
#: target = "helios-2.0"
#: rust_toolchain = "stable"
#: output_rules = [
#: "/work/*.log",
#: ]
#: access_repos = [
#: "oxidecomputer/dendrite",
#: ]
#:

set -x
set -e

cargo --version
rustc --version

cargo install cargo-nextest

pushd rdb

cargo nextest run
cp *.log /work/
6 changes: 3 additions & 3 deletions rdb/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ impl Db {
self.remove_prefix_path(prefix, |rib_path: &Path| {
match rib_path.bgp {
Some(ref bgp) => bgp.id == id,
None => true,
None => false,
}
});
pcn.changed.insert(prefix);
Expand Down Expand Up @@ -779,8 +779,8 @@ mod test {
let static_path1 = Path::from(static_key1);

// setup
let log = init_file_logger("/tmp/rib.log");
let db_path = "/tmp/rb.db".to_string();
let log = init_file_logger("rib.log");
let db_path = "rib.db".to_string();
let _ = std::fs::remove_dir_all(&db_path);
let db = Db::new(&db_path, log.clone()).expect("create db");

Expand Down

0 comments on commit 85fa52c

Please sign in to comment.