Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(storage): rename blob keys in host cdylib tests

Steven Enamakele0c82317b121
diff --git a/crates/openhuman-core/src/modules/storage_host_cdylib_stream_tests.rs b/crates/openhuman-core/src/modules/storage_host_cdylib_stream_tests.rs
index 2b7dc40865..2b3e2e2a46 100644
--- a/crates/openhuman-core/src/modules/storage_host_cdylib_stream_tests.rs
+++ b/crates/openhuman-core/src/modules/storage_host_cdylib_stream_tests.rs
@@ -31,31 +31,31 @@ async fn a_blob_over_the_bus_frame_round_trips_through_a_peer_bound_stream() {
let rig = rig("tinyjuice").await;
// 20 MiB: over the 16 MiB frame no inline call could carry.
let len = 20 * MIB;
- let stored = rig.member("StreamPut", ("juice/ccr/streamed", len)).await;
+ let stored = rig.member("StreamPut", ("tinyjuice_ccr/streamed", len)).await;
assert_eq!(stored["ok"]["len"], len, "{stored}");
// It is in the module's own scope, byte for byte.
let handle = rig.backend.for_scope(&rig.scope("tinyjuice")).unwrap();
let meta = handle
.blobs()
- .head("juice/ccr/streamed")
+ .head("tinyjuice_ccr/streamed")
.await
.unwrap()
.expect("the streamed blob is stored");
assert_eq!(meta.len, len);
let bytes = handle
.blobs()
- .get_range("juice/ccr/streamed", 0..1024)
+ .get_range("tinyjuice_ccr/streamed", 0..1024)
.await
.unwrap()
.expect("range");
assert!(bytes.iter().all(|byte| *byte == 0xAB));
// And it comes back whole by `GetStream`.
- let read = rig.member("StreamGet", ("juice/ccr/streamed",)).await;
+ let read = rig.member("StreamGet", ("tinyjuice_ccr/streamed",)).await;
assert_eq!(read["ok"]["len"], len, "{read}");
assert_eq!(read["ok"]["meta_len"], len, "{read}");
assert_eq!(read["ok"]["all_fill"], true, "{read}");
// A key that is not there is `null`, not an error.
- let missing = rig.member("StreamGet", ("juice/ccr/absent",)).await;
+ let missing = rig.member("StreamGet", ("tinyjuice_ccr/absent",)).await;
assert!(
missing["ok"].is_null() && missing.get("ok").is_some(),
"{missing}"
@@ -89,7 +89,7 @@ async fn a_streamed_blob_is_still_bound_by_the_grant_and_the_length() {
"{denied_get}"
);
// The module keeps working after a refusal.
- let after = rig.member("StreamPut", ("juice/ccr/after", 3 * MIB)).await;
+ let after = rig.member("StreamPut", ("tinyjuice_ccr/after", 3 * MIB)).await;
assert_eq!(after["ok"]["len"], 3 * MIB, "{after}");
}
@@ -101,7 +101,7 @@ async fn an_inline_blob_no_frame_can_carry_fails_fast_instead_of_hanging() {
// frame, over the 16 MiB cap.
let started = std::time::Instant::now();
let big: Value = rig
- .member("PutBlob", ("juice/ccr/over-frame", 5_000_000usize))
+ .member("PutBlob", ("tinyjuice_ccr/over-frame", 5_000_000usize))
.await;
assert!(
big.get("err").is_some(),
@@ -115,11 +115,11 @@ async fn an_inline_blob_no_frame_can_carry_fails_fast_instead_of_hanging() {
let handle = rig.backend.for_scope(&rig.scope("tinyjuice")).unwrap();
assert!(handle
.blobs()
- .head("juice/ccr/over-frame")
+ .head("tinyjuice_ccr/over-frame")
.await
.unwrap()
.is_none());
- let after: Value = rig.member("PutBlob", ("juice/ccr/after", 2048usize)).await;
+ let after: Value = rig.member("PutBlob", ("tinyjuice_ccr/after", 2048usize)).await;
assert!(
after.get("ok").is_some(),
"the module keeps working: {after}"
@@ -215,14 +215,14 @@ async fn a_second_module_cannot_read_or_take_the_first_modules_streams() {
// which has no blobs at all.
let rig = rig_with_peers("tinyjuice", &["tinyjuice", "tinymcp"]).await;
let stored = rig
- .member("StreamPut", ("juice/ccr/private", 2 * MIB))
+ .member("StreamPut", ("tinyjuice_ccr/private", 2 * MIB))
.await;
assert_eq!(stored["ok"]["len"], 2 * MIB, "{stored}");
// A module without blob rights is refused outright.
let nosy: tinybus::Result<Value> = rig
.peer_proxy(1, "Blobs")
- .call("GetStream", (json!({"key": "juice/ccr/private"}),))
+ .call("GetStream", (json!({"key": "tinyjuice_ccr/private"}),))
.await;
match nosy {
Err(tinybus::Error::MethodFailed { name, message }) => {
@@ -241,7 +241,7 @@ async fn a_second_module_cannot_read_or_take_the_first_modules_streams() {
.peer_proxy(0, "Blobs")
.call(
"PutStream",
- (json!({"key": "juice/ccr/hijacked", "len": MIB}), reference),
+ (json!({"key": "tinyjuice_ccr/hijacked", "len": MIB}), reference),
)
.await;
assert!(
@@ -251,12 +251,12 @@ async fn a_second_module_cannot_read_or_take_the_first_modules_streams() {
let handle = rig.backend.for_scope(&rig.scope("tinyjuice")).unwrap();
assert!(handle
.blobs()
- .head("juice/ccr/hijacked")
+ .head("tinyjuice_ccr/hijacked")
.await
.unwrap()
.is_none());
// The refused attempt did not spend the stream: its owner still uses it.
- let used = rig.member("UseStream", ("juice/ccr/owned", MIB)).await;
+ let used = rig.member("UseStream", ("tinyjuice_ccr/owned", MIB)).await;
assert!(
used.get("ok").is_some(),
"the owner lost its stream: {used}"
@@ -264,7 +264,7 @@ async fn a_second_module_cannot_read_or_take_the_first_modules_streams() {
assert_eq!(
handle
.blobs()
- .head("juice/ccr/owned")
+ .head("tinyjuice_ccr/owned")
.await
.unwrap()
.expect("stored by the owner")
@@ -273,7 +273,7 @@ async fn a_second_module_cannot_read_or_take_the_first_modules_streams() {
);
// A download the host opened toward the probe is not readable by a peer.
- let reply = rig.member("RawGetStream", ("juice/ccr/private",)).await;
+ let reply = rig.member("RawGetStream", ("tinyjuice_ccr/private",)).await;
let download: tinybus::StreamRef = serde_json::from_value(reply["ok"][1].clone())
.unwrap_or_else(|_| panic!("a download reference: {reply}"));
assert!(
diff --git a/crates/openhuman-core/src/modules/storage_host_cdylib_tests.rs b/crates/openhuman-core/src/modules/storage_host_cdylib_tests.rs
index 8a7c7bc2f7..cb31a6015c 100644
--- a/crates/openhuman-core/src/modules/storage_host_cdylib_tests.rs
+++ b/crates/openhuman-core/src/modules/storage_host_cdylib_tests.rs
@@ -547,7 +547,7 @@ async fn a_blob_over_the_inline_cap_is_refused_and_stores_nothing() {
let rig = rig("tinyjuice").await;
let small: Value = rig
.probe
- .call("PutBlob", ("juice/ccr/small", 1024usize))
+ .call("PutBlob", ("tinyjuice_ccr/small", 1024usize))
.await
.unwrap();
assert!(
@@ -560,7 +560,7 @@ async fn a_blob_over_the_inline_cap_is_refused_and_stores_nothing() {
// `an_inline_blob_no_frame_can_carry_fails_fast_instead_of_hanging`.)
let big: Value = rig
.probe
- .call("PutBlob", ("juice/ccr/over-cap", 2usize * 1024 * 1024))
+ .call("PutBlob", ("tinyjuice_ccr/over-cap", 2usize * 1024 * 1024))
.await
.unwrap();
assert!(
@@ -570,14 +570,14 @@ async fn a_blob_over_the_inline_cap_is_refused_and_stores_nothing() {
let handle = rig.backend.for_scope(&rig.scope("tinyjuice")).unwrap();
assert!(handle
.blobs()
- .head("juice/ccr/over-cap")
+ .head("tinyjuice_ccr/over-cap")
.await
.unwrap()
.is_none());
// The refusal does not take the module's connection down with it.
let after: Value = rig
.probe
- .call("PutBlob", ("juice/ccr/after", 2048usize))
+ .call("PutBlob", ("tinyjuice_ccr/after", 2048usize))
.await
.unwrap();
assert!(
diff --git a/crates/openhuman-core/src/modules/storage_import_tinybox_tests.rs b/crates/openhuman-core/src/modules/storage_import_tinybox_tests.rs
index c18f92982d..06215ac990 100644
--- a/crates/openhuman-core/src/modules/storage_import_tinybox_tests.rs
+++ b/crates/openhuman-core/src/modules/storage_import_tinybox_tests.rs
@@ -8,7 +8,7 @@ fn scoped() -> Storage {
memory_storage(&Scope::new("module:tinybox@local").unwrap())
}
-const INDEX: &str = r#"{"jails":{"j1":{"id":"j1","label":"build","dir":"/w/jails/j1","backend_at_create":"landlock","created_at_unix":10,"updated_at_unix":20,"notes":"keep"}}}"#;
+const INDEX: &str = r#"{"schema_version":1,"records":{"j1":{"id":"j1","label":"build","dir":"/w/jails/j1","backend_at_create":"landlock","created_at_unix":10,"updated_at_unix":20,"notes":"keep"}}}"#;
fn legacy_workspace() -> tempfile::TempDir {
let dir = tempfile::tempdir().unwrap();
@@ -34,7 +34,7 @@ async fn the_jail_index_moves_into_one_document_with_the_same_shape() {
.unwrap();
assert_eq!(
stored.doc,
- json!({"jails": {"j1": {
+ json!({"records": {"j1": {
"id": "j1",
"label": "build",
"dir": "/w/jails/j1",