// Ad-hoc smoke test for DaemonBackend end-to-end against a live cube-server. // Exercises the raw backend put/get at the level the FUSE layer actually uses: // `put` is handed the full record envelope (header bytes + body), and `get` // must return exactly that envelope back so CubeStore::get_record can decode it. // Requires CUBE_SOCK env var pointing at a running cube-server socket. // Marked `#[ignore]` so the default gate (no daemon) stays green; `./check // daemon` spins up a daemon and runs it via `--ignored`. // Run manually: // CUBE_SOCK= cargo test --test daemon_backend_smoke -- --ignored --nocapture use cubecoords::Czyx; use cubefs::DaemonBackend; use cubestore::CubeBackend; #[test] #[ignore = "requires a live cube-server; run via `./check daemon`"] fn daemon_backend_put_get_roundtrip() { let sock = std::env::var("CUBE_SOCK").expect("set CUBE_SOCK to a live cube-server socket"); let mut b = DaemonBackend::new(sock); let k = Czyx::new(9, 2, 2, 1); // `put` is passed the full envelope (header + body), exactly as // CubeStore::put_record would hand it. We store a header-len word + body. let mut envelope = Vec::new(); envelope.extend_from_slice(&(0u32).to_le_bytes()); // header length (0) envelope.extend_from_slice(b"fuse-persist-proof"); b.put(k, envelope.clone()); let got = b.get(&k).expect("envelope must be returned by get"); println!("DaemonBackend::get(9,2,2,1) => {} bytes", got.len()); assert_eq!( got, envelope, "daemon backend put/get roundtrip must preserve the full envelope" ); }