mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 21:36:40 -10:00
A new VM gets network policy unless it's turned off. In a terminal devvm shows the tradeoff and asks yes by default ([Y/n]); without a terminal it's on. A VM that can't have network policy gets no question, only a warning, and is made without it: on a backend without egress-proxy (or with it unreviewed), and a Docker VM made for the docker layer, whether named or from a devcontainer.json's docker-in-docker. An explicit --network-policy on such a VM is still refused (net_docker_layer, or backend_lacks from Require). Existing VMs keep their state's choice. - netpolicy.Proxy.Choose: no terminal gives on; in a terminal net_about, then Confirm (yes by default). Proxy's Ask field and netpolicy.UI's Ask removed (unused); vm.UI asks Ask itself. - vm.creation.chooseNet: --no-network-policy first; the docker layer warns (net_off_docker_layer) or refuses --network-policy; a backend Registry.Allowed doesn't let egress-proxy through warns (net_off_backend); otherwise Choose. - Messages: new net_off_docker_layer, net_off_backend (with doc links); net_about rewritten as the two-line tradeoff with a doc link (safety/network#turning-it-on-or-off); net_ask is "Turn it on?" (no fields); devcontainer_docker_net removed (no caller). - --network-policy's help: secrets, default on, asked in a terminal; CLI reference regenerated. - Tests: TestChoose (flags, terminal yes/no, no terminal on, what's said); TestChooseNet replaces TestChooseNetDockerLayer (docker layer named and from the file, no egress-proxy, unreviewed egress-proxy, flags, with and without a terminal); TestUpWithoutEgressProxy (backend_lacks for --network-policy, the warning and net=off by default). network.txtar: --no-network-policy for the off VM, and a VM made without a flag or terminal gets net=on. docker.txtar: another machine's engine (backend_lacks, then the warning and net=off), and the sysbox VM's warning. e2e's docker sysbox check expects the warning. - Docs: first-vm, commands, safety/network (the prompt, the VMs that can't have it), security, attack-vectors, devcontainer, backends index and docker, design notes, README. Co-Authored-By: Claude Opus 5.5 <[email protected]>
326 lines
17 KiB
Plaintext
326 lines
17 KiB
Plaintext
# The docker backend (experimental), on the docker stub: its checks, base
|
|
# built by committing a container, a project VM made from it with its
|
|
# mounts and its own home volume, made again when its mounts change, and
|
|
# the features it lacks refused in one line naming the VM. The stub is a
|
|
# Linux engine of this machine's (DEVVM_DOCKER_KIND, read by test builds),
|
|
# where builds are confined; on Docker Desktop their confinement is
|
|
# emulated, through a proxy of devvm's. Registries
|
|
# are never reached: the pinned image needs no lookup, and HTTPS_PROXY
|
|
# points at nothing.
|
|
env DEVVM_MESSAGES=names
|
|
env DEVVM_DOCKER_KIND=linux
|
|
env VMS=$XDG_DATA_HOME/devvm/vms
|
|
env HTTPS_PROXY=http://127.0.0.1:9
|
|
env https_proxy=http://127.0.0.1:9
|
|
env PIN=ubuntu:26.04@sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|
|
|
# Its checks: an engine it reaches, which doctor names; one the user can't
|
|
# reach, with the fix.
|
|
exec devvm doctor --backend docker
|
|
stdout '^docker_engine_linux version=29\.1\.3$'
|
|
stdout '^doctor_ok backend=docker version=\S+$'
|
|
stdout '^FEATURE +DOCKER +LIMA +SMOLVM$'
|
|
stdout '^build-confinement +native +native +native$'
|
|
stdout '^egress-proxy +emulated +native +emulated$'
|
|
stdout '^ssh +emulated +native +emulated$'
|
|
stdout '^ports-all +emulated +emulated +emulated$'
|
|
stdout '^agent-toggle +emulated +native +emulated$'
|
|
stdout '^docker-layer +none +native +native$'
|
|
! stdout docker_sysbox
|
|
exec sh -c ': > "$STUB_DIR/docker-denied"'
|
|
! exec devvm doctor --backend docker
|
|
stderr '^devvm: docker_access fix=sudo usermod -aG docker \S+$'
|
|
rm $STUB_DIR/docker-denied
|
|
|
|
# Base: the image pulled by its digest, a labelled container from it with
|
|
# base.yaml's size, prepared, its scripts run between the stand-ins, then
|
|
# committed as devvm's image and deleted.
|
|
exec devvm --backend docker --from $PIN build base
|
|
stdout '^==> building_image_from from=ubuntu:26\.04@sha256:a+ image=base key=[0-9a-f]{12}$'
|
|
stub_calls
|
|
stdout '^docker image pull ubuntu:26\.04@sha256:a+$'
|
|
stdout '^docker container create --name devvm-img-[0-9a-f]{12}-[0-9a-f]{8} --label devvm\.data=\S+/data/devvm --label devvm\.key=[0-9a-f]{12} --label devvm\.kind=build --init --user 0:0 --entrypoint sleep --cpus 4 --memory \d+m --memory-swap \d+m --hostname devvm-build --network bridge ubuntu:26\.04@sha256:a+ infinity$'
|
|
stdout '^docker container start devvm-img-[0-9a-f]{12}-[0-9a-f]{8}$'
|
|
stdout '^docker exec -i -u 0 devvm-img-[0-9a-f]{12}-[0-9a-f]{8} sh -s -- \S+ \d+( \d+)?$'
|
|
stdout '^docker exec -i -u 0 devvm-img-[0-9a-f]{12}-[0-9a-f]{8} sh -s -- on$'
|
|
stdout '^docker exec -i -u \S+ -w / .* devvm-img-[0-9a-f]{12}-[0-9a-f]{8} sh -c .* sh bash -s$'
|
|
stdout '^docker exec -i -u 0 devvm-img-[0-9a-f]{12}-[0-9a-f]{8} sh -s -- off$'
|
|
stdout '^docker container commit --change LABEL devvm\.kind=image --change LABEL devvm\.key=[0-9a-f]{12} devvm-img-[0-9a-f]{12}-[0-9a-f]{8} devvm-[0-9a-f]{8}:[0-9a-f]{12}$'
|
|
stdout '^docker container rm -f -v devvm-img-[0-9a-f]{12}-[0-9a-f]{8}$'
|
|
! stdout limactl
|
|
exec devvm images
|
|
stdout '^base +ubuntu:26\.04@sha256:a+ +a{12} +[0-9a-f]{12} +current +\S+ +docker$'
|
|
|
|
# What it lacks is refused in one line naming the VM, before anything is
|
|
# made: a disk size; the docker layer without Sysbox, saying to install it
|
|
# on this Linux engine (on Docker Desktop, to use a VM backend).
|
|
mkdir $WORK/web
|
|
cd $WORK/web
|
|
exec sh -c ': > "$STUB_LOG"'
|
|
! exec devvm --backend docker --from $PIN --no-network-policy --ports none --disk 200 base
|
|
stderr '^devvm: backend_lacks backend=docker feature=disk vm=devvm-web-[0-9a-f]{14}$'
|
|
! exec devvm --backend docker --from $PIN --no-network-policy --ports none docker
|
|
stderr '^devvm: docker_layer_no_sysbox vm=devvm-web-[0-9a-f]{14}$'
|
|
env DEVVM_DOCKER_KIND=desktop
|
|
! exec devvm --backend docker --from $PIN --no-network-policy --ports none docker
|
|
stderr '^devvm: docker_layer_needs_vm vm=devvm-web-[0-9a-f]{14}$'
|
|
env DEVVM_DOCKER_KIND=linux
|
|
stub_calls
|
|
! stdout 'container create'
|
|
! exists $VMS
|
|
|
|
# A VM: its home a volume of its own, the project folder bind-mounted,
|
|
# the tools volume read-only, its hostname the folder's; started, its
|
|
# services run without Docker's daemon and with its sshd's config, set
|
|
# up, then the shell, an ssh session forwarding no agent. A default disk
|
|
# size doesn't apply to it, said.
|
|
exec devvm size -g --disk 150
|
|
exec sh -c ': > "$STUB_LOG"'
|
|
exec devvm --backend docker --from $PIN --no-network-policy --ports none base
|
|
stderr '^devvm: size_disk_default_unused backend=docker vm=devvm-web-[0-9a-f]{14}$'
|
|
stdout '^==> creating_from image=base vm=devvm-web-[0-9a-f]{14}$'
|
|
stub_calls
|
|
stdout '^docker volume create --label devvm\.data=\S+ devvm-web-[0-9a-f]{14}-home$'
|
|
stdout '^docker volume create --label devvm\.data=\S+ devvm-tools-[0-9a-f]{8}$'
|
|
stdout '^docker container create --name devvm-web-[0-9a-f]{14} --label devvm\.data=\S+ --label devvm\.config=[0-9a-f]{16} --label devvm\.kind=vm --init --user 0:0 --entrypoint sleep --cpus 4 --memory \d+m --memory-swap \d+m --hostname web --network bridge --mount type=bind,src=\S+/web,dst=\S+/web --mount type=volume,src=devvm-tools-[0-9a-f]{8},dst=/mnt/devvm-tools,readonly --mount type=volume,src=devvm-web-[0-9a-f]{14}-home,dst=/home/\S+\.guest --cap-drop NET_RAW devvm-[0-9a-f]{8}:[0-9a-f]{12} infinity$'
|
|
stdout '^docker container start devvm-web-[0-9a-f]{14}$'
|
|
stdout '^docker exec -i -u 0 -e DEVVM_DOCKERD=off -e DEVVM_LOOP=off -e DEVVM_SSHD=inetd devvm-web-[0-9a-f]{14} sh -s -- ssh \S+ ssh-ed25519 \S+ devvm$'
|
|
stdout '^ssh -F none -T .* -o IdentityAgent=none .* -o ForwardAgent=no .* cd -- ''\S+/web'' && exec bash -l$'
|
|
! stdout 'devvm-web-[0-9a-f]{14} sh -c .* sh bash -l$'
|
|
! stderr backend_unreviewed
|
|
exists $STUB_DIR/sync.tar
|
|
exec devvm ls
|
|
stdout '^devvm-web-[0-9a-f]{14} +Running .*image=base +\S+ +off +docker +\S+/web$'
|
|
exec sh -c 'cat "$VMS"/devvm-web-*'
|
|
stdout '^backend=docker$'
|
|
! stdout '^disk='
|
|
|
|
# devvm size: its CPUs and memory, and what its disk holds; changed with
|
|
# docker update on a stopped VM; a disk size refused.
|
|
exec devvm size
|
|
stdout '\Acpus=4 memory=\S+GiB disk_used=\S+GiB\n\z'
|
|
exec devvm stop
|
|
exec sh -c ': > "$STUB_LOG"'
|
|
exec devvm size --cpus 2
|
|
stdout '^==> vm_size size=cpus=2 memory=\S+ vm=devvm-web-[0-9a-f]{14}$'
|
|
stub_calls
|
|
stdout '^docker update --cpus 2 devvm-web-[0-9a-f]{14}$'
|
|
! exec devvm size --disk 300
|
|
stderr '^devvm: backend_lacks backend=docker feature=disk vm=devvm-web-[0-9a-f]{14}$'
|
|
|
|
# Started again with the same mounts: the same container.
|
|
exec sh -c ': > "$STUB_LOG"'
|
|
exec devvm
|
|
stub_calls
|
|
! stdout 'container (commit|create|rm)'
|
|
stdout '^docker container start devvm-web-[0-9a-f]{14}$'
|
|
|
|
# rm deletes its container, its home volume and its record.
|
|
exec devvm rm -f
|
|
stdout '^==> deleted vm=devvm-web-[0-9a-f]{14}$'
|
|
stub_calls
|
|
stdout '^docker container rm -f -v devvm-web-[0-9a-f]{14}$'
|
|
stdout '^docker volume rm devvm-web-[0-9a-f]{14}-home$'
|
|
! stdout 'volume rm devvm-tools'
|
|
! exec sh -c 'ls "$XDG_DATA_HOME"/devvm/docker/vms/devvm-web-*'
|
|
exec devvm ls
|
|
! stdout devvm-web
|
|
|
|
# Under Sysbox, where the engine has it, emulated and reviewed, so
|
|
# unwarned: the VM runs under its runtime, said, recorded, on a network of
|
|
# its own, with volumes of its own for Docker's engine, Docker's daemon
|
|
# started after each start; ls shows it; no network policy, at creation or
|
|
# later; rm deletes its network and volumes. Added in place to a VM with
|
|
# network policy, refused before anything changes.
|
|
exec sh -c ': > "$STUB_DIR/docker-sysbox"'
|
|
env DEVVM_DOCKER_PROC_SYS=$WORK/sys
|
|
mkdir $WORK/sys/net/ipv4/conf/br-id-net-devvm
|
|
exec sh -c 'echo 0 > "$DEVVM_DOCKER_PROC_SYS/net/ipv4/conf/br-id-net-devvm/route_localnet"'
|
|
exec devvm doctor --backend docker
|
|
stdout '^docker-layer +emulated +native +native$'
|
|
stdout '^docker_sysbox$'
|
|
mkdir $WORK/sysbox
|
|
cd $WORK/sysbox
|
|
! exec devvm --backend docker --from $PIN --network-policy --ports none docker
|
|
stderr '^devvm: net_docker_layer backend=docker vm=devvm-sysbox-[0-9a-f]{14}$'
|
|
exec sh -c ': > "$STUB_LOG"'
|
|
exec devvm --backend docker --from $PIN --ports none docker
|
|
stdout '^==> docker_layer_runtime backend=docker runtime=sysbox vm=devvm-sysbox-[0-9a-f]{14}$'
|
|
stderr '^devvm: net_off_docker_layer backend=docker vm=devvm-sysbox-[0-9a-f]{14}$'
|
|
! stderr 'net_about|net_ask'
|
|
! stderr backend_unreviewed
|
|
stub_calls
|
|
stdout '^docker volume create --label devvm\.data=\S+ devvm-sysbox-[0-9a-f]{14}-docker$'
|
|
stdout '^docker volume create --label devvm\.data=\S+ devvm-sysbox-[0-9a-f]{14}-containerd$'
|
|
stdout '^docker network create --label devvm\.data=\S+ --label devvm\.kind=vm devvm-sysbox-[0-9a-f]{14}-docker-net$'
|
|
stdout '^docker container create --name devvm-sysbox-[0-9a-f]{14} .* --network devvm-sysbox-[0-9a-f]{14}-docker-net .* --mount type=volume,src=devvm-sysbox-[0-9a-f]{14}-containerd,dst=/var/lib/containerd --runtime sysbox-runc devvm-[0-9a-f]{8}:[0-9a-f]{12} infinity$'
|
|
! stdout 'container create --name devvm-sysbox-.* --cap-drop'
|
|
stdout '^docker exec -i -u 0 -e DEVVM_LOOP=off -e DEVVM_SSHD=inetd devvm-sysbox-[0-9a-f]{14} sh -s -- ssh '
|
|
exec sh -c 'cat "$VMS"/devvm-sysbox-*'
|
|
stdout '^docker_layer=sysbox$'
|
|
stdout '^net=off$'
|
|
exec devvm ls
|
|
[darwin] stdout '^devvm-sysbox-[0-9a-f]{14} +Running +.*image=docker +on +off +docker \(sysbox\) +\S+/sysbox$'
|
|
[linux] stdout '^devvm-sysbox-[0-9a-f]{14} +Running +.*image=docker +off +off +docker \(sysbox\) +\S+/sysbox$'
|
|
! exec devvm network on
|
|
stderr '^devvm: net_docker_layer backend=docker vm=devvm-sysbox-[0-9a-f]{14}$'
|
|
exec devvm rm -f
|
|
stub_calls
|
|
stdout '^docker volume rm devvm-sysbox-[0-9a-f]{14}-docker$'
|
|
stdout '^docker volume rm devvm-sysbox-[0-9a-f]{14}-containerd$'
|
|
stdout '^docker network rm devvm-sysbox-[0-9a-f]{14}-docker-net$'
|
|
mkdir $WORK/inplace
|
|
cd $WORK/inplace
|
|
exec devvm --backend docker --from $PIN --no-network-policy --ports none base
|
|
exec devvm network on
|
|
! exec devvm docker
|
|
stderr '^devvm: net_docker_layer backend=docker vm=devvm-inplace-[0-9a-f]{14}$'
|
|
exec devvm rm -f
|
|
# A bridge routing to this machine's loopback (Docker's userland proxy
|
|
# off): refused.
|
|
exec sh -c 'echo 1 > "$DEVVM_DOCKER_PROC_SYS/net/ipv4/conf/br-id-net-devvm/route_localnet"'
|
|
mkdir $WORK/localnet
|
|
cd $WORK/localnet
|
|
! exec devvm --backend docker --from $PIN --ports none docker
|
|
stderr '^devvm: docker_route_localnet vm=devvm-localnet-[0-9a-f]{14}$'
|
|
! exec sh -c 'ls -d "$STUB_DIR"/docker/containers/devvm-localnet-*'
|
|
rm $STUB_DIR/docker-sysbox
|
|
|
|
# Its emulations, reviewed, so unwarned: ssh for editors through docker
|
|
# exec, nothing published (devvm's ssh config names devvm _docker-connect
|
|
# as ProxyCommand); every port, through a forwarder of devvm's over that
|
|
# ssh (its host key read through docker exec and pinned); the shell an ssh
|
|
# session forwarding the user's agent.
|
|
mkdir $WORK/emu
|
|
cd $WORK/emu
|
|
exec sh -c 'printf "0100007F:B8E0\n" > "$STUB_DIR/guest-ports"; : > "$STUB_LOG"'
|
|
exec devvm --backend docker --from $PIN --no-network-policy --ssh-agent base
|
|
! stderr backend_unreviewed
|
|
! stderr 'ports_(no_ssh|forward_failed)'
|
|
stub_calls
|
|
! stdout 'docker container create .* (-p|--publish) '
|
|
stdout '^docker exec -u 0 devvm-emu-[0-9a-f]{14} sh -c if \[ -x /usr/sbin/sshd \]; then echo sshd; else echo none; fi$'
|
|
stdout '^docker exec -i -u 0 -e DEVVM_DOCKERD=off -e DEVVM_LOOP=off -e DEVVM_SSHD=inetd devvm-emu-[0-9a-f]{14} sh -s -- ssh \S+ ssh-ed25519 \S+ devvm$'
|
|
stdout '^docker exec -u 0 devvm-emu-[0-9a-f]{14} cat /etc/ssh/ssh_host_ed25519_key\.pub$'
|
|
stdout '^ssh -F none -M -S \S+/data/devvm/run/docker-[0-9a-f]{16}\.ctl -T .* -o IdentityAgent=none -o IdentityFile=\S+/docker/vms/devvm-emu-[0-9a-f]{14}\.key .* -o HostKeyAlias=devvm-emu-[0-9a-f]{14} .* -o ForwardAgent=no .* -o ProxyCommand=''\S+'' ''_docker-connect'' ''-docker'' ''\S+/docker'' ''-data'' ''\S+/data/devvm'' ''devvm-emu-[0-9a-f]{14}'' -l \S+ devvm-emu-[0-9a-f]{14} sh -s$'
|
|
stdout '^ssh -F none -T -o ControlMaster=no -o ControlPath=none .* -o IdentityAgent=SSH_AUTH_SOCK .* -o ForwardAgent=yes .* -o ProxyCommand=.* -l \S+ devvm-emu-[0-9a-f]{14} cd -- ''\S+/emu'' && exec bash -l$'
|
|
exec sh -c 'cat "$XDG_DATA_HOME"/devvm/docker/vms/devvm-emu-*.ports.log'
|
|
stdout '^devvm ports: port 47328: forwarded$'
|
|
grep '^Host devvm-emu devvm-emu-[0-9a-f]{14}$' $XDG_CONFIG_HOME/devvm/ssh_config
|
|
grep '^ ProxyCommand ''\S+'' ''_docker-connect'' ''-docker'' ''\S+/docker'' ''-data'' ''\S+/data/devvm'' ''devvm-emu-[0-9a-f]{14}''$' $XDG_CONFIG_HOME/devvm/ssh_config
|
|
grep '^ ForwardAgent yes$' $XDG_CONFIG_HOME/devvm/ssh_config
|
|
! grep '^ Port ' $XDG_CONFIG_HOME/devvm/ssh_config
|
|
grep '^devvm-emu-[0-9a-f]{14} ssh-ed25519 AAAAstub$' $XDG_CONFIG_HOME/devvm/known_hosts
|
|
exec devvm ssh
|
|
stdout '^ssh_host_info dir=\S+/emu host=devvm-emu$'
|
|
|
|
# The agent turned off while it runs: from its next start, the shell's and
|
|
# the ssh config entry's alike; then none.
|
|
exec devvm ssh-agent off
|
|
stdout '^==> agent_set_running mode=off vm=devvm-emu-[0-9a-f]{14}$'
|
|
! stderr backend_unreviewed
|
|
exec sh -c ': > "$STUB_LOG"'
|
|
exec devvm
|
|
stub_calls
|
|
stdout '^ssh -F none -T .* -o IdentityAgent=SSH_AUTH_SOCK .* -o ForwardAgent=yes .* cd -- ''\S+/emu'' && exec bash -l$'
|
|
grep '^ ForwardAgent yes$' $XDG_CONFIG_HOME/devvm/ssh_config
|
|
exec devvm stop
|
|
! exec sh -c 'ps -axww -o command= | grep "[_]docker-ports -vm devvm-emu-"'
|
|
exec sh -c ': > "$STUB_LOG"'
|
|
exec devvm
|
|
stub_calls
|
|
stdout '^ssh -F none -T .* -o IdentityAgent=none .* -o ForwardAgent=no .* cd -- ''\S+/emu'' && exec bash -l$'
|
|
grep '^ ForwardAgent no$' $XDG_CONFIG_HOME/devvm/ssh_config
|
|
|
|
# Listed ports: through the forwarder too, those alone; one a program on
|
|
# this machine has is left out, warned.
|
|
exec devvm stop
|
|
exec devvm ports 47328,9-10
|
|
exec sh -c ': > "$STUB_LOG"'
|
|
exec devvm
|
|
stub_calls
|
|
exec sh -c 'cat "$XDG_DATA_HOME"/devvm/docker/vms/devvm-emu-*.ports.log'
|
|
stdout '^devvm ports: forwarding devvm-emu-[0-9a-f]{14}''s ports$'
|
|
exec sh -c 'ps -axww -o command= | grep "[_]docker-ports -vm devvm-emu-"'
|
|
stdout ' -only 47328,9-10$'
|
|
# Running: a change starts its forwarder again at once, for the same
|
|
# start of its container.
|
|
exec sh -c ': > "$STUB_LOG"'
|
|
exec devvm ports rm 9-10
|
|
stdout '^==> ports_forwarding ports=47328 vm=devvm-emu-[0-9a-f]{14}$'
|
|
stub_calls
|
|
! stdout '^docker (container )?(stop|start|create|commit|rm) '
|
|
exec sh -c 'ps -axww -o command= | grep "[_]docker-ports -vm devvm-emu-"'
|
|
stdout ' -only 47328$'
|
|
! stdout ' -only 47328,9-10$'
|
|
|
|
# rm deletes its forwarder, its keys and its entry.
|
|
exec devvm rm -f
|
|
! exec sh -c 'ls "$XDG_DATA_HOME"/devvm/docker/vms/devvm-emu-*'
|
|
! grep devvm-emu $XDG_CONFIG_HOME/devvm/ssh_config
|
|
rm $STUB_DIR/guest-ports
|
|
|
|
# On Docker Desktop builds' confinement is emulated, and reviewed, as its
|
|
# containers reach the host's loopback (its builds are the unit tests').
|
|
# An image built already is used.
|
|
env DEVVM_DOCKER_KIND=desktop
|
|
mkdir $WORK/desk
|
|
cd $WORK/desk
|
|
exec devvm doctor --backend docker
|
|
stdout '^docker_engine_desktop version=29\.1\.3$'
|
|
stdout '^build-confinement +emulated +native +native$'
|
|
stdout '^egress-proxy +emulated +native +emulated$'
|
|
exec devvm --backend docker --from $PIN --no-network-policy --ports none base
|
|
! stderr backend_unreviewed
|
|
stdout '^==> creating_from image=base vm=devvm-desk-[0-9a-f]{14}$'
|
|
exec devvm rm -f
|
|
|
|
# Another machine's engine can't confine a VM to its proxy: without a
|
|
# flag, the VM is made without network policy, unasked and warned;
|
|
# --network-policy is refused before anything is made.
|
|
env DEVVM_DOCKER_KIND=other
|
|
mkdir $WORK/other
|
|
cd $WORK/other
|
|
! exec devvm --backend docker --from $PIN --network-policy --ports none base
|
|
stderr '^devvm: backend_lacks backend=docker feature=egress-proxy vm=devvm-other-[0-9a-f]{14}$'
|
|
! exec sh -c 'ls -d "$STUB_DIR"/docker/containers/devvm-other-*'
|
|
exec devvm --backend docker --from $PIN --ports none base
|
|
stderr '^devvm: net_off_backend backend=docker vm=devvm-other-[0-9a-f]{14}$'
|
|
! stderr 'net_about|net_ask'
|
|
exec sh -c 'cat "$VMS"/devvm-other-*'
|
|
stdout '^net=off$'
|
|
exec devvm rm -f
|
|
env DEVVM_DOCKER_KIND=desktop
|
|
|
|
# A release fetches its own version's Linux build, which network policy's
|
|
# relay runs, the first time a Docker VM needs it: from the release's Linux
|
|
# archive (here a loopback server, with a test build of devvm for Linux),
|
|
# checked against the SHA-256 the release has before it's used. One that
|
|
# doesn't match is refused, and nothing kept; doctor never fetches.
|
|
mkdir $WORK/fetch
|
|
cd $WORK/fetch
|
|
linux_release mismatch
|
|
exec devvm doctor --backend docker
|
|
! stdout docker_linux_build
|
|
! exists $XDG_DATA_HOME/devvm/docker/bin/devvm-linux-$LINUX_ARCH
|
|
! exec devvm --backend docker --from $PIN --network-policy --ports none base
|
|
stdout '^==> docker_linux_build_fetching url=http://127\.0\.0\.1:\d+/devvm-0\.0\.0-linux-\w+\.tar\.gz$'
|
|
stderr '^devvm: docker_linux_build_mismatch url=http://127\.0\.0\.1:\d+/devvm-0\.0\.0-linux-\w+\.tar\.gz$'
|
|
! exists $XDG_DATA_HOME/devvm/docker/bin/devvm-linux-$LINUX_ARCH
|
|
exec devvm rm -f
|
|
linux_release match
|
|
! exec devvm --backend docker --from $PIN --network-policy --ports none base
|
|
stdout '^==> docker_linux_build_fetching url='
|
|
! stderr docker_linux_build
|
|
# The stub's VM answers the self-check's direct connection, so devvm stops
|
|
# it; the fetch is what's checked here.
|
|
stderr '^devvm: net_direct_route vm=devvm-fetch-[0-9a-f]{14}$'
|
|
exists $XDG_DATA_HOME/devvm/docker/bin/devvm-linux-$LINUX_ARCH
|
|
stub_calls
|
|
stdout '^docker container create --name devvm-fetch-[0-9a-f]{14}-proxy .* --mount type=bind,src=\S+/docker/bin/devvm-linux-\w+,dst=/devvm,readonly '
|
|
# Kept: the next start fetches nothing.
|
|
! exec devvm
|
|
! stdout docker_linux_build_fetching
|
|
stderr '^devvm: net_direct_route vm=devvm-fetch-[0-9a-f]{14}$'
|
|
exec devvm rm -f
|