Skip to content

Commit 85fa52c

Browse files
authored
Fix BGP route deletion and enable rdb tests in CI (#399)
* 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]>
1 parent 985a9fb commit 85fa52c

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed

.github/buildomat/jobs/test-rdb.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
#:
3+
#: name = "test-rdb"
4+
#: variety = "basic"
5+
#: target = "helios-2.0"
6+
#: rust_toolchain = "stable"
7+
#: output_rules = [
8+
#: "/work/*.log",
9+
#: ]
10+
#: access_repos = [
11+
#: "oxidecomputer/dendrite",
12+
#: ]
13+
#:
14+
15+
set -x
16+
set -e
17+
18+
cargo --version
19+
rustc --version
20+
21+
cargo install cargo-nextest
22+
23+
pushd rdb
24+
25+
cargo nextest run
26+
cp *.log /work/

rdb/src/db.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ impl Db {
577577
self.remove_prefix_path(prefix, |rib_path: &Path| {
578578
match rib_path.bgp {
579579
Some(ref bgp) => bgp.id == id,
580-
None => true,
580+
None => false,
581581
}
582582
});
583583
pcn.changed.insert(prefix);
@@ -779,8 +779,8 @@ mod test {
779779
let static_path1 = Path::from(static_key1);
780780

781781
// setup
782-
let log = init_file_logger("/tmp/rib.log");
783-
let db_path = "/tmp/rb.db".to_string();
782+
let log = init_file_logger("rib.log");
783+
let db_path = "rib.db".to_string();
784784
let _ = std::fs::remove_dir_all(&db_path);
785785
let db = Db::new(&db_path, log.clone()).expect("create db");
786786

0 commit comments

Comments
 (0)