File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2604,11 +2604,13 @@ mod tests {
26042604 // Without the cap this would try to allocate terabytes and OOM.
26052605 let root = tmpdir ( "readcap" ) ;
26062606 fs:: write ( root. join ( "small.bin" ) , b"hello" ) . unwrap ( ) ;
2607+ let preopens = vec ! [ Preopen :: new( & root, "/host" ) . unwrap( ) ] ;
26072608 let mut reg = ToolRegistry :: new ( ) ;
2608- FsSandbox :: new ( & root ) . unwrap ( ) . register ( & mut reg) ;
2609+ FsRouter :: new ( & preopens ) . unwrap ( ) . register ( & mut reg) ;
26092610
26102611 // Ask for 1 TiB — the cap should silently clamp to MAX_FS_READ.
2611- let req = br#"{"name":"fs_read_bytes","args":{"path":"small.bin","len":1099511627776}}"# ;
2612+ let req =
2613+ br#"{"name":"fs_read_bytes","args":{"path":"/host/small.bin","len":1099511627776}}"# ;
26122614 let resp = reg. dispatch ( req) ;
26132615 let s = std:: str:: from_utf8 ( & resp) . unwrap ( ) ;
26142616 assert ! ( !s. contains( "\" error\" " ) , "should succeed: {s}" ) ;
You can’t perform that action at this time.
0 commit comments