@@ -204,15 +204,15 @@ mod tests {
204204 #[ test]
205205 fn wasm_engine_initializes ( ) {
206206 let store = CidStore :: new ( ) ;
207- let sandbox = WasmSandbox :: new ( std:: path :: PathBuf :: from ( "/tmp/ wc-test-wasm") , store) ;
207+ let sandbox = WasmSandbox :: new ( std:: env :: temp_dir ( ) . join ( " wc-test-wasm") , store) ;
208208 assert ! ( sandbox. is_ok( ) ) ;
209209 }
210210
211211 #[ test]
212212 fn wasm_create_fails_for_missing_cid ( ) {
213213 let store = CidStore :: new ( ) ;
214214 let mut sandbox =
215- WasmSandbox :: new ( std:: path :: PathBuf :: from ( "/tmp/ wc-test-wasm-missing") , store) . unwrap ( ) ;
215+ WasmSandbox :: new ( std:: env :: temp_dir ( ) . join ( " wc-test-wasm-missing") , store) . unwrap ( ) ;
216216 let cid = crate :: data_plane:: cid_store:: compute_cid ( b"nonexistent" ) . unwrap ( ) ;
217217 assert ! ( sandbox. create( & cid) . is_err( ) ) ;
218218 }
@@ -224,7 +224,7 @@ mod tests {
224224 let cid = store. put ( & wasm_bytes) . unwrap ( ) ;
225225
226226 let mut sandbox =
227- WasmSandbox :: new ( std:: path :: PathBuf :: from ( "/tmp/ wc-test-wasm-run") , store) . unwrap ( ) ;
227+ WasmSandbox :: new ( std:: env :: temp_dir ( ) . join ( " wc-test-wasm-run") , store) . unwrap ( ) ;
228228 assert ! ( sandbox. create( & cid) . is_ok( ) ) ;
229229 assert ! ( sandbox. start( ) . is_ok( ) ) ;
230230 assert ! ( sandbox. terminate( ) . is_ok( ) ) ;
@@ -237,7 +237,7 @@ mod tests {
237237 let cid = store. put ( bad_bytes) . unwrap ( ) ;
238238
239239 let mut sandbox =
240- WasmSandbox :: new ( std:: path :: PathBuf :: from ( "/tmp/ wc-test-wasm-bad") , store) . unwrap ( ) ;
240+ WasmSandbox :: new ( std:: env :: temp_dir ( ) . join ( " wc-test-wasm-bad") , store) . unwrap ( ) ;
241241 let result = sandbox. create ( & cid) ;
242242 assert ! ( result. is_err( ) ) ;
243243 assert ! ( result. unwrap_err( ) . to_string( ) . contains( "compilation failed" ) ) ;
@@ -250,8 +250,7 @@ mod tests {
250250 let cid = store. put ( & wasm_bytes) . unwrap ( ) ;
251251
252252 let mut sandbox =
253- WasmSandbox :: new ( std:: path:: PathBuf :: from ( "/tmp/wc-test-wasm-lifecycle" ) , store)
254- . unwrap ( ) ;
253+ WasmSandbox :: new ( std:: env:: temp_dir ( ) . join ( "wc-test-wasm-lifecycle" ) , store) . unwrap ( ) ;
255254 assert ! ( sandbox. create( & cid) . is_ok( ) ) ;
256255 assert ! ( sandbox. start( ) . is_ok( ) ) ;
257256 assert ! ( sandbox. freeze( ) . is_ok( ) ) ;
0 commit comments