diff --git a/tests/README.md b/tests/README.md index c3a3aca9e65b..c89b8814a7e2 100644 --- a/tests/README.md +++ b/tests/README.md @@ -393,3 +393,8 @@ uvm.ssh.run("ls") snap = uvm.snapshot_full() uvm.help.tmux_ssh() ``` + +It supports a number of options, you can check with `devtool sandbox -- +--help`. + +## How to run tests outside of Docker diff --git a/tools/sandbox.py b/tools/sandbox.py index 4a50d6d24c07..3d3a43f0d06c 100755 --- a/tools/sandbox.py +++ b/tools/sandbox.py @@ -8,6 +8,7 @@ import argparse import re +from pathlib import Path from framework.artifacts import disks, kernels from framework.microvm import MicroVMFactory @@ -50,12 +51,19 @@ def parse_byte_size(param): default=128 * 2**20, # 128MB ) parser.add_argument("--rootfs-size", type=parse_byte_size, default=1 * 2**30) # 1GB +parser.add_argument("--binary-dir", help="Path to the firecracker binaries") args = parser.parse_args() print(args) +bins = None +if args.binary_dir: + binary_dir = Path(args.binary_dir).resolve() + bins = binary_dir / "firecracker", binary_dir / "jailer" +else: + bins = get_firecracker_binaries() print("This step may take a while to compile Firecracker ...") -vmfcty = MicroVMFactory("/srv", *get_firecracker_binaries()) +vmfcty = MicroVMFactory("/srv", *bins) uvm = vmfcty.build(args.kernel, args.rootfs) uvm.help.enable_console() uvm.help.resize_disk(uvm.rootfs_file, args.rootfs_size)