20 lines
723 B
Rust
20 lines
723 B
Rust
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
use molotov_bootstrap::sandbox::{SandboxConfig, SandboxRunner};
|
|
use std::path::PathBuf;
|
|
|
|
#[test]
|
|
fn test_bwrap_arguments_contain_isolated_data_dir() {
|
|
let config = SandboxConfig {
|
|
instance_id: "test-acc-1".to_string(),
|
|
data_dir: PathBuf::from("/tmp/molotov_data"),
|
|
config_dir: PathBuf::from("/tmp/molotov_config"),
|
|
nice_priority: -5,
|
|
};
|
|
|
|
let runner = SandboxRunner::new(config);
|
|
let args = runner.build_bwrap_args(&PathBuf::from("/usr/bin/molotov"));
|
|
|
|
assert!(args.contains(&"--unshare-pid".to_string()));
|
|
assert!(args.contains(&"--bind".to_string()));
|
|
assert!(args.iter().any(|a| a.contains("/tmp/molotov_data")));
|
|
}
|