# The scripts' own commands, which every other script uses. # The sandbox shows messages by name and names devvm's folders. exec sh -c 'test "$DEVVM_MESSAGES" = names && test "$DATA" = "$XDG_DATA_HOME/devvm" && test "$VMS" = "$DATA/vms" && test "$RUN" = "$DATA/run" && test "$CFG" = "$XDG_CONFIG_HOME/devvm"' # stub_reset forgets the stubs' calls, and empties stdout as an exec does. exec gpgv x stub_calls stdout '^gpgv x$' stub_reset ! stdout . ! stub_calls exec gpgv y stub_calls cmp stdout calls # catg cats the one file a glob matches; a glob matching none or two # fails it. mkdir $VMS/0123456789abcd cp state $VMS/0123456789abcd/state catg $VMS/*/state cmp stdout state ! catg $VMS/*/policy cp state $VMS/0123456789abcd/policy ! catg $VMS/0123456789abcd/* catg $VMS/*/state cmp stdout state # vm_name sets a variable to the one VM whose state records a name made # for a folder, and VAR_dir to its folder; a folder without state, another # folder's VM, no VM or two fail it. mkdir $VMS/0123456789abce cp policy $VMS/0123456789abce/state vm_name WEB web exec echo $WEB $WEB_dir stdout '^devvm-web-0123456789abcd .*/vms/0123456789abcd$' ! vm_name API api mkdir $VMS/fedcba98765432 cp other $VMS/fedcba98765432/state ! vm_name WEB web # project makes a folder in $WORK and goes to it; with git, a repo. project app exec pwd stdout '/app$' ! exists .git project repo git exec pwd stdout '/repo$' exists .git -- calls -- gpgv y -- state -- name=devvm-web-0123456789abcd image=base -- policy -- example.com -- other -- name=devvm-web-fedcba98765432 image=base