mimixbox

Summary #

540 suites · 1522 scenarios

Contents #

mimixbox ar #

Source: test/e2e/tools/mimixbox/archival/ar.atago.yaml

Scenario: lists members #

Given #

  • Fixture file a.txt is created.
  • Fixture file b.txt is created.

Inputs #

Fixture a.txt:

alpha

Fixture b.txt:

beta

When #

ar rc lib.a a.txt b.txt && ar t lib.a

Then #

  • exit code is 0
  • stdout equals an exact value
  • stdout equals an exact value

Scenario: extracts a member #

Given #

  • Fixture file a.txt is created.

Inputs #

Fixture a.txt:

alpha

When #

ar rc lib2.a a.txt && mkdir -p out && cd out && ar x ../lib2.a && cat a.txt

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox bunzip2 #

Source: test/e2e/tools/mimixbox/archival/bunzip2.atago.yaml

Scenario: decompresses a .bz2 file to stdout with -c #

When #

printf 'bunzip2 payload' | bzip2 -c > data.bz2 && bunzip2 -c data.bz2

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox bzcat #

Source: test/e2e/tools/mimixbox/archival/bzcat.atago.yaml

Scenario: describes itself with –help #

When #

bzcat --help

Then #

  • exit code is 0
  • stdout contains Usage: bzcat
  • stderr is empty

mimixbox bzip2 #

Source: test/e2e/tools/mimixbox/archival/bzip2.atago.yaml

Scenario: describes itself with –help #

When #

bzip2 --help

Then #

  • exit code is 0
  • stdout contains Usage: bzip2
  • stderr is empty

mimixbox compress and uncompress #

Source: test/e2e/tools/mimixbox/archival/compress.atago.yaml

Scenario: round-trips a file through compress and uncompress #

Given #

  • Fixture file data.txt is created.

Inputs #

Fixture data.txt:

compress me compress me compress me

When #

cp data.txt rt.txt && compress rt.txt && uncompress rt.txt.Z && cat rt.txt

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox cpio #

Source: test/e2e/tools/mimixbox/archival/cpio.atago.yaml

Scenario: round-trips a file through -o and -i #

Given #

  • Fixture file in/file.txt is created.

Inputs #

Fixture in/file.txt:

payload

When #

cd in
printf 'file.txt\n' | cpio -o > ../arch.cpio
cd ..
mkdir -p out && cd out
cpio -i < ../arch.cpio
cat file.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: lists archive contents with -i -t #

Given #

  • Fixture file in/file.txt is created.

Inputs #

Fixture in/file.txt:

payload

When #

cd in
printf 'file.txt\n' | cpio -o > ../arch2.cpio
cd ..
cpio -i -t < arch2.cpio

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox bzip2, lzop and Debian package applets #

Source: test/e2e/tools/mimixbox/archival/debcomp.atago.yaml

Scenario: bzip2 | bzip2 -dc round-trips data #

When #

printf 'roundtrip-bzip2\n' | bzip2 | bzip2 -dc

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: lzop | lzopcat round-trips data #

When #

printf 'roundtrip-lzop\n' | lzop | lzopcat

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: lzop | unlzop -c round-trips data #

When #

printf 'roundtrip-unlzop\n' | lzop | unlzop -c

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: dpkg-deb -c lists package contents #

Given #

  • Fixture file hello.deb is created.

When #

dpkg-deb -c hello.deb | grep -q 'usr/bin/hello' && printf 'has-hello\n'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: dpkg-deb -f prints a control field #

Given #

  • Fixture file hello.deb is created.

When #

dpkg-deb -f hello.deb Package

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: dpkg -x extracts the data tarball path-safely #

Given #

  • Fixture file hello.deb is created.

When #

dpkg -x hello.deb out
test -f out/usr/bin/hello && printf 'extracted\n'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: dpkg rejects unsupported database operations #

Given #

  • Fixture file hello.deb is created.

When #

if dpkg -i hello.deb 2>/dev/null; then
  printf 'unexpected-success\n'
else
  printf 'rejected\n'
fi

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox dpkg-deb #

Source: test/e2e/tools/mimixbox/archival/dpkg-deb.atago.yaml

Scenario: describes itself with –help #

When #

dpkg-deb --help

Then #

  • exit code is 0
  • stdout contains Usage: dpkg-deb
  • stderr is empty

mimixbox dpkg #

Source: test/e2e/tools/mimixbox/archival/dpkg.atago.yaml

Scenario: describes itself with –help #

When #

dpkg --help

Then #

  • exit code is 0
  • stdout contains Usage: dpkg
  • stderr is empty

mimixbox gunzip #

Source: test/e2e/tools/mimixbox/archival/gunzip.atago.yaml

Scenario: decompresses a .gz file to stdout with -c #

When #

printf 'gunzip payload' > data && gzip data && gunzip -c data.gz

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox archival commands expose a dedicated –help helper #

Source: test/e2e/tools/mimixbox/archival/help_helpers_archival.atago.yaml

Scenario: bzcat –help is structured #

When #

bzcat --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: bzip2 –help is structured #

When #

bzip2 --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: dpkg –help is structured #

When #

dpkg --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: dpkg-deb –help is structured #

When #

dpkg-deb --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: lzcat –help is structured #

When #

lzcat --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: lzma –help is structured #

When #

lzma --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: lzopcat –help is structured #

When #

lzopcat --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: pipe_progress –help is structured #

When #

pipe_progress --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: rpm2cpio –help is structured #

When #

rpm2cpio --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: uncompress –help is structured #

When #

uncompress --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: unlzma –help is structured #

When #

unlzma --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: unlzop –help is structured #

When #

unlzop --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: unxz –help is structured #

When #

unxz --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: unzip –help is structured #

When #

unzip --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: xz –help is structured #

When #

xz --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: xzcat –help is structured #

When #

xzcat --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: zcat –help is structured #

When #

zcat --help

Then #

  • exit code is 0
  • stdout contains Usage:

mimixbox rpm and rpm2cpio #

Source: test/e2e/tools/mimixbox/archival/rpm.atago.yaml

Scenario: queries the package identity with rpm -qp #

Given #

  • Fixture file sample.rpm is created.

When #

rpm -qp sample.rpm

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: lists package files with rpm -qpl #

Given #

  • Fixture file sample.rpm is created.

When #

rpm -qpl sample.rpm

Then #

  • exit code is 0
  • stdout equals an exact value
  • stdout equals an exact value

Scenario: extracts the payload with rpm2cpio #

Given #

  • Fixture file sample.rpm is created.

When #

rpm2cpio sample.rpm

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox rpm2cpio #

Source: test/e2e/tools/mimixbox/archival/rpm2cpio.atago.yaml

Scenario: describes itself with –help #

When #

rpm2cpio --help

Then #

  • exit code is 0
  • stdout contains Usage: rpm2cpio
  • stderr is empty

mimixbox tar #

Source: test/e2e/tools/mimixbox/archival/tar.atago.yaml

Scenario: creates and extracts an archive #

Given #

  • Fixture file src/a.txt is created.

Inputs #

Fixture src/a.txt:

alpha

When #

tar -c -f out.tar -C "${workdir}" src
mkdir -p dest
tar -x -f out.tar -C "${workdir}/dest"
cat dest/src/a.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: lists archive contents #

Given #

  • Fixture file src/a.txt is created.

Inputs #

Fixture src/a.txt:

alpha

When #

tar -c -f list.tar -C "${workdir}" src
tar -t -f list.tar

Then #

  • exit code is 0
  • stdout contains src/a.txt

mimixbox uncompress #

Source: test/e2e/tools/mimixbox/archival/uncompress.atago.yaml

Scenario: describes itself with –help #

When #

uncompress --help

Then #

  • exit code is 0
  • stdout contains Usage: uncompress
  • stderr is empty

mimixbox unlzma #

Source: test/e2e/tools/mimixbox/archival/unlzma.atago.yaml

Scenario: describes itself with –help #

When #

unlzma --help

Then #

  • exit code is 0
  • stdout contains Usage: unlzma
  • stderr is empty

mimixbox unlzop #

Source: test/e2e/tools/mimixbox/archival/unlzop.atago.yaml

Scenario: describes itself with –help #

When #

unlzop --help

Then #

  • exit code is 0
  • stdout contains Usage: unlzop
  • stderr is empty

mimixbox unxz #

Source: test/e2e/tools/mimixbox/archival/unxz.atago.yaml

Scenario: describes itself with –help #

When #

unxz --help

Then #

  • exit code is 0
  • stdout contains Usage: unxz
  • stderr is empty

mimixbox unzip #

Source: test/e2e/tools/mimixbox/archival/unzip.atago.yaml

Scenario: describes itself with –help #

When #

unzip --help

Then #

  • exit code is 0
  • stdout contains Usage: unzip
  • stderr is empty

mimixbox xz #

Source: test/e2e/tools/mimixbox/archival/xz.atago.yaml

Scenario: describes itself with –help #

When #

xz --help

Then #

  • exit code is 0
  • stdout contains Usage: xz
  • stderr is empty

mimixbox xzcat #

Source: test/e2e/tools/mimixbox/archival/xzcat.atago.yaml

Scenario: describes itself with –help #

When #

xzcat --help

Then #

  • exit code is 0
  • stdout contains Usage: xzcat
  • stderr is empty

mimixbox compression applets #

Source: test/e2e/tools/mimixbox/archival/xzcomp.atago.yaml

Scenario: xz | xzcat round-trips data #

When #

printf 'roundtrip-xz\n' | xz | xzcat

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: lzma | unlzma round-trips data #

When #

printf 'roundtrip-lzma\n' | lzma | unlzma

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: zcat decompresses a gzip file to stdout #

When #

printf 'gz-payload\n' | gzip > f.gz && zcat f.gz

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: pipe_progress passes stdin through to stdout #

When #

printf 'pass-through\n' | pipe_progress 2>/dev/null

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox zcat #

Source: test/e2e/tools/mimixbox/archival/zcat.atago.yaml

Scenario: describes itself with –help #

When #

zcat --help

Then #

  • exit code is 0
  • stdout contains Usage: zcat
  • stderr is empty

mimixbox zip and unzip #

Source: test/e2e/tools/mimixbox/archival/zip.atago.yaml

Scenario: lists a zipped file via unzip -l #

Given #

  • Fixture file a.txt is created.

Inputs #

Fixture a.txt:

zipped

When #

zip out.zip a.txt >/dev/null && unzip -l out.zip

Then #

  • exit code is 0
  • stdout contains a.txt

Scenario: round-trips a file through zip and unzip #

Given #

  • Fixture file a.txt is created.

Inputs #

Fixture a.txt:

zipped

When #

zip out2.zip a.txt >/dev/null
unzip -d dest out2.zip >/dev/null
cat dest/a.txt

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox [ #

Source: test/e2e/tools/mimixbox/compat/[.atago.yaml

Scenario: describes itself with –help #

When #

[ --help

Then #

  • exit code is 0
  • stdout contains Usage: [
  • stderr is empty

Scenario: documents its purpose in –help #

When #

[ --help

Then #

  • exit code is 0
  • stdout contains Evaluate EXPRESSION

mimixbox [[ #

Source: test/e2e/tools/mimixbox/compat/[[.atago.yaml

Scenario: describes itself with –help #

When #

[[ --help

Then #

  • exit code is 0
  • stdout contains Usage: [[
  • stderr is empty

Scenario: documents its purpose in –help #

When #

[[ --help

Then #

  • exit code is 0
  • stdout contains Evaluate EXPRESSION

mimixbox ash #

Source: test/e2e/tools/mimixbox/compat/ash.atago.yaml

Scenario: describes itself with –help #

When #

ash --help

Then #

  • exit code is 0
  • stdout contains Usage: ash
  • stderr is empty

Scenario: documents its purpose in –help #

When #

ash --help

Then #

  • exit code is 0
  • stdout contains compatibility front-end over MimixBox

mimixbox bash #

Source: test/e2e/tools/mimixbox/compat/bash.atago.yaml

Scenario: describes itself with –help #

When #

bash --help

Then #

  • exit code is 0
  • stdout contains Usage: bash
  • stderr is empty

Scenario: documents its purpose in –help #

When #

bash --help

Then #

  • exit code is 0
  • stdout contains compatibility front-end over MimixBox

mimixbox busybox #

Source: test/e2e/tools/mimixbox/compat/busybox.atago.yaml

Scenario: describes itself with –help #

When #

busybox --help

Then #

  • exit code is 0
  • stdout contains Usage: busybox
  • stderr is empty

Scenario: documents its purpose in –help #

When #

busybox --help

Then #

  • exit code is 0
  • stdout contains multi-call front-end

mimixbox compat front-ends #

Source: test/e2e/tools/mimixbox/compat/compat.atago.yaml

Scenario: the [ alias returns true for an existing file #

When #

mimixbox '[' -f /etc/hosts ']' && echo yes || echo no

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: the [ alias returns false for a missing file #

When #

mimixbox '[' -f /no/such/mimixbox/file ']' && echo yes || echo no

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: busybox dispatches to an applet #

Given #

  • Fixture file f is created.

Inputs #

Fixture f:

hello

When #

busybox cat f

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: busybox –list shows applets #

When #

busybox --list

Then #

  • exit code is 0
  • stdout contains cat
  • stdout contains busybox

Scenario: sh -c runs a command without a prompt #

When #

sh -c 'echo from-sh'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: bash reads a non-interactive script from stdin without a prompt #

When #

out=$(printf 'echo via-bash\n' | bash 2>/dev/null)
case "$out" in
    *"mbsh:"*) echo prompted ;;
    *via-bash*) echo ok ;;
    *) echo "$out" ;;
esac

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox cttyhack #

Source: test/e2e/tools/mimixbox/compat/cttyhack.atago.yaml

Scenario: describes itself with –help #

When #

cttyhack --help

Then #

  • exit code is 0
  • stdout contains Usage: cttyhack
  • stderr is empty

mimixbox compat commands expose a dedicated –help helper #

Source: test/e2e/tools/mimixbox/compat/help_helpers_compat.atago.yaml

Scenario: [ –help is structured #

When #

[ --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: [[ –help is structured #

When #

[[ --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: ash –help is structured #

When #

ash --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: bash –help is structured #

When #

bash --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: busybox –help is structured #

When #

busybox --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: cttyhack –help is structured #

When #

cttyhack --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: hush –help is structured #

When #

hush --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: unit –help is structured #

When #

unit --help

Then #

  • exit code is 0
  • stdout contains Usage:

mimixbox hush #

Source: test/e2e/tools/mimixbox/compat/hush.atago.yaml

Scenario: describes itself with –help #

When #

hush --help

Then #

  • exit code is 0
  • stdout contains Usage: hush
  • stderr is empty

Scenario: documents its purpose in –help #

When #

hush --help

Then #

  • exit code is 0
  • stdout contains compatibility front-end over MimixBox

mimixbox sh #

Source: test/e2e/tools/mimixbox/compat/sh.atago.yaml

Scenario: describes itself with –help #

When #

env sh --help

Then #

  • exit code is 0
  • stdout contains Usage: sh
  • stderr is empty

Scenario: documents its purpose in –help #

When #

env sh --help

Then #

  • exit code is 0
  • stdout contains compatibility front-end over MimixBox

mimixbox unit #

Source: test/e2e/tools/mimixbox/compat/unit.atago.yaml

Scenario: describes itself with –help #

When #

unit --help

Then #

  • exit code is 0
  • stdout contains Usage: unit
  • stderr is empty

Scenario: documents its purpose in –help #

When #

unit --help

Then #

  • exit code is 0
  • stdout contains does not embed

mimixbox adjtimex #

Source: test/e2e/tools/mimixbox/console-tools/adjtimex.atago.yaml

Scenario: describes itself with –help #

When #

adjtimex --help

Then #

  • exit code is 0
  • stdout contains Usage: adjtimex
  • stderr is empty

mimixbox ascii #

Source: test/e2e/tools/mimixbox/console-tools/ascii.atago.yaml

Scenario: prints 128 entries #

When #

ascii | grep -c .

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: maps code 65 to A #

When #

ascii | grep '0x41' | grep -c 'A'

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox bbconfig #

Source: test/e2e/tools/mimixbox/console-tools/bbconfig.atago.yaml

Scenario: prints the version line #

When #

bbconfig | grep -c 'CONFIG_MIMIXBOX_VERSION='

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: lists itself among the applets #

When #

bbconfig --names | grep -c '^bbconfig$'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: rejects an unexpected argument #

When #

bbconfig extra

Then #

  • exit code is 1

mimixbox beep #

Source: test/e2e/tools/mimixbox/console-tools/beep.atago.yaml

Scenario: rejects a non-positive frequency #

When #

beep -f 0

Then #

  • exit code is 1

Scenario: rejects a zero repeat count #

When #

beep -r 0

Then #

  • exit code is 1

mimixbox chat #

Source: test/e2e/tools/mimixbox/console-tools/chat.atago.yaml

Scenario: sends the reply after the expected string #

When #

printf 'OK' | chat OK GO | grep -c 'GO'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: requires a script #

When #

chat

Then #

  • exit code is 1

Scenario: fails when an expected string never arrives #

Inputs #

stdin for chat:

nope

When #

chat LOGIN: user

Then #

  • exit code is 1

mimixbox chvt #

Source: test/e2e/tools/mimixbox/console-tools/chvt.atago.yaml

Scenario: rejects a non-numeric VT #

When #

chvt notanumber

Then #

  • exit code is 1

Scenario: requires a VT number #

When #

chvt

Then #

  • exit code is 1

mimixbox clear #

Source: test/e2e/tools/mimixbox/console-tools/clear.atago.yaml

Scenario: prints usage with –help and exits 0 #

When #

clear --help

Then #

  • exit code is 0
  • stdout contains Usage: clear

Scenario: exits 0 when clearing the screen #

When #

clear

Then #

  • exit code is 0

mimixbox conspy #

Source: test/e2e/tools/mimixbox/console-tools/conspy.atago.yaml

Scenario: describes itself with –help #

When #

conspy --help

Then #

  • exit code is 0
  • stdout contains Usage: conspy
  • stderr is empty

mimixbox deallocvt #

Source: test/e2e/tools/mimixbox/console-tools/deallocvt.atago.yaml

Scenario: rejects a non-numeric VT #

When #

deallocvt notanumber

Then #

  • exit code is 1

Scenario: describes itself with –help #

When #

deallocvt --help

Then #

  • exit code is 0
  • stdout contains Usage: deallocvt, virtual terminal

mimixbox dumpkmap #

Source: test/e2e/tools/mimixbox/console-tools/dumpkmap.atago.yaml

Scenario: describes itself with –help #

When #

dumpkmap --help

Then #

  • exit code is 0
  • stdout contains Usage: dumpkmap
  • stderr is empty

mimixbox fgconsole #

Source: test/e2e/tools/mimixbox/console-tools/fgconsole.atago.yaml

Scenario: fails without a virtual console #

When #

fgconsole

Then #

  • exit code is 1

Scenario: describes itself with –help #

When #

fgconsole --help

Then #

  • exit code is 0
  • stdout contains Usage: fgconsole, virtual terminal

mimixbox console-tools –help contract #

Source: test/e2e/tools/mimixbox/console-tools/help_helpers_console-tools.atago.yaml

Scenario: adjtimex –help is structured #

When #

adjtimex --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: conspy –help is structured #

When #

conspy --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: dumpkmap –help is structured #

When #

dumpkmap --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: less –help is structured #

When #

less --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: loadfont –help is structured #

When #

loadfont --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: loadkmap –help is structured #

When #

loadkmap --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: microcom –help is structured #

When #

microcom --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: more –help is structured #

When #

more --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: openvt –help is structured #

When #

openvt --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: rx –help is structured #

When #

rx --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: setfont –help is structured #

When #

setfont --help

Then #

  • exit code is 0
  • stdout contains Usage:

mimixbox inotifyd #

Source: test/e2e/tools/mimixbox/console-tools/inotifyd.atago.yaml

Scenario: runs the handler on a create event #

When #

TEST_DIR="${workdir}/inotifyd"; mkdir -p "$TEST_DIR"
d="$TEST_DIR/w"; mkdir -p "$d"
printf '#!/bin/sh\necho "$1 $3" >> %s/events\n' "$TEST_DIR" > "$TEST_DIR/h"
chmod +x "$TEST_DIR/h"
: > "$TEST_DIR/events"
inotifyd "$TEST_DIR/h" "$d:n" &
pid=$!
found=missing
for _ in $(seq 1 50); do
    rm -f "$d/created.txt"
    touch "$d/created.txt"
    if grep -q 'n created.txt' "$TEST_DIR/events" 2>/dev/null; then
        found=ok
        break
    fi
    sleep 0.1
done
kill "$pid" 2>/dev/null
wait "$pid" 2>/dev/null
echo "$found"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: requires a handler and a file #

When #

inotifyd ./h

Then #

  • exit code is 1

mimixbox kbd_mode #

Source: test/e2e/tools/mimixbox/console-tools/kbd_mode.atago.yaml

Scenario: rejects conflicting mode options #

When #

kbd_mode -a -u

Then #

  • exit code is 1

Scenario: describes itself with –help #

When #

kbd_mode --help

Then #

  • exit code is 0
  • stdout contains Usage: kbd_mode, keyboard

mimixbox loadfont #

Source: test/e2e/tools/mimixbox/console-tools/loadfont.atago.yaml

Scenario: describes itself with –help #

When #

loadfont --help

Then #

  • exit code is 0
  • stdout contains Usage: loadfont
  • stderr is empty

mimixbox loadkmap #

Source: test/e2e/tools/mimixbox/console-tools/loadkmap.atago.yaml

Scenario: describes itself with –help #

When #

loadkmap --help

Then #

  • exit code is 0
  • stdout contains Usage: loadkmap
  • stderr is empty

mimixbox microcom #

Source: test/e2e/tools/mimixbox/console-tools/microcom.atago.yaml

Scenario: describes itself with –help #

When #

microcom --help

Then #

  • exit code is 0
  • stdout contains Usage: microcom
  • stderr is empty

mimixbox openvt #

Source: test/e2e/tools/mimixbox/console-tools/openvt.atago.yaml

Scenario: describes itself with –help #

When #

openvt --help

Then #

  • exit code is 0
  • stdout contains Usage: openvt
  • stderr is empty

mimixbox more / less #

Source: test/e2e/tools/mimixbox/console-tools/pager.atago.yaml

Scenario: more streams stdin through when stdout is not a terminal #

When #

printf 'a\nb\nc\n' | more

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

a
b
c

Scenario: less streams stdin through when stdout is not a terminal #

When #

printf 'x\ny\nz\n' | less

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

x
y
z

Scenario: more streams a file through #

Given #

  • Fixture file f is created.

Inputs #

Fixture f:

one
two

When #

more f

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

one
two

mimixbox reset #

Source: test/e2e/tools/mimixbox/console-tools/reset.atago.yaml

Scenario: prints usage with –help and exits 0 #

When #

reset --help

Then #

  • exit code is 0
  • stdout contains Usage: reset

mimixbox resize #

Source: test/e2e/tools/mimixbox/console-tools/resize.atago.yaml

Scenario: shows the usage line for –help #

When #

resize --help

Then #

  • exit code is 0
  • stdout contains Usage: resize

mimixbox rfkill #

Source: test/e2e/tools/mimixbox/console-tools/rfkill.atago.yaml

Scenario: lists devices cleanly #

When #

rfkill list

Then #

  • exit code is 0

Scenario: rejects an unknown command #

When #

rfkill bogus

Then #

  • exit code is 1

mimixbox rx #

Source: test/e2e/tools/mimixbox/console-tools/rx.atago.yaml

Scenario: describes itself with –help #

When #

rx --help

Then #

  • exit code is 0
  • stdout contains Usage: rx
  • stderr is empty

mimixbox setconsole #

Source: test/e2e/tools/mimixbox/console-tools/setconsole.atago.yaml

Scenario: fails on an inaccessible device #

When #

setconsole /dev/no_such_console

Then #

  • exit code is 1

Scenario: describes itself with –help #

When #

setconsole --help

Then #

  • exit code is 0
  • stdout contains Usage: setconsole, console

mimixbox setfont #

Source: test/e2e/tools/mimixbox/console-tools/setfont.atago.yaml

Scenario: describes itself with –help #

When #

setfont --help

Then #

  • exit code is 0
  • stdout contains Usage: setfont
  • stderr is empty

mimixbox setkeycodes #

Source: test/e2e/tools/mimixbox/console-tools/setkeycodes.atago.yaml

Scenario: requires arguments in pairs #

When #

setkeycodes e060

Then #

  • exit code is 1

Scenario: rejects an invalid scancode #

When #

setkeycodes zz 1

Then #

  • exit code is 1

mimixbox setlogcons #

Source: test/e2e/tools/mimixbox/console-tools/setlogcons.atago.yaml

Scenario: rejects a non-numeric VT #

When #

setlogcons notanumber

Then #

  • exit code is 1

Scenario: describes itself with –help #

When #

setlogcons --help

Then #

  • exit code is 0
  • stdout contains Usage: setlogcons, kernel

mimixbox setserial #

Source: test/e2e/tools/mimixbox/console-tools/setserial.atago.yaml

Scenario: echoes the parsed request with -g #

When #

setserial -g /dev/ttyS0 baud_base 115200 | grep -c 'baud_base 115200'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: rejects an unknown parameter #

When #

setserial /dev/ttyS0 bogus 1

Then #

  • exit code is 1

Scenario: requires a device #

When #

setserial

Then #

  • exit code is 1

mimixbox showkey #

Source: test/e2e/tools/mimixbox/console-tools/showkey.atago.yaml

Scenario: rejects conflicting modes #

When #

showkey -a -s

Then #

  • exit code is 1

Scenario: fails deterministically without a console #

When #

showkey

Then #

  • exit code is 1

mimixbox stty #

Source: test/e2e/tools/mimixbox/console-tools/stty.atago.yaml

Scenario: reports when standard input is not a terminal #

Inputs #

stdin for stty:

x

When #

stty

Then #

  • exit code is 1
  • stderr equals an exact value

mimixbox ts #

Source: test/e2e/tools/mimixbox/console-tools/ts.atago.yaml

Scenario: prefixes each line with a timestamp #

When #

printf 'alpha\nbeta\n' | ts | grep -cE '^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} (alpha|beta)$'

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox ttysize #

Source: test/e2e/tools/mimixbox/console-tools/ttysize.atago.yaml

Scenario: prints width and height #

When #

ttysize

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: prints just the width with w #

When #

ttysize w

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox coreutils slice #

Source: test/e2e/tools/mimixbox/coreutils/coreutils_slice.atago.yaml

Scenario: factor prints prime factors #

When #

factor 360

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: tsort topologically sorts #

When #

printf 'a b\nb c\n' | tsort

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

a
b
c

Scenario: egrep uses extended regular expressions #

When #

printf 'foo\nbar\nbaz\n' | egrep 'ba(r|z)'

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

bar
baz

Scenario: fgrep matches fixed strings literally #

When #

printf 'a.b\naxb\n' | fgrep 'a.b'

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox add-shell #

Source: test/e2e/tools/mimixbox/debianutils/add-shell.atago.yaml

Scenario: prints usage with –help and exits 0 #

When #

add-shell --help

Then #

  • exit code is 0
  • stdout contains Usage: add-shell

Scenario: fails with a message when given no operand #

When #

add-shell

Then #

  • exit code is not 0
  • stderr contains add-shell

mimixbox ischroot #

Source: test/e2e/tools/mimixbox/debianutils/ischroot.atago.yaml

Scenario: prints usage with –help and exits 0 #

When #

ischroot --help

Then #

  • exit code is 0
  • stdout contains Usage: ischroot

mimixbox mktemp #

Source: test/e2e/tools/mimixbox/debianutils/mktemp.atago.yaml

Scenario: creates a regular file under the temp dir #

When #

mkdir -p ${workdir}/mktemp
f=$(mktemp -p ${workdir}/mktemp)
test -f "$f" && echo "created"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: creates a directory #

When #

mkdir -p ${workdir}/mktemp
d=$(mktemp -d -p ${workdir}/mktemp)
test -d "$d" && echo "created"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: mktemp -u only prints a name #

When #

mkdir -p ${workdir}/mktemp
f=$(mktemp -u -p ${workdir}/mktemp)
test ! -e "$f" && echo "not created"

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox remove-shell #

Source: test/e2e/tools/mimixbox/debianutils/remove-shell.atago.yaml

Scenario: prints usage with –help and exits 0 #

When #

remove-shell --help

Then #

  • exit code is 0
  • stdout contains Usage: remove-shell

Scenario: fails with a message when given no operand #

When #

remove-shell

Then #

  • exit code is not 0
  • stderr contains remove-shell

mimixbox valid-shell #

Source: test/e2e/tools/mimixbox/debianutils/valid-shell.atago.yaml

Scenario: prints usage with –help and exits 0 #

When #

valid-shell --help

Then #

  • exit code is 0
  • stdout contains Usage: valid-shell

Scenario: accepts a file listing existing shells #

Given #

  • Fixture file shells.txt is created.

Inputs #

Fixture shells.txt:

/bin/sh
/bin/bash

When #

valid-shell shells.txt

Then #

  • exit code is 0
  • stdout contains OK

mimixbox awk #

Source: test/e2e/tools/mimixbox/editors/awk.atago.yaml

Scenario: prints a field #

When #

printf 'one two three\n' | awk '{print $2}'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: honors -F #

When #

printf 'root:x:0\n' | awk -F: '{print $1}'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: selects a record with NR #

When #

printf 'a\nb\nc\n' | awk 'NR==2'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: counts records in END #

When #

printf 'a\nb\nc\n' | awk 'END{print NR}'

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox diff #

Source: test/e2e/tools/mimixbox/editors/diff.atago.yaml

Scenario: reports a change in normal format #

Given #

  • Fixture file a is created.
  • Fixture file b is created.

Inputs #

Fixture a:

one
two
three

Fixture b:

one
2
three

When #

diff a b

Then #

  • exit code is 1
  • stdout equals an exact value

Scenario: is silent and succeeds for identical files #

Given #

  • Fixture file a is created.
  • Fixture file c is created.

Inputs #

Fixture a:

one
two
three

Fixture c:

one
two
three

When #

diff a c

Then #

  • exit code is 0
  • stdout is empty

Scenario: reports briefly with -q #

Given #

  • Fixture file a is created.
  • Fixture file b is created.

Inputs #

Fixture a:

one
two
three

Fixture b:

one
2
three

When #

diff -q a b

Then #

  • exit code is 1
  • stdout contains differ

mimixbox ed #

Source: test/e2e/tools/mimixbox/editors/ed.atago.yaml

Scenario: prints the buffer with size #

Given #

  • Fixture file buf.txt is created.

Inputs #

Fixture buf.txt:

one
two
three

stdin for ed:

1,$p
q

When #

ed buf.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

14
one
two
three

Scenario: appends a line and writes it #

Given #

  • Fixture file buf.txt is created.

Inputs #

Fixture buf.txt:

one
two
three

When #

printf '2a\nINSERTED\n.\nw\nq\n' | ed buf.txt > /dev/null
cat buf.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

one
two
INSERTED
three

Scenario: substitutes text on a line #

Given #

  • Fixture file buf.txt is created.

Inputs #

Fixture buf.txt:

one
two
three

When #

printf '2s/two/TWO/\nw\nq\n' | ed buf.txt > /dev/null
cat buf.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

one
TWO
three

mimixbox patch #

Source: test/e2e/tools/mimixbox/editors/patch.atago.yaml

Scenario: applies a unified diff #

Given #

  • Fixture file f.txt is created.
  • Fixture file p.diff is created.

Inputs #

Fixture f.txt:

one
two
three

Fixture p.diff:

--- ${workdir}/f.txt
+++ ${workdir}/f.txt
@@ -1,3 +1,3 @@
 one
-two
+2
 three

When #

patch -i p.diff
cat f.txt

Then #

  • after patch -i p.diff:
    • exit code is 0
  • after cat f.txt:
    • exit code is 0
    • stdout equals an exact value

Expected output #

expected stdout:

one
2
three

mimixbox sed #

Source: test/e2e/tools/mimixbox/editors/sed.atago.yaml

Scenario: substitutes the first match #

When #

printf 'hello world\n' | sed 's/world/sed/'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: substitutes globally #

When #

printf 'a a a\n' | sed 's/a/b/g'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: deletes a line by number #

When #

printf '1\n2\n3\n' | sed '2d'

Then #

  • exit code is 0
  • stdout equals an exact value
  • stdout equals an exact value

Scenario: prints a single line with -n #

When #

printf 'x\ny\nz\n' | sed -n '2p'

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox vi #

Source: test/e2e/tools/mimixbox/editors/vi.atago.yaml

Scenario: deletes a character and writes the file #

Given #

  • Fixture file a.txt is created.

Inputs #

Fixture a.txt:

hello
world

When #

printf 'x:wq\r' | vi a.txt
cat a.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

ello
world

Scenario: inserts text and writes the file #

Given #

  • Fixture file b.txt is created.

Inputs #

Fixture b.txt:

bar

When #

printf 'ifoo\033:wq\r' | vi b.txt
cat b.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: creates a new file #

When #

printf 'icreated\033:wq\r' | vi new.txt
cat new.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: treats an arrow-key escape sequence as a motion, not an edit #

Given #

  • Fixture file a.txt is created.

Inputs #

Fixture a.txt:

hello
world

When #

printf '\033[A!\033:wq\r' | vi a.txt
cat a.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

hello
world

Scenario: duplicates a line with yy then p #

Given #

  • Fixture file yp.txt is created.

Inputs #

Fixture yp.txt:

one
two

When #

printf 'yyp:wq\r' | vi yp.txt
cat yp.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

one
one
two

Scenario: applies a count to an edit (2x) #

Given #

  • Fixture file cd.txt is created.

Inputs #

Fixture cd.txt:

abcdef

When #

printf '2x:wq\r' | vi cd.txt
cat cd.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: undoes the last change with u #

Given #

  • Fixture file u.txt is created.

Inputs #

Fixture u.txt:

keepme

When #

printf 'xu:wq\r' | vi u.txt
cat u.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: searches with /pattern and moves to the next match with n #

Given #

  • Fixture file sn.txt is created.

Inputs #

Fixture sn.txt:

x
foo
y
foo
z

When #

printf '/foo\rndd:wq\r' | vi sn.txt
cat sn.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

x
foo
y
z

mimixbox devmem #

Source: test/e2e/tools/mimixbox/embedded/devmem.atago.yaml

Scenario: describes itself with –help #

When #

devmem --help

Then #

  • exit code is 0
  • stdout contains Usage: devmem
  • stderr is empty

mimixbox capability-gated applets #

Source: test/e2e/tools/mimixbox/embedded/gated_plan.atago.yaml

Scenario: netctl: brctl addbr prints the plan then fails with a capability-gated backend error #

When #

brctl addbr br0

Then #

  • exit code is not 0
  • stdout contains brctl: planned action: brctl addbr br0
  • stderr contains planned action [brctl addbr br0] requires privileged kernel network configuration not available in this environment (capability-gated backend)

Scenario: selinux: setenforce refuses to mutate SELinux state and exits non-zero #

When #

setenforce Permissive

Then #

  • exit code is not 0
  • stderr contains setenforce: refusing to mutate SELinux state: requires CAP_MAC_ADMIN and a loaded policy; this operation is intentionally not implemented in the hermetic build

Scenario: modutils: modprobe validates the module then fails on the CAP_SYS_MODULE gate #

When #

modprobe foo

Then #

  • exit code is not 0
  • stderr contains modprobe: load of foo validated successfully, but inserting/removing kernel modules requires CAP_SYS_MODULE; this privileged step is intentionally not implemented in the hermetic build

mimixbox getfattr #

Source: test/e2e/tools/mimixbox/embedded/getfattr.atago.yaml

Scenario: dumps a user attribute set by setfattr (or skips without xattr support) #

Given #

  • Fixture file file.txt is created.

When #

if ! setfattr -n user.demo -v hello file.txt 2>/dev/null; then
    echo "user.demo (skipped: filesystem has no xattr support)"
else
    getfattr -d file.txt | grep 'user.demo'
fi

Then #

  • exit code is 0
  • stdout contains user.demo

Scenario: fails when no file operand is given #

When #

getfattr

Then #

  • exit code is not 0
  • stderr contains file operand

Scenario: prints usage for –help #

When #

getfattr --help

Then #

  • exit code is 0
  • stdout contains Usage: getfattr

Scenario: prints the version line for –version #

When #

getfattr --version

Then #

  • exit code is 0
  • stdout contains getfattr (mimixbox)

mimixbox compression –help contract #

Source: test/e2e/tools/mimixbox/embedded/help_compression.atago.yaml

Scenario: xz –help exposes the documented sections #

When #

xz --help

Then #

  • exit code is 0
  • stdout matches /^Usage: xz/
  • stdout contains Examples:, Exit status:, xz

Scenario: unxz –help exposes the documented sections #

When #

unxz --help

Then #

  • exit code is 0
  • stdout matches /^Usage: unxz/
  • stdout contains Examples:, Exit status:, unxz

Scenario: xzcat –help exposes the documented sections #

When #

xzcat --help

Then #

  • exit code is 0
  • stdout matches /^Usage: xzcat/
  • stdout contains Examples:, Exit status:, xzcat

Scenario: lzma –help exposes the documented sections #

When #

lzma --help

Then #

  • exit code is 0
  • stdout matches /^Usage: lzma/
  • stdout contains Examples:, Exit status:, lzma

Scenario: unlzma –help exposes the documented sections #

When #

unlzma --help

Then #

  • exit code is 0
  • stdout matches /^Usage: unlzma/
  • stdout contains Examples:, Exit status:, unlzma

Scenario: lzcat –help exposes the documented sections #

When #

lzcat --help

Then #

  • exit code is 0
  • stdout matches /^Usage: lzcat/
  • stdout contains Examples:, Exit status:, lzcat

Scenario: lzop –help exposes the documented sections #

When #

lzop --help

Then #

  • exit code is 0
  • stdout matches /^Usage: lzop/
  • stdout contains Examples:, Exit status:, lzop

Scenario: unlzop –help exposes the documented sections #

When #

unlzop --help

Then #

  • exit code is 0
  • stdout matches /^Usage: unlzop/
  • stdout contains Examples:, Exit status:, unlzop

Scenario: lzopcat –help exposes the documented sections #

When #

lzopcat --help

Then #

  • exit code is 0
  • stdout matches /^Usage: lzopcat/
  • stdout contains Examples:, Exit status:, lzopcat

Scenario: zcat –help exposes the documented sections #

When #

zcat --help

Then #

  • exit code is 0
  • stdout matches /^Usage: zcat/
  • stdout contains Examples:, Exit status:, zcat

Scenario: bzcat –help exposes the documented sections #

When #

bzcat --help

Then #

  • exit code is 0
  • stdout matches /^Usage: bzcat/
  • stdout contains Examples:, Exit status:, bzcat

Scenario: unit –help exposes the documented sections #

When #

unit --help

Then #

  • exit code is 0
  • stdout matches /^Usage: unit/
  • stdout contains Examples:, Exit status:, unit

mimixbox –help exit-status contract #

Source: test/e2e/tools/mimixbox/embedded/help_exit_status.atago.yaml

Scenario: ash –help exposes the documented sections #

When #

ash --help

Then #

  • exit code is 0
  • stdout matches /^Usage: ash/
  • stdout contains Exit status:

Scenario: bash –help exposes the documented sections #

When #

bash --help

Then #

  • exit code is 0
  • stdout matches /^Usage: bash/
  • stdout contains Exit status:

Scenario: bc –help exposes the documented sections #

When #

bc --help

Then #

  • exit code is 0
  • stdout matches /^Usage: bc/
  • stdout contains Exit status:

Scenario: busybox –help exposes the documented sections #

When #

busybox --help

Then #

  • exit code is 0
  • stdout matches /^Usage: busybox/
  • stdout contains Exit status:

Scenario: cttyhack –help exposes the documented sections #

When #

cttyhack --help

Then #

  • exit code is 0
  • stdout matches /^Usage: cttyhack/
  • stdout contains Exit status:

Scenario: dc –help exposes the documented sections #

When #

dc --help

Then #

  • exit code is 0
  • stdout matches /^Usage: dc/
  • stdout contains Exit status:

Scenario: ed –help exposes the documented sections #

When #

ed --help

Then #

  • exit code is 0
  • stdout matches /^Usage: ed/
  • stdout contains Exit status:

Scenario: hd –help exposes the documented sections #

When #

hd --help

Then #

  • exit code is 0
  • stdout matches /^Usage: hd/
  • stdout contains Exit status:

Scenario: hexdump –help exposes the documented sections #

When #

hexdump --help

Then #

  • exit code is 0
  • stdout matches /^Usage: hexdump/
  • stdout contains Exit status:

Scenario: hush –help exposes the documented sections #

When #

hush --help

Then #

  • exit code is 0
  • stdout matches /^Usage: hush/
  • stdout contains Exit status:

Scenario: iostat –help exposes the documented sections #

When #

iostat --help

Then #

  • exit code is 0
  • stdout matches /^Usage: iostat/
  • stdout contains Exit status:

Scenario: ipcs –help exposes the documented sections #

When #

ipcs --help

Then #

  • exit code is 0
  • stdout matches /^Usage: ipcs/
  • stdout contains Exit status:

Scenario: last –help exposes the documented sections #

When #

last --help

Then #

  • exit code is 0
  • stdout matches /^Usage: last/
  • stdout contains Exit status:

Scenario: less –help exposes the documented sections #

When #

less --help

Then #

  • exit code is 0
  • stdout matches /^Usage: less/
  • stdout contains Exit status:

Scenario: lsblk –help exposes the documented sections #

When #

lsblk --help

Then #

  • exit code is 0
  • stdout matches /^Usage: lsblk/
  • stdout contains Exit status:

Scenario: lspci –help exposes the documented sections #

When #

lspci --help

Then #

  • exit code is 0
  • stdout matches /^Usage: lspci/
  • stdout contains Exit status:

Scenario: lsusb –help exposes the documented sections #

When #

lsusb --help

Then #

  • exit code is 0
  • stdout matches /^Usage: lsusb/
  • stdout contains Exit status:

Scenario: mbsh –help exposes the documented sections #

When #

mbsh --help

Then #

  • exit code is 0
  • stdout matches /^Usage: mbsh/
  • stdout contains Exit status:

Scenario: minips –help exposes the documented sections #

When #

minips --help

Then #

  • exit code is 0
  • stdout matches /^Usage: minips/
  • stdout contains Exit status:

Scenario: more –help exposes the documented sections #

When #

more --help

Then #

  • exit code is 0
  • stdout matches /^Usage: more/
  • stdout contains Exit status:

Scenario: mpstat –help exposes the documented sections #

When #

mpstat --help

Then #

  • exit code is 0
  • stdout matches /^Usage: mpstat/
  • stdout contains Exit status:

Scenario: nmeter –help exposes the documented sections #

When #

nmeter --help

Then #

  • exit code is 0
  • stdout matches /^Usage: nmeter/
  • stdout contains Exit status:

Scenario: pipe_progress –help exposes the documented sections #

When #

pipe_progress --help

Then #

  • exit code is 0
  • stdout matches /^Usage: pipe_progress/
  • stdout contains Exit status:

Scenario: powertop –help exposes the documented sections #

When #

powertop --help

Then #

  • exit code is 0
  • stdout matches /^Usage: powertop/
  • stdout contains Exit status:

Scenario: ps –help exposes the documented sections #

When #

ps --help

Then #

  • exit code is 0
  • stdout matches /^Usage: ps/
  • stdout contains Exit status:

Scenario: pstree –help exposes the documented sections #

When #

pstree --help

Then #

  • exit code is 0
  • stdout matches /^Usage: pstree/
  • stdout contains Exit status:

Scenario: sh –help exposes the documented sections #

When #

sh --help

Then #

  • exit code is 0
  • stdout matches /^Usage: sh/
  • stdout contains Exit status:

Scenario: smemcap –help exposes the documented sections #

When #

smemcap --help

Then #

  • exit code is 0
  • stdout matches /^Usage: smemcap/
  • stdout contains Exit status:

Scenario: top –help exposes the documented sections #

When #

top --help

Then #

  • exit code is 0
  • stdout matches /^Usage: top/
  • stdout contains Exit status:

Scenario: uptime –help exposes the documented sections #

When #

uptime --help

Then #

  • exit code is 0
  • stdout matches /^Usage: uptime/
  • stdout contains Exit status:

Scenario: users –help exposes the documented sections #

When #

users --help

Then #

  • exit code is 0
  • stdout matches /^Usage: users/
  • stdout contains Exit status:

Scenario: uudecode –help exposes the documented sections #

When #

uudecode --help

Then #

  • exit code is 0
  • stdout matches /^Usage: uudecode/
  • stdout contains Exit status:

Scenario: uuencode –help exposes the documented sections #

When #

uuencode --help

Then #

  • exit code is 0
  • stdout matches /^Usage: uuencode/
  • stdout contains Exit status:

Scenario: vi –help exposes the documented sections #

When #

vi --help

Then #

  • exit code is 0
  • stdout matches /^Usage: vi/
  • stdout contains Exit status:

Scenario: vmstat –help exposes the documented sections #

When #

vmstat --help

Then #

  • exit code is 0
  • stdout matches /^Usage: vmstat/
  • stdout contains Exit status:

Scenario: w –help exposes the documented sections #

When #

w --help

Then #

  • exit code is 0
  • stdout matches /^Usage: w/
  • stdout contains Exit status:

Scenario: wall –help exposes the documented sections #

When #

wall --help

Then #

  • exit code is 0
  • stdout matches /^Usage: wall/
  • stdout contains Exit status:

mimixbox embedded –help helpers #

Source: test/e2e/tools/mimixbox/embedded/help_helpers_embedded.atago.yaml

Scenario: devmem –help is structured #

When #

devmem --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: i2cdetect –help is structured #

When #

i2cdetect --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: i2cdump –help is structured #

When #

i2cdump --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: i2cget –help is structured #

When #

i2cget --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: i2cset –help is structured #

When #

i2cset --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: partprobe –help is structured #

When #

partprobe --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: raidautorun –help is structured #

When #

raidautorun --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: readahead –help is structured #

When #

readahead --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: resume –help is structured #

When #

resume --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: seedrng –help is structured #

When #

seedrng --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: volname –help is structured #

When #

volname --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: watchdog –help is structured #

When #

watchdog --help

Then #

  • exit code is 0
  • stdout contains Usage:

mimixbox –help Notes contract #

Source: test/e2e/tools/mimixbox/embedded/help_notes.atago.yaml

Scenario: acpid –help exposes the documented sections #

When #

acpid --help

Then #

  • exit code is 0
  • stdout matches /^Usage: acpid/
  • stdout contains Notes:

Scenario: brctl –help exposes the documented sections #

When #

brctl --help

Then #

  • exit code is 0
  • stdout matches /^Usage: brctl/
  • stdout contains Notes:

Scenario: crond –help exposes the documented sections #

When #

crond --help

Then #

  • exit code is 0
  • stdout matches /^Usage: crond/
  • stdout contains Notes:

Scenario: ifenslave –help exposes the documented sections #

When #

ifenslave --help

Then #

  • exit code is 0
  • stdout matches /^Usage: ifenslave/
  • stdout contains Notes:

Scenario: mkfs.reiser –help exposes the documented sections #

When #

mkfs.reiser --help

Then #

  • exit code is 0
  • stdout matches /^Usage: mkfs\.reiser/
  • stdout contains Notes:

Scenario: nbd-client –help exposes the documented sections #

When #

nbd-client --help

Then #

  • exit code is 0
  • stdout matches /^Usage: nbd\-client/
  • stdout contains Notes:

Scenario: ssl_server –help exposes the documented sections #

When #

ssl_server --help

Then #

  • exit code is 0
  • stdout matches /^Usage: ssl_server/
  • stdout contains Notes:

Scenario: tunctl –help exposes the documented sections #

When #

tunctl --help

Then #

  • exit code is 0
  • stdout matches /^Usage: tunctl/
  • stdout contains Notes:

Scenario: vconfig –help exposes the documented sections #

When #

vconfig --help

Then #

  • exit code is 0
  • stdout matches /^Usage: vconfig/
  • stdout contains Notes:

Scenario: zcip –help exposes the documented sections #

When #

zcip --help

Then #

  • exit code is 0
  • stdout matches /^Usage: zcip/
  • stdout contains Notes:

Scenario: [ –help exposes the documented sections #

When #

env [ --help

Then #

  • exit code is 0
  • stdout matches /^Usage: \[/
  • stdout contains Notes:

Scenario: [[ –help exposes the documented sections #

When #

env [[ --help

Then #

  • exit code is 0
  • stdout matches /^Usage: \[\[/
  • stdout contains Notes:

mimixbox structured –help sections #

Source: test/e2e/tools/mimixbox/embedded/help_structured_sections.atago.yaml

Scenario: ln –help exposes the documented sections #

When #

ln --help

Then #

  • exit code is 0
  • stdout matches /^Usage: ln/
  • stdout contains Examples:, Exit status:, ln

Scenario: log-collect –help exposes the documented sections #

When #

log-collect --help

Then #

  • exit code is 0
  • stdout matches /^Usage: log\-collect/
  • stdout contains Examples:, Exit status:, log-collect

Scenario: logname –help exposes the documented sections #

When #

logname --help

Then #

  • exit code is 0
  • stdout matches /^Usage: logname/
  • stdout contains Examples:, Exit status:, logname

Scenario: md5sum –help exposes the documented sections #

When #

md5sum --help

Then #

  • exit code is 0
  • stdout matches /^Usage: md5sum/
  • stdout contains Examples:, Exit status:, md5sum

Scenario: mkdir –help exposes the documented sections #

When #

mkdir --help

Then #

  • exit code is 0
  • stdout matches /^Usage: mkdir/
  • stdout contains Examples:, Exit status:, mkdir

Scenario: mkfifo –help exposes the documented sections #

When #

mkfifo --help

Then #

  • exit code is 0
  • stdout matches /^Usage: mkfifo/
  • stdout contains Examples:, Exit status:, mkfifo

Scenario: mknod –help exposes the documented sections #

When #

mknod --help

Then #

  • exit code is 0
  • stdout matches /^Usage: mknod/
  • stdout contains Examples:, Exit status:, mknod

Scenario: mktemp –help exposes the documented sections #

When #

mktemp --help

Then #

  • exit code is 0
  • stdout matches /^Usage: mktemp/
  • stdout contains Examples:, Exit status:, mktemp

Scenario: mountpoint –help exposes the documented sections #

When #

mountpoint --help

Then #

  • exit code is 0
  • stdout matches /^Usage: mountpoint/
  • stdout contains Examples:, Exit status:, mountpoint

Scenario: mv –help exposes the documented sections #

When #

mv --help

Then #

  • exit code is 0
  • stdout matches /^Usage: mv/
  • stdout contains Examples:, Exit status:, mv

Scenario: nc –help exposes the documented sections #

When #

nc --help

Then #

  • exit code is 0
  • stdout matches /^Usage: nc/
  • stdout contains Examples:, Exit status:, nc

Scenario: netcat –help exposes the documented sections #

When #

netcat --help

Then #

  • exit code is 0
  • stdout matches /^Usage: netcat/
  • stdout contains Examples:, Exit status:, netcat

Scenario: nl –help exposes the documented sections #

When #

nl --help

Then #

  • exit code is 0
  • stdout matches /^Usage: nl/
  • stdout contains Examples:, Exit status:, nl

Scenario: nohup –help exposes the documented sections #

When #

nohup --help

Then #

  • exit code is 0
  • stdout matches /^Usage: nohup/
  • stdout contains Examples:, Exit status:, nohup

Scenario: nproc –help exposes the documented sections #

When #

nproc --help

Then #

  • exit code is 0
  • stdout matches /^Usage: nproc/
  • stdout contains Examples:, Exit status:, nproc

Scenario: nyancat –help exposes the documented sections #

When #

nyancat --help

Then #

  • exit code is 0
  • stdout matches /^Usage: nyancat/
  • stdout contains Examples:, Exit status:, nyancat

Scenario: od –help exposes the documented sections #

When #

od --help

Then #

  • exit code is 0
  • stdout matches /^Usage: od/
  • stdout contains Examples:, Exit status:, od

Scenario: paste –help exposes the documented sections #

When #

paste --help

Then #

  • exit code is 0
  • stdout matches /^Usage: paste/
  • stdout contains Examples:, Exit status:, paste

Scenario: patch –help exposes the documented sections #

When #

patch --help

Then #

  • exit code is 0
  • stdout matches /^Usage: patch/
  • stdout contains Examples:, Exit status:, patch

Scenario: path –help exposes the documented sections #

When #

path --help

Then #

  • exit code is 0
  • stdout matches /^Usage: path/
  • stdout contains Examples:, Exit status:, path

Scenario: pidof –help exposes the documented sections #

When #

pidof --help

Then #

  • exit code is 0
  • stdout matches /^Usage: pidof/
  • stdout contains Examples:, Exit status:, pidof

Scenario: ping –help exposes the documented sections #

When #

ping --help

Then #

  • exit code is 0
  • stdout matches /^Usage: ping/
  • stdout contains Examples:, Exit status:, ping

Scenario: posixer –help exposes the documented sections #

When #

posixer --help

Then #

  • exit code is 0
  • stdout matches /^Usage: posixer/
  • stdout contains Examples:, Exit status:, posixer

Scenario: poweroff –help exposes the documented sections #

When #

poweroff --help

Then #

  • exit code is 0
  • stdout matches /^Usage: poweroff/
  • stdout contains Examples:, Exit status:, poweroff

Scenario: printenv –help exposes the documented sections #

When #

printenv --help

Then #

  • exit code is 0
  • stdout matches /^Usage: printenv/
  • stdout contains Examples:, Exit status:, printenv

Scenario: pwcrack –help exposes the documented sections #

When #

pwcrack --help

Then #

  • exit code is 0
  • stdout matches /^Usage: pwcrack/
  • stdout contains Examples:, Exit status:, pwcrack

Scenario: pwgen –help exposes the documented sections #

When #

pwgen --help

Then #

  • exit code is 0
  • stdout matches /^Usage: pwgen/
  • stdout contains Examples:, Exit status:, pwgen

Scenario: pwscore –help exposes the documented sections #

When #

pwscore --help

Then #

  • exit code is 0
  • stdout matches /^Usage: pwscore/
  • stdout contains Examples:, Exit status:, pwscore

When #

readlink --help

Then #

  • exit code is 0
  • stdout matches /^Usage: readlink/
  • stdout contains Examples:, Exit status:, readlink

Scenario: realpath –help exposes the documented sections #

When #

realpath --help

Then #

  • exit code is 0
  • stdout matches /^Usage: realpath/
  • stdout contains Examples:, Exit status:, realpath

Scenario: reboot –help exposes the documented sections #

When #

reboot --help

Then #

  • exit code is 0
  • stdout matches /^Usage: reboot/
  • stdout contains Examples:, Exit status:, reboot

Scenario: remove-shell –help exposes the documented sections #

When #

remove-shell --help

Then #

  • exit code is 0
  • stdout matches /^Usage: remove\-shell/
  • stdout contains Examples:, Exit status:, remove-shell

Scenario: reset –help exposes the documented sections #

When #

reset --help

Then #

  • exit code is 0
  • stdout matches /^Usage: reset/
  • stdout contains Examples:, Exit status:, reset

Scenario: resize –help exposes the documented sections #

When #

resize --help

Then #

  • exit code is 0
  • stdout matches /^Usage: resize/
  • stdout contains Examples:, Exit status:, resize

Scenario: rev –help exposes the documented sections #

When #

rev --help

Then #

  • exit code is 0
  • stdout matches /^Usage: rev/
  • stdout contains Examples:, Exit status:, rev

Scenario: rm –help exposes the documented sections #

When #

rm --help

Then #

  • exit code is 0
  • stdout matches /^Usage: rm/
  • stdout contains Examples:, Exit status:, rm

Scenario: rmdir –help exposes the documented sections #

When #

rmdir --help

Then #

  • exit code is 0
  • stdout matches /^Usage: rmdir/
  • stdout contains Examples:, Exit status:, rmdir

Scenario: rpm –help exposes the documented sections #

When #

rpm --help

Then #

  • exit code is 0
  • stdout matches /^Usage: rpm/
  • stdout contains Examples:, Exit status:, rpm

Scenario: rpm2cpio –help exposes the documented sections #

When #

rpm2cpio --help

Then #

  • exit code is 0
  • stdout matches /^Usage: rpm2cpio/
  • stdout contains Examples:, Exit status:, rpm2cpio

Scenario: sddf –help exposes the documented sections #

When #

sddf --help

Then #

  • exit code is 0
  • stdout matches /^Usage: sddf/
  • stdout contains Examples:, Exit status:, sddf

Scenario: sed –help exposes the documented sections #

When #

sed --help

Then #

  • exit code is 0
  • stdout matches /^Usage: sed/
  • stdout contains Examples:, Exit status:, sed

Scenario: seq –help exposes the documented sections #

When #

seq --help

Then #

  • exit code is 0
  • stdout matches /^Usage: seq/
  • stdout contains Examples:, Exit status:, seq

Scenario: serial –help exposes the documented sections #

When #

serial --help

Then #

  • exit code is 0
  • stdout matches /^Usage: serial/
  • stdout contains Examples:, Exit status:, serial

Scenario: sha1sum –help exposes the documented sections #

When #

sha1sum --help

Then #

  • exit code is 0
  • stdout matches /^Usage: sha1sum/
  • stdout contains Examples:, Exit status:, sha1sum

Scenario: sha256sum –help exposes the documented sections #

When #

sha256sum --help

Then #

  • exit code is 0
  • stdout matches /^Usage: sha256sum/
  • stdout contains Examples:, Exit status:, sha256sum

Scenario: sha384sum –help exposes the documented sections #

When #

sha384sum --help

Then #

  • exit code is 0
  • stdout matches /^Usage: sha384sum/
  • stdout contains Examples:, Exit status:, sha384sum

Scenario: sha3sum –help exposes the documented sections #

When #

sha3sum --help

Then #

  • exit code is 0
  • stdout matches /^Usage: sha3sum/
  • stdout contains Examples:, Exit status:, sha3sum

Scenario: sha512sum –help exposes the documented sections #

When #

sha512sum --help

Then #

  • exit code is 0
  • stdout matches /^Usage: sha512sum/
  • stdout contains Examples:, Exit status:, sha512sum

Scenario: shred –help exposes the documented sections #

When #

shred --help

Then #

  • exit code is 0
  • stdout matches /^Usage: shred/
  • stdout contains Examples:, Exit status:, shred

Scenario: shuf –help exposes the documented sections #

When #

shuf --help

Then #

  • exit code is 0
  • stdout matches /^Usage: shuf/
  • stdout contains Examples:, Exit status:, shuf

Scenario: sl –help exposes the documented sections #

When #

sl --help

Then #

  • exit code is 0
  • stdout matches /^Usage: sl/
  • stdout contains Examples:, Exit status:, sl

Scenario: sleep –help exposes the documented sections #

When #

sleep --help

Then #

  • exit code is 0
  • stdout matches /^Usage: sleep/
  • stdout contains Examples:, Exit status:, sleep

Scenario: sort –help exposes the documented sections #

When #

sort --help

Then #

  • exit code is 0
  • stdout matches /^Usage: sort/
  • stdout contains Examples:, Exit status:, sort

Scenario: speaker –help exposes the documented sections #

When #

speaker --help

Then #

  • exit code is 0
  • stdout matches /^Usage: speaker/
  • stdout contains Examples:, Exit status:, speaker

Scenario: split –help exposes the documented sections #

When #

split --help

Then #

  • exit code is 0
  • stdout matches /^Usage: split/
  • stdout contains Examples:, Exit status:, split

Scenario: stat –help exposes the documented sections #

When #

stat --help

Then #

  • exit code is 0
  • stdout matches /^Usage: stat/
  • stdout contains Examples:, Exit status:, stat

Scenario: strings –help exposes the documented sections #

When #

strings --help

Then #

  • exit code is 0
  • stdout matches /^Usage: strings/
  • stdout contains Examples:, Exit status:, strings

Scenario: sync –help exposes the documented sections #

When #

sync --help

Then #

  • exit code is 0
  • stdout matches /^Usage: sync/
  • stdout contains Examples:, Exit status:, sync

Scenario: tac –help exposes the documented sections #

When #

tac --help

Then #

  • exit code is 0
  • stdout matches /^Usage: tac/
  • stdout contains Examples:, Exit status:, tac

Scenario: tar –help exposes the documented sections #

When #

tar --help

Then #

  • exit code is 0
  • stdout matches /^Usage: tar/
  • stdout contains Examples:, Exit status:, tar

Scenario: tee –help exposes the documented sections #

When #

tee --help

Then #

  • exit code is 0
  • stdout matches /^Usage: tee/
  • stdout contains Examples:, Exit status:, tee

Scenario: timeout –help exposes the documented sections #

When #

timeout --help

Then #

  • exit code is 0
  • stdout matches /^Usage: timeout/
  • stdout contains Examples:, Exit status:, timeout

Scenario: touch –help exposes the documented sections #

When #

touch --help

Then #

  • exit code is 0
  • stdout matches /^Usage: touch/
  • stdout contains Examples:, Exit status:, touch

Scenario: tr –help exposes the documented sections #

When #

tr --help

Then #

  • exit code is 0
  • stdout matches /^Usage: tr/
  • stdout contains Examples:, Exit status:, tr

Scenario: truncate –help exposes the documented sections #

When #

truncate --help

Then #

  • exit code is 0
  • stdout matches /^Usage: truncate/
  • stdout contains Examples:, Exit status:, truncate

Scenario: tty –help exposes the documented sections #

When #

tty --help

Then #

  • exit code is 0
  • stdout matches /^Usage: tty/
  • stdout contains Examples:, Exit status:, tty

Scenario: uname –help exposes the documented sections #

When #

uname --help

Then #

  • exit code is 0
  • stdout matches /^Usage: uname/
  • stdout contains Examples:, Exit status:, uname

Scenario: uncompress –help exposes the documented sections #

When #

uncompress --help

Then #

  • exit code is 0
  • stdout matches /^Usage: uncompress/
  • stdout contains Examples:, Exit status:, uncompress

Scenario: unexpand –help exposes the documented sections #

When #

unexpand --help

Then #

  • exit code is 0
  • stdout matches /^Usage: unexpand/
  • stdout contains Examples:, Exit status:, unexpand

Scenario: uniq –help exposes the documented sections #

When #

uniq --help

Then #

  • exit code is 0
  • stdout matches /^Usage: uniq/
  • stdout contains Examples:, Exit status:, uniq

Scenario: unix2dos –help exposes the documented sections #

When #

unix2dos --help

Then #

  • exit code is 0
  • stdout matches /^Usage: unix2dos/
  • stdout contains Examples:, Exit status:, unix2dos

When #

unlink --help

Then #

  • exit code is 0
  • stdout matches /^Usage: unlink/
  • stdout contains Examples:, Exit status:, unlink

Scenario: unshadow –help exposes the documented sections #

When #

unshadow --help

Then #

  • exit code is 0
  • stdout matches /^Usage: unshadow/
  • stdout contains Examples:, Exit status:, unshadow

Scenario: unzip –help exposes the documented sections #

When #

unzip --help

Then #

  • exit code is 0
  • stdout matches /^Usage: unzip/
  • stdout contains Examples:, Exit status:, unzip

Scenario: uuidgen –help exposes the documented sections #

When #

uuidgen --help

Then #

  • exit code is 0
  • stdout matches /^Usage: uuidgen/
  • stdout contains Examples:, Exit status:, uuidgen

Scenario: valid-shell –help exposes the documented sections #

When #

valid-shell --help

Then #

  • exit code is 0
  • stdout matches /^Usage: valid\-shell/
  • stdout contains Examples:, Exit status:, valid-shell

Scenario: watch –help exposes the documented sections #

When #

watch --help

Then #

  • exit code is 0
  • stdout matches /^Usage: watch/
  • stdout contains Examples:, Exit status:, watch

Scenario: wc –help exposes the documented sections #

When #

wc --help

Then #

  • exit code is 0
  • stdout matches /^Usage: wc/
  • stdout contains Examples:, Exit status:, wc

Scenario: which –help exposes the documented sections #

When #

which --help

Then #

  • exit code is 0
  • stdout matches /^Usage: which/
  • stdout contains Examples:, Exit status:, which

Scenario: who –help exposes the documented sections #

When #

who --help

Then #

  • exit code is 0
  • stdout matches /^Usage: who/
  • stdout contains Examples:, Exit status:, who

Scenario: whoami –help exposes the documented sections #

When #

whoami --help

Then #

  • exit code is 0
  • stdout matches /^Usage: whoami/
  • stdout contains Examples:, Exit status:, whoami

Scenario: whris –help exposes the documented sections #

When #

whris --help

Then #

  • exit code is 0
  • stdout matches /^Usage: whris/
  • stdout contains Examples:, Exit status:, whris

Scenario: xargs –help exposes the documented sections #

When #

xargs --help

Then #

  • exit code is 0
  • stdout matches /^Usage: xargs/
  • stdout contains Examples:, Exit status:, xargs

Scenario: xxd –help exposes the documented sections #

When #

xxd --help

Then #

  • exit code is 0
  • stdout matches /^Usage: xxd/
  • stdout contains Examples:, Exit status:, xxd

Scenario: yes –help exposes the documented sections #

When #

yes --help

Then #

  • exit code is 0
  • stdout matches /^Usage: yes/
  • stdout contains Examples:, Exit status:, yes

Scenario: zip –help exposes the documented sections #

When #

zip --help

Then #

  • exit code is 0
  • stdout matches /^Usage: zip/
  • stdout contains Examples:, Exit status:, zip

Scenario: zip-pwcrack –help exposes the documented sections #

When #

zip-pwcrack --help

Then #

  • exit code is 0
  • stdout matches /^Usage: zip\-pwcrack/
  • stdout contains Examples:, Exit status:, zip-pwcrack

Scenario: true –help exposes the documented sections #

When #

env true --help

Then #

  • exit code is 0
  • stdout matches /^Usage: true/
  • stdout contains Examples:, Exit status:, true

Scenario: test –help exposes the documented sections #

When #

env test --help

Then #

  • exit code is 0
  • stdout matches /^Usage: test/
  • stdout contains Examples:, Exit status:, test

Scenario: printf –help exposes the documented sections #

When #

env printf --help

Then #

  • exit code is 0
  • stdout matches /^Usage: printf/
  • stdout contains Examples:, Exit status:, printf

Scenario: pwd –help exposes the documented sections #

When #

env pwd --help

Then #

  • exit code is 0
  • stdout matches /^Usage: pwd/
  • stdout contains Examples:, Exit status:, pwd

mimixbox structured –help sections (2) #

Source: test/e2e/tools/mimixbox/embedded/help_structured_sections_2.atago.yaml

Scenario: add-shell –help exposes the documented sections #

When #

add-shell --help

Then #

  • exit code is 0
  • stdout matches /^Usage: add\-shell/
  • stdout contains Examples:, Exit status:, add-shell

Scenario: ar –help exposes the documented sections #

When #

ar --help

Then #

  • exit code is 0
  • stdout matches /^Usage: ar/
  • stdout contains Examples:, Exit status:, ar

Scenario: arch –help exposes the documented sections #

When #

arch --help

Then #

  • exit code is 0
  • stdout matches /^Usage: arch/
  • stdout contains Examples:, Exit status:, arch

Scenario: awk –help exposes the documented sections #

When #

awk --help

Then #

  • exit code is 0
  • stdout matches /^Usage: awk/
  • stdout contains Examples:, Exit status:, awk

Scenario: banner –help exposes the documented sections #

When #

banner --help

Then #

  • exit code is 0
  • stdout matches /^Usage: banner/
  • stdout contains Examples:, Exit status:, banner

Scenario: base32 –help exposes the documented sections #

When #

base32 --help

Then #

  • exit code is 0
  • stdout matches /^Usage: base32/
  • stdout contains Examples:, Exit status:, base32

Scenario: base64 –help exposes the documented sections #

When #

base64 --help

Then #

  • exit code is 0
  • stdout matches /^Usage: base64/
  • stdout contains Examples:, Exit status:, base64

Scenario: basename –help exposes the documented sections #

When #

basename --help

Then #

  • exit code is 0
  • stdout matches /^Usage: basename/
  • stdout contains Examples:, Exit status:, basename

Scenario: bunzip2 –help exposes the documented sections #

When #

bunzip2 --help

Then #

  • exit code is 0
  • stdout matches /^Usage: bunzip2/
  • stdout contains Examples:, Exit status:, bunzip2

Scenario: cal –help exposes the documented sections #

When #

cal --help

Then #

  • exit code is 0
  • stdout matches /^Usage: cal/
  • stdout contains Examples:, Exit status:, cal

Scenario: cat –help exposes the documented sections #

When #

cat --help

Then #

  • exit code is 0
  • stdout matches /^Usage: cat/
  • stdout contains Examples:, Exit status:, cat

Scenario: chgrp –help exposes the documented sections #

When #

chgrp --help

Then #

  • exit code is 0
  • stdout matches /^Usage: chgrp/
  • stdout contains Examples:, Exit status:, chgrp

Scenario: chmod –help exposes the documented sections #

When #

chmod --help

Then #

  • exit code is 0
  • stdout matches /^Usage: chmod/
  • stdout contains Examples:, Exit status:, chmod

Scenario: chown –help exposes the documented sections #

When #

chown --help

Then #

  • exit code is 0
  • stdout matches /^Usage: chown/
  • stdout contains Examples:, Exit status:, chown

Scenario: cksum –help exposes the documented sections #

When #

cksum --help

Then #

  • exit code is 0
  • stdout matches /^Usage: cksum/
  • stdout contains Examples:, Exit status:, cksum

Scenario: clear –help exposes the documented sections #

When #

clear --help

Then #

  • exit code is 0
  • stdout matches /^Usage: clear/
  • stdout contains Examples:, Exit status:, clear

Scenario: cmatrix –help exposes the documented sections #

When #

cmatrix --help

Then #

  • exit code is 0
  • stdout matches /^Usage: cmatrix/
  • stdout contains Examples:, Exit status:, cmatrix

Scenario: cmp –help exposes the documented sections #

When #

cmp --help

Then #

  • exit code is 0
  • stdout matches /^Usage: cmp/
  • stdout contains Examples:, Exit status:, cmp

Scenario: comm –help exposes the documented sections #

When #

comm --help

Then #

  • exit code is 0
  • stdout matches /^Usage: comm/
  • stdout contains Examples:, Exit status:, comm

Scenario: compress –help exposes the documented sections #

When #

compress --help

Then #

  • exit code is 0
  • stdout matches /^Usage: compress/
  • stdout contains Examples:, Exit status:, compress

Scenario: cowsay –help exposes the documented sections #

When #

cowsay --help

Then #

  • exit code is 0
  • stdout matches /^Usage: cowsay/
  • stdout contains Examples:, Exit status:, cowsay

Scenario: cowthink –help exposes the documented sections #

When #

cowthink --help

Then #

  • exit code is 0
  • stdout matches /^Usage: cowthink/
  • stdout contains Examples:, Exit status:, cowthink

Scenario: cpio –help exposes the documented sections #

When #

cpio --help

Then #

  • exit code is 0
  • stdout matches /^Usage: cpio/
  • stdout contains Examples:, Exit status:, cpio

Scenario: cut –help exposes the documented sections #

When #

cut --help

Then #

  • exit code is 0
  • stdout matches /^Usage: cut/
  • stdout contains Examples:, Exit status:, cut

Scenario: date –help exposes the documented sections #

When #

date --help

Then #

  • exit code is 0
  • stdout matches /^Usage: date/
  • stdout contains Examples:, Exit status:, date

Scenario: dd –help exposes the documented sections #

When #

dd --help

Then #

  • exit code is 0
  • stdout matches /^Usage: dd/
  • stdout contains Examples:, Exit status:, dd

Scenario: df –help exposes the documented sections #

When #

df --help

Then #

  • exit code is 0
  • stdout matches /^Usage: df/
  • stdout contains Examples:, Exit status:, df

Scenario: diff –help exposes the documented sections #

When #

diff --help

Then #

  • exit code is 0
  • stdout matches /^Usage: diff/
  • stdout contains Examples:, Exit status:, diff

Scenario: dirname –help exposes the documented sections #

When #

dirname --help

Then #

  • exit code is 0
  • stdout matches /^Usage: dirname/
  • stdout contains Examples:, Exit status:, dirname

Scenario: dos2unix –help exposes the documented sections #

When #

dos2unix --help

Then #

  • exit code is 0
  • stdout matches /^Usage: dos2unix/
  • stdout contains Examples:, Exit status:, dos2unix

Scenario: du –help exposes the documented sections #

When #

du --help

Then #

  • exit code is 0
  • stdout matches /^Usage: du/
  • stdout contains Examples:, Exit status:, du

Scenario: egrep –help exposes the documented sections #

When #

egrep --help

Then #

  • exit code is 0
  • stdout matches /^Usage: egrep/
  • stdout contains Examples:, Exit status:, egrep

Scenario: env –help exposes the documented sections #

When #

env --help

Then #

  • exit code is 0
  • stdout matches /^Usage: env/
  • stdout contains Examples:, Exit status:, env

Scenario: expand –help exposes the documented sections #

When #

expand --help

Then #

  • exit code is 0
  • stdout matches /^Usage: expand/
  • stdout contains Examples:, Exit status:, expand

Scenario: expr –help exposes the documented sections #

When #

expr --help

Then #

  • exit code is 0
  • stdout matches /^Usage: expr/
  • stdout contains Examples:, Exit status:, expr

Scenario: fakemovie –help exposes the documented sections #

When #

fakemovie --help

Then #

  • exit code is 0
  • stdout matches /^Usage: fakemovie/
  • stdout contains Examples:, Exit status:, fakemovie

Scenario: fgrep –help exposes the documented sections #

When #

fgrep --help

Then #

  • exit code is 0
  • stdout matches /^Usage: fgrep/
  • stdout contains Examples:, Exit status:, fgrep

Scenario: fmt –help exposes the documented sections #

When #

fmt --help

Then #

  • exit code is 0
  • stdout matches /^Usage: fmt/
  • stdout contains Examples:, Exit status:, fmt

Scenario: fold –help exposes the documented sections #

When #

fold --help

Then #

  • exit code is 0
  • stdout matches /^Usage: fold/
  • stdout contains Examples:, Exit status:, fold

Scenario: fortune –help exposes the documented sections #

When #

fortune --help

Then #

  • exit code is 0
  • stdout matches /^Usage: fortune/
  • stdout contains Examples:, Exit status:, fortune

Scenario: free –help exposes the documented sections #

When #

free --help

Then #

  • exit code is 0
  • stdout matches /^Usage: free/
  • stdout contains Examples:, Exit status:, free

Scenario: ghrdc –help exposes the documented sections #

When #

ghrdc --help

Then #

  • exit code is 0
  • stdout matches /^Usage: ghrdc/
  • stdout contains Examples:, Exit status:, ghrdc

Scenario: grep –help exposes the documented sections #

When #

grep --help

Then #

  • exit code is 0
  • stdout matches /^Usage: grep/
  • stdout contains Examples:, Exit status:, grep

Scenario: groups –help exposes the documented sections #

When #

groups --help

Then #

  • exit code is 0
  • stdout matches /^Usage: groups/
  • stdout contains Examples:, Exit status:, groups

Scenario: gunzip –help exposes the documented sections #

When #

gunzip --help

Then #

  • exit code is 0
  • stdout matches /^Usage: gunzip/
  • stdout contains Examples:, Exit status:, gunzip

Scenario: gzip –help exposes the documented sections #

When #

gzip --help

Then #

  • exit code is 0
  • stdout matches /^Usage: gzip/
  • stdout contains Examples:, Exit status:, gzip

Scenario: halt –help exposes the documented sections #

When #

halt --help

Then #

  • exit code is 0
  • stdout matches /^Usage: halt/
  • stdout contains Examples:, Exit status:, halt

Scenario: head –help exposes the documented sections #

When #

head --help

Then #

  • exit code is 0
  • stdout matches /^Usage: head/
  • stdout contains Examples:, Exit status:, head

Scenario: hostid –help exposes the documented sections #

When #

hostid --help

Then #

  • exit code is 0
  • stdout matches /^Usage: hostid/
  • stdout contains Examples:, Exit status:, hostid

Scenario: hostname –help exposes the documented sections #

When #

hostname --help

Then #

  • exit code is 0
  • stdout matches /^Usage: hostname/
  • stdout contains Examples:, Exit status:, hostname

Scenario: http-status-code –help exposes the documented sections #

When #

http-status-code --help

Then #

  • exit code is 0
  • stdout matches /^Usage: http\-status\-code/
  • stdout contains Examples:, Exit status:, http-status-code

Scenario: id –help exposes the documented sections #

When #

id --help

Then #

  • exit code is 0
  • stdout matches /^Usage: id/
  • stdout contains Examples:, Exit status:, id

Scenario: install –help exposes the documented sections #

When #

install --help

Then #

  • exit code is 0
  • stdout matches /^Usage: install/
  • stdout contains Examples:, Exit status:, install

Scenario: ischroot –help exposes the documented sections #

When #

ischroot --help

Then #

  • exit code is 0
  • stdout matches /^Usage: ischroot/
  • stdout contains Examples:, Exit status:, ischroot

Scenario: killall –help exposes the documented sections #

When #

killall --help

Then #

  • exit code is 0
  • stdout matches /^Usage: killall/
  • stdout contains Examples:, Exit status:, killall

Scenario: lifegame –help exposes the documented sections #

When #

lifegame --help

Then #

  • exit code is 0
  • stdout matches /^Usage: lifegame/
  • stdout contains Examples:, Exit status:, lifegame

When #

link --help

Then #

  • exit code is 0
  • stdout matches /^Usage: link/
  • stdout contains Examples:, Exit status:, link

Scenario: echo –help exposes the documented sections #

When #

env echo --help

Then #

  • exit code is 0
  • stdout matches /^Usage: echo/
  • stdout contains Examples:, Exit status:, echo

Scenario: false –help exposes the documented sections #

When #

env false --help

Then #

  • exit code is 0
  • stdout matches /^Usage: false/
  • stdout contains Examples:, Exit status:, false

Scenario: kill –help exposes the documented sections #

When #

env kill --help

Then #

  • exit code is 0
  • stdout matches /^Usage: kill/
  • stdout contains Examples:, Exit status:, kill

mimixbox i2cdetect #

Source: test/e2e/tools/mimixbox/embedded/i2cdetect.atago.yaml

Scenario: describes itself with –help #

When #

i2cdetect --help

Then #

  • exit code is 0
  • stdout contains Usage: i2cdetect
  • stderr is empty

mimixbox i2cdump #

Source: test/e2e/tools/mimixbox/embedded/i2cdump.atago.yaml

Scenario: describes itself with –help #

When #

i2cdump --help

Then #

  • exit code is 0
  • stdout contains Usage: i2cdump
  • stderr is empty

mimixbox i2cget #

Source: test/e2e/tools/mimixbox/embedded/i2cget.atago.yaml

Scenario: describes itself with –help #

When #

i2cget --help

Then #

  • exit code is 0
  • stdout contains Usage: i2cget
  • stderr is empty

mimixbox i2cset #

Source: test/e2e/tools/mimixbox/embedded/i2cset.atago.yaml

Scenario: describes itself with –help #

When #

i2cset --help

Then #

  • exit code is 0
  • stdout contains Usage: i2cset
  • stderr is empty

mimixbox ifup #

Source: test/e2e/tools/mimixbox/embedded/ifup.atago.yaml

Scenario: describes itself with –help #

When #

ifup --help

Then #

  • exit code is 0
  • stdout contains Usage: ifup
  • stderr is empty

mimixbox insmod #

Source: test/e2e/tools/mimixbox/embedded/insmod.atago.yaml

Scenario: describes itself with –help #

When #

insmod --help

Then #

  • exit code is 0
  • stdout contains Usage: insmod
  • stderr is empty

mimixbox ip #

Source: test/e2e/tools/mimixbox/embedded/ip.atago.yaml

Scenario: describes itself with –help #

When #

ip --help

Then #

  • exit code is 0
  • stdout contains Usage: ip
  • stderr is empty

mimixbox ipaddr #

Source: test/e2e/tools/mimixbox/embedded/ipaddr.atago.yaml

Scenario: describes itself with –help #

When #

ipaddr --help

Then #

  • exit code is 0
  • stdout contains Usage: ipaddr
  • stderr is empty

Source: test/e2e/tools/mimixbox/embedded/iplink.atago.yaml

Scenario: describes itself with –help #

When #

iplink --help

Then #

  • exit code is 0
  • stdout contains Usage: iplink
  • stderr is empty

mimixbox ipneigh #

Source: test/e2e/tools/mimixbox/embedded/ipneigh.atago.yaml

Scenario: describes itself with –help #

When #

ipneigh --help

Then #

  • exit code is 0
  • stdout contains Usage: ipneigh
  • stderr is empty

mimixbox iproute #

Source: test/e2e/tools/mimixbox/embedded/iproute.atago.yaml

Scenario: describes itself with –help #

When #

iproute --help

Then #

  • exit code is 0
  • stdout contains Usage: iproute
  • stderr is empty

mimixbox iprule #

Source: test/e2e/tools/mimixbox/embedded/iprule.atago.yaml

Scenario: describes itself with –help #

When #

iprule --help

Then #

  • exit code is 0
  • stdout contains Usage: iprule
  • stderr is empty

mimixbox iptunnel #

Source: test/e2e/tools/mimixbox/embedded/iptunnel.atago.yaml

Scenario: describes itself with –help #

When #

iptunnel --help

Then #

  • exit code is 0
  • stdout contains Usage: iptunnel
  • stderr is empty

mimixbox less #

Source: test/e2e/tools/mimixbox/embedded/less.atago.yaml

Scenario: describes itself with –help #

When #

less --help

Then #

  • exit code is 0
  • stdout contains Usage: less
  • stderr is empty

mimixbox linux32 #

Source: test/e2e/tools/mimixbox/embedded/linux32.atago.yaml

Scenario: describes itself with –help #

When #

linux32 --help

Then #

  • exit code is 0
  • stdout contains Usage: linux32
  • stderr is empty

mimixbox linux64 #

Source: test/e2e/tools/mimixbox/embedded/linux64.atago.yaml

Scenario: describes itself with –help #

When #

linux64 --help

Then #

  • exit code is 0
  • stdout contains Usage: linux64
  • stderr is empty

mimixbox linuxrc #

Source: test/e2e/tools/mimixbox/embedded/linuxrc.atago.yaml

Scenario: describes itself with –help #

When #

linuxrc --help

Then #

  • exit code is 0
  • stdout contains Usage: linuxrc
  • stderr is empty

mimixbox load_policy #

Source: test/e2e/tools/mimixbox/embedded/load_policy.atago.yaml

Scenario: describes itself with –help #

When #

load_policy --help

Then #

  • exit code is 0
  • stdout contains Usage: load_policy
  • stderr is empty

mimixbox log-collect #

Source: test/e2e/tools/mimixbox/embedded/log-collect.atago.yaml

Scenario: describes itself with –help #

When #

log-collect --help

Then #

  • exit code is 0
  • stdout contains Usage: log-collect
  • stderr is empty

mimixbox lpd #

Source: test/e2e/tools/mimixbox/embedded/lpd.atago.yaml

Scenario: describes itself with –help #

When #

lpd --help

Then #

  • exit code is 0
  • stdout contains Usage: lpd
  • stderr is empty

mimixbox lpq #

Source: test/e2e/tools/mimixbox/embedded/lpq.atago.yaml

Scenario: describes itself with –help #

When #

lpq --help

Then #

  • exit code is 0
  • stdout contains Usage: lpq
  • stderr is empty

mimixbox lpr #

Source: test/e2e/tools/mimixbox/embedded/lpr.atago.yaml

Scenario: describes itself with –help #

When #

lpr --help

Then #

  • exit code is 0
  • stdout contains Usage: lpr
  • stderr is empty

mimixbox lpr_roundtrip #

Source: test/e2e/tools/mimixbox/embedded/lpr_roundtrip.atago.yaml

Scenario: queues, lists, drains, and empties the spool #

When #

printf 'page content\n' > document.txt

# Queue a file and a stdin job.
lpr -S spool document.txt || exit 1
printf 'from stdin\n' | lpr -S spool || exit 1

# lpq must list both jobs in id order.
lpq -S spool | grep -q 'document.txt' || exit 1
lpq -S spool | grep -q '(stdin)' || exit 1

# Drain to an output directory; both jobs are reported printed.
lpd -S spool -o printed | grep -q 'printed job 1' || exit 1
lpd_out=$(lpd -S spool -o printed) # second drain run is a no-op
[ -z "${lpd_out}" ] || exit 1

# The printed file content survives the round-trip.
cat printed/0001-document.txt

# The queue is now empty.
lpq -S spool

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

page content
no entries

mimixbox lsscsi #

Source: test/e2e/tools/mimixbox/embedded/lsscsi.atago.yaml

Scenario: lists SCSI devices from sysfs without error (empty is allowed) #

When #

if [ -d /sys/bus/scsi/devices ]; then
    lsscsi >/dev/null && echo ok
else
    echo ok
fi

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: prints usage for –help #

When #

lsscsi --help

Then #

  • exit code is 0
  • stdout contains Usage: lsscsi

Scenario: prints the version line for –version #

When #

lsscsi --version

Then #

  • exit code is 0
  • stdout contains lsscsi (mimixbox)

mimixbox lzcat #

Source: test/e2e/tools/mimixbox/embedded/lzcat.atago.yaml

Scenario: describes itself with –help #

When #

lzcat --help

Then #

  • exit code is 0
  • stdout contains Usage: lzcat
  • stderr is empty

mimixbox lzma #

Source: test/e2e/tools/mimixbox/embedded/lzma.atago.yaml

Scenario: describes itself with –help #

When #

lzma --help

Then #

  • exit code is 0
  • stdout contains Usage: lzma
  • stderr is empty

mimixbox lzop #

Source: test/e2e/tools/mimixbox/embedded/lzop.atago.yaml

Scenario: describes itself with –help #

When #

lzop --help

Then #

  • exit code is 0
  • stdout contains Usage: lzop
  • stderr is empty

mimixbox lzopcat #

Source: test/e2e/tools/mimixbox/embedded/lzopcat.atago.yaml

Scenario: describes itself with –help #

When #

lzopcat --help

Then #

  • exit code is 0
  • stdout contains Usage: lzopcat
  • stderr is empty

mimixbox makedevs #

Source: test/e2e/tools/mimixbox/embedded/makedevs.atago.yaml

Scenario: creates the directory and file tree from a device table #

Given #

  • Fixture file table.txt is created.

Inputs #

Fixture table.txt:

# device table
/dev d 755 0 0 0 0 0 0 0
/etc/hostname f 644 0 0 0 0 0 0 0

When #

makedevs -d table.txt rootfs
if [ -d rootfs/dev ] && [ -f rootfs/etc/hostname ]; then
    echo 1
else
    echo 0
fi

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: fails without the -d table option #

When #

makedevs ./rootfs

Then #

  • exit code is not 0
  • stderr contains usage: makedevs

Scenario: prints usage for –help #

When #

makedevs --help

Then #

  • exit code is 0
  • stdout contains Usage: makedevs

Scenario: prints the version line for –version #

When #

makedevs --version

Then #

  • exit code is 0
  • stdout contains makedevs (mimixbox)

mimixbox matchpathcon #

Source: test/e2e/tools/mimixbox/embedded/matchpathcon.atago.yaml

Scenario: describes itself with –help #

When #

matchpathcon --help

Then #

  • exit code is 0
  • stdout contains Usage: matchpathcon
  • stderr is empty

mimixbox mkdosfs #

Source: test/e2e/tools/mimixbox/embedded/mkdosfs.atago.yaml

Scenario: describes itself with –help #

When #

mkdosfs --help

Then #

  • exit code is 0
  • stdout contains Usage: mkdosfs
  • stderr is empty

mimixbox mkfs.ext2 #

Source: test/e2e/tools/mimixbox/embedded/mkfs.ext2.atago.yaml

Scenario: describes itself with –help #

When #

mkfs.ext2 --help

Then #

  • exit code is 0
  • stdout contains Usage: mkfs.ext2
  • stderr is empty

mimixbox mkfs.minix #

Source: test/e2e/tools/mimixbox/embedded/mkfs.minix.atago.yaml

Scenario: describes itself with –help #

When #

mkfs.minix --help

Then #

  • exit code is 0
  • stdout contains Usage: mkfs.minix
  • stderr is empty

mimixbox mkfs.reiser #

Source: test/e2e/tools/mimixbox/embedded/mkfs.reiser.atago.yaml

Scenario: describes itself with –help #

When #

mkfs.reiser --help

Then #

  • exit code is 0
  • stdout contains Usage: mkfs.reiser
  • stderr is empty

mimixbox mkfs.vfat #

Source: test/e2e/tools/mimixbox/embedded/mkfs.vfat.atago.yaml

Scenario: describes itself with –help #

When #

mkfs.vfat --help

Then #

  • exit code is 0
  • stdout contains Usage: mkfs.vfat
  • stderr is empty

mimixbox modprobe #

Source: test/e2e/tools/mimixbox/embedded/modprobe.atago.yaml

Scenario: describes itself with –help #

When #

modprobe --help

Then #

  • exit code is 0
  • stdout contains Usage: modprobe
  • stderr is empty

mimixbox more #

Source: test/e2e/tools/mimixbox/embedded/more.atago.yaml

Scenario: describes itself with –help #

When #

more --help

Then #

  • exit code is 0
  • stdout contains Usage: more
  • stderr is empty

mimixbox nameif #

Source: test/e2e/tools/mimixbox/embedded/nameif.atago.yaml

Scenario: describes itself with –help #

When #

nameif --help

Then #

  • exit code is 0
  • stdout contains Usage: nameif
  • stderr is empty

mimixbox nbd-client #

Source: test/e2e/tools/mimixbox/embedded/nbd-client.atago.yaml

Scenario: describes itself with –help #

When #

nbd-client --help

Then #

  • exit code is 0
  • stdout contains Usage: nbd-client
  • stderr is empty

mimixbox partprobe #

Source: test/e2e/tools/mimixbox/embedded/partprobe.atago.yaml

Scenario: describes itself with –help #

When #

partprobe --help

Then #

  • exit code is 0
  • stdout contains Usage: partprobe
  • stderr is empty

mimixbox ping6 #

Source: test/e2e/tools/mimixbox/embedded/ping6.atago.yaml

Scenario: describes itself with –help #

When #

ping6 --help

Then #

  • exit code is 0
  • stdout contains Usage: ping6
  • stderr is empty

mimixbox pipe_progress #

Source: test/e2e/tools/mimixbox/embedded/pipe_progress.atago.yaml

Scenario: describes itself with –help #

When #

pipe_progress --help

Then #

  • exit code is 0
  • stdout contains Usage: pipe_progress
  • stderr is empty

mimixbox pkill #

Source: test/e2e/tools/mimixbox/embedded/pkill.atago.yaml

Scenario: describes itself with –help #

When #

pkill --help

Then #

  • exit code is 0
  • stdout contains Usage: pkill
  • stderr is empty

mimixbox poweroff #

Source: test/e2e/tools/mimixbox/embedded/poweroff.atago.yaml

Scenario: describes itself with –help #

When #

poweroff --help

Then #

  • exit code is 0
  • stdout contains Usage: poweroff
  • stderr is empty

mimixbox preexisting_tmp_root #

Source: test/e2e/tools/mimixbox/embedded/preexisting_tmp_root.atago.yaml

Scenario: allocates a usable per-run root that is not /tmp/mimixbox #

When #

[ -n "${workdir}" ] || exit 1
[ "${workdir}" != "/tmp/mimixbox" ] || exit 1
mkdir -p "${workdir}/it478" || exit 1
touch "${workdir}/it478/probe" || exit 1
printf 'ok'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: leaves a pre-existing /tmp/mimixbox file untouched (harness-specific) #

only when env ATAGO_RUN_HARNESS_SPECIFIC is set

When #

[ ! -d /tmp/mimixbox ] && printf 'not-a-dir'

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox raidautorun #

Source: test/e2e/tools/mimixbox/embedded/raidautorun.atago.yaml

Scenario: describes itself with –help #

When #

raidautorun --help

Then #

  • exit code is 0
  • stdout contains Usage: raidautorun
  • stderr is empty

mimixbox readahead #

Source: test/e2e/tools/mimixbox/embedded/readahead.atago.yaml

Scenario: describes itself with –help #

When #

readahead --help

Then #

  • exit code is 0
  • stdout contains Usage: readahead
  • stderr is empty

mimixbox reboot #

Source: test/e2e/tools/mimixbox/embedded/reboot.atago.yaml

Scenario: describes itself with –help #

When #

reboot --help

Then #

  • exit code is 0
  • stdout contains Usage: reboot
  • stderr is empty

mimixbox restorecon #

Source: test/e2e/tools/mimixbox/embedded/restorecon.atago.yaml

Scenario: describes itself with –help #

When #

restorecon --help

Then #

  • exit code is 0
  • stdout contains Usage: restorecon
  • stderr is empty

mimixbox resume #

Source: test/e2e/tools/mimixbox/embedded/resume.atago.yaml

Scenario: describes itself with –help #

When #

resume --help

Then #

  • exit code is 0
  • stdout contains Usage: resume
  • stderr is empty

mimixbox seedrng #

Source: test/e2e/tools/mimixbox/embedded/seedrng.atago.yaml

Scenario: describes itself with –help #

When #

seedrng --help

Then #

  • exit code is 0
  • stdout contains Usage: seedrng
  • stderr is empty

Scenario: documents its purpose in –help #

When #

seedrng --help

Then #

  • exit code is 0
  • stdout contains boot seed

mimixbox setfattr #

Source: test/e2e/tools/mimixbox/embedded/setfattr.atago.yaml

Scenario: sets an attribute that getfattr can read back (or skips without xattr support) #

Given #

  • Fixture file file.txt is created.

When #

if ! setfattr -n user.k -v v file.txt 2>/dev/null; then
    echo 'user.k="v" (skipped: filesystem has no xattr support)'
else
    getfattr -d file.txt | grep 'user.k'
fi

Then #

  • exit code is 0
  • stdout contains user.k

Scenario: rejects mutually exclusive -n and -x #

Given #

  • Fixture file file.txt is created.

When #

setfattr -n user.k -x user.k file.txt

Then #

  • exit code is not 0
  • stderr contains mutually exclusive

Scenario: prints usage for –help #

When #

setfattr --help

Then #

  • exit code is 0
  • stdout contains Usage: setfattr

Scenario: prints the version line for –version #

When #

setfattr --version

Then #

  • exit code is 0
  • stdout contains setfattr (mimixbox)

mimixbox volname #

Source: test/e2e/tools/mimixbox/embedded/volname.atago.yaml

Scenario: describes itself with –help #

When #

volname --help

Then #

  • exit code is 0
  • stdout contains Usage: volname
  • stderr is empty

mimixbox watchdog #

Source: test/e2e/tools/mimixbox/embedded/watchdog.atago.yaml

Scenario: describes itself with –help #

When #

watchdog --help

Then #

  • exit code is 0
  • stdout contains Usage: watchdog
  • stderr is empty

mimixbox chgrp #

Source: test/e2e/tools/mimixbox/fileutils/chgrp.atago.yaml

Scenario: prints usage with –help and exits 0 #

When #

chgrp --help

Then #

  • exit code is 0
  • stdout contains Usage: chgrp

Scenario: fails with a message when given no operand #

When #

chgrp

Then #

  • exit code is not 0
  • stderr contains chgrp

mimixbox chown #

Source: test/e2e/tools/mimixbox/fileutils/chown.atago.yaml

Scenario: prints usage with –help and exits 0 #

When #

chown --help

Then #

  • exit code is 0
  • stdout contains Usage: chown

Scenario: fails with a message when given no operand #

When #

chown

Then #

  • exit code is not 0
  • stderr contains chown

mimixbox cp #

Source: test/e2e/tools/mimixbox/fileutils/cp.atago.yaml

Scenario: copy one file #

When #

mkdir -p cp/inner cp2 && touch cp/1.txt cp/2.txt cp/3.txt cp/inner/inner.txt
cp ${workdir}/cp/1.txt ${workdir}/cp/cp.txt && ls ${workdir}/cp/cp.txt

Then #

  • after cp ${workdir}/cp/1.txt ${workdir}/cp/cp.txt && ls ${workdir}/cp/cp.txt:
    • exit code is 0
    • stdout equals an exact value

Scenario: copy directory recursively #

When #

mkdir -p cp/inner cp2 && touch cp/1.txt cp/2.txt cp/3.txt cp/inner/inner.txt
cp -r ${workdir}/cp ${workdir}/cp2 && ls ${workdir}/cp2 && ls ${workdir}/cp2/cp

Then #

  • after cp -r ${workdir}/cp ${workdir}/cp2 && ls ${workdir}/cp2 && ls ${workdir}/cp2/cp:
    • exit code is 0
    • stdout equals an exact value

Expected output #

expected stdout:

cp
1.txt
2.txt
3.txt
inner

Scenario: can not copy when src and dest are the same #

When #

mkdir -p cp/inner cp2 && touch cp/1.txt cp/2.txt cp/3.txt cp/inner/inner.txt
cp -r ${workdir}/cp ${workdir}/cp; ls ${workdir}/cp

Then #

  • after cp -r ${workdir}/cp ${workdir}/cp; ls ${workdir}/cp:
    • stdout equals an exact value
    • stderr equals an exact value

Expected output #

expected stdout:

1.txt
2.txt
3.txt
inner

Scenario: status failure when src and dest are the same #

When #

mkdir -p cp/inner cp2 && touch cp/1.txt cp/2.txt cp/3.txt cp/inner/inner.txt
cp -r ${workdir}/cp ${workdir}/cp

Then #

  • after cp -r ${workdir}/cp ${workdir}/cp:
    • exit code is not 0
    • stderr equals an exact value

Scenario: copy three files at the same time #

When #

mkdir -p cp/inner cp2 && touch cp/1.txt cp/2.txt cp/3.txt cp/inner/inner.txt
cp ${workdir}/cp/1.txt ${workdir}/cp/2.txt ${workdir}/cp/3.txt ${workdir}/cp2 && ls ${workdir}/cp2

Then #

  • after cp ${workdir}/cp/1.txt ${workdir}/cp/2.txt ${workdir}/cp/3.txt ${workdir}/cp2 && ls ${workdir}/cp2:
    • exit code is 0
    • stdout equals an exact value

Expected output #

expected stdout:

1.txt
2.txt
3.txt

Scenario: can not copy a directory without the recursive option #

When #

mkdir -p cp/inner cp2 && touch cp/1.txt cp/2.txt cp/3.txt cp/inner/inner.txt
cp ${workdir}/cp ${workdir}/cp2

Then #

  • after cp ${workdir}/cp ${workdir}/cp2:
    • exit code is not 0
    • stderr equals an exact value

Expected output #

expected stderr:

cp: --recursive is not specified: omitting directory: ${workdir}/cp

Scenario: can not copy a directory to root without authority #

skipped on Linux

When #

cp -r ${workdir}/cp /

Then #

  • exit code is not 0

mimixbox cp GNU flags #

Source: test/e2e/tools/mimixbox/fileutils/cp_gnu.atago.yaml

Scenario: copies into the target directory (-t equals destination-last form) #

When #

printf 'A\n' > a.txt && printf 'B\n' > b.txt && mkdir dst_t dst_plain && cp --target-directory dst_t a.txt b.txt && cp a.txt b.txt dst_plain && [ "$(ls dst_t)" = "$(ls dst_plain)" ] && cat dst_t/a.txt dst_t/b.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

A
B

Scenario: rejects a directory destination with –no-target-directory (-T) #

When #

printf 'A\n' > a.txt && mkdir b && cp -T a.txt b

Then #

  • exit code is not 0
  • stderr contains cannot overwrite directory

Scenario: recreates the source path prefix with –parents #

When #

mkdir -p src/a dst && printf 'deep\n' > src/a/b.txt && cp --parents src/a/b.txt dst/ && cat dst/src/a/b.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: makes a backup before overwriting with –backup #

When #

printf 'new\n' > src.txt && printf 'old\n' > dst.txt && cp --backup=simple src.txt dst.txt && cat dst.txt dst.txt~

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

new
old

Scenario: skips the copy when the destination is newer (-u) #

When #

printf 'srcdata\n' > src.txt && printf 'dstdata\n' > dst.txt && touch -d '2020-01-01T00:00:00' src.txt && touch -d '2021-01-01T00:00:00' dst.txt && cp -u src.txt dst.txt && cat dst.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: skips a newer file inside the tree with -ru (#940) #

When #

mkdir -p src dst/src && printf 'from-src\n' > src/f.txt && printf 'newer-dst\n' > dst/src/f.txt && touch -d '2020-01-01T00:00:00' src/f.txt && touch -d '2021-01-01T00:00:00' dst/src/f.txt && cp -ru src dst && cat dst/src/f.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: backs up a file inside the tree with -r –backup (#940) #

When #

mkdir -p src dst/src && printf 'new\n' > src/f.txt && printf 'old\n' > dst/src/f.txt && cp -r --backup=simple src dst && cat dst/src/f.txt dst/src/f.txt~

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

new
old

Source: test/e2e/tools/mimixbox/fileutils/cp_symlink.atago.yaml

When #

echo data > real.txt
ln -s real.txt link
cp -P link copy
[ -L copy ] && echo link || echo notlink

Then #

  • exit code is 0
  • stdout equals an exact value

When #

echo data > real.txt
ln -s real.txt link
cp -L link copy
if [ -L copy ]; then echo link; elif [ -f copy ]; then echo regular; else echo missing; fi

Then #

  • exit code is 0
  • stdout equals an exact value

When #

mkdir -p src
echo data > src/real.txt
ln -s real.txt src/lnk
cp -d -r src dst
[ -L dst/lnk ] && echo link || echo notlink

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox fileutils help helpers #

Source: test/e2e/tools/mimixbox/fileutils/help_helpers_fileutils.atago.yaml

Scenario: chgrp –help is structured #

When #

chgrp --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: chown –help is structured #

When #

chown --help

Then #

  • exit code is 0
  • stdout contains Usage:

Source: test/e2e/tools/mimixbox/fileutils/link.atago.yaml

Given #

  • Fixture file link_src is created.

Inputs #

Fixture link_src:

data

When #

link ${workdir}/link_src ${workdir}/link_dst && cat ${workdir}/link_dst

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox ln #

Source: test/e2e/tools/mimixbox/fileutils/ln.atago.yaml

Given #

  • Fixture file ln/target.txt is created.

Inputs #

Fixture ln/target.txt:

content

When #

ln ${workdir}/ln/target.txt ${workdir}/ln/hardlink.txt && cat ${workdir}/ln/hardlink.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Given #

  • Fixture file ln/target.txt is created.

Inputs #

Fixture ln/target.txt:

content

When #

ln -s ${workdir}/ln/target.txt ${workdir}/ln/symlink.txt && test -L ${workdir}/ln/symlink.txt && echo "is symlink"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: ln with no operand reports an error #

When #

ln

Then #

  • exit code is not 0
  • stderr equals an exact value

mimixbox ln GNU flags #

Source: test/e2e/tools/mimixbox/fileutils/ln_gnu.atago.yaml

When #

mkdir -p ln_gnu/a ln_gnu/b ln_gnu/dst
printf 'content\n' > ln_gnu/a/target.txt

ln -s --relative ${workdir}/ln_gnu/a/target.txt ${workdir}/ln_gnu/b/link.txt && readlink ${workdir}/ln_gnu/b/link.txt

Then #

  • after ln -s --relative ${workdir}/ln_gnu/a/target.txt ${workdir}/ln_gnu/b/link.txt && readlink ${workdir}/ln_gnu/b/link.txt:
    • exit code is 0
    • stdout equals an exact value

When #

mkdir -p ln_gnu/a ln_gnu/b ln_gnu/dst
printf 'A\n' > ln_gnu/a.txt
printf 'B\n' > ln_gnu/b.txt

ln --target-directory ${workdir}/ln_gnu/dst ${workdir}/ln_gnu/a.txt ${workdir}/ln_gnu/b.txt && ls ${workdir}/ln_gnu/dst

Then #

  • after ln --target-directory ${workdir}/ln_gnu/dst ${workdir}/ln_gnu/a.txt ${workdir}/ln_gnu/b.txt && ls ${workdir}/ln_gnu/dst:
    • exit code is 0
    • stdout equals an exact value

Expected output #

expected stdout:

a.txt
b.txt

mimixbox ls #

Source: test/e2e/tools/mimixbox/fileutils/ls.atago.yaml

Scenario: lists entries sorted, hiding dotfiles #

When #

mkdir -p ls/sub && touch ls/a.txt ls/b.txt ls/.hidden
ls ${workdir}/ls

Then #

  • after ls ${workdir}/ls:
    • exit code is 0
    • stdout equals an exact value

Expected output #

expected stdout:

a.txt
b.txt
sub

Scenario: includes dotfiles with -a #

When #

mkdir -p ls/sub && touch ls/a.txt ls/b.txt ls/.hidden
ls -a ${workdir}/ls

Then #

  • after ls -a ${workdir}/ls:
    • exit code is 0
    • stdout contains .hidden

Scenario: marks directories with -F #

When #

mkdir -p ls/sub && touch ls/a.txt ls/b.txt ls/.hidden
ls -F ${workdir}/ls

Then #

  • after ls -F ${workdir}/ls:
    • exit code is 0
    • stdout contains sub/

mimixbox ls GNU flags #

Source: test/e2e/tools/mimixbox/fileutils/ls_gnu.atago.yaml

Scenario: colors directories with –color=always #

When #

mkdir -p ls_gnu/adir
printf 'xxxxxxxxxx' > ls_gnu/small.txt
dd if=/dev/zero of=ls_gnu/big.txt bs=1 count=5000 2>/dev/null
: > ls_gnu/a.log
: > ls_gnu/tmpfile
printf '#!/bin/sh\n' > ls_gnu/run.sh
chmod 0755 ls_gnu/run.sh
ln -s small.txt ls_gnu/link

ls --color=always ${workdir}/ls_gnu

Then #

  • after ls --color=always ${workdir}/ls_gnu:
    • exit code is 0
    • stdout contains adir
    • stdout matches /\x1b\[01;34m/

Scenario: emits no escapes with –color=never #

When #

mkdir -p ls_gnu/adir
printf 'xxxxxxxxxx' > ls_gnu/small.txt
dd if=/dev/zero of=ls_gnu/big.txt bs=1 count=5000 2>/dev/null
: > ls_gnu/a.log
: > ls_gnu/tmpfile
printf '#!/bin/sh\n' > ls_gnu/run.sh
chmod 0755 ls_gnu/run.sh
ln -s small.txt ls_gnu/link

ls --color=never ${workdir}/ls_gnu

Then #

  • after ls --color=never ${workdir}/ls_gnu:
    • exit code is 0
    • stdout does not contain 

Scenario: appends / * @ with -F #

When #

mkdir -p ls_gnu/adir
printf 'xxxxxxxxxx' > ls_gnu/small.txt
dd if=/dev/zero of=ls_gnu/big.txt bs=1 count=5000 2>/dev/null
: > ls_gnu/a.log
: > ls_gnu/tmpfile
printf '#!/bin/sh\n' > ls_gnu/run.sh
chmod 0755 ls_gnu/run.sh
ln -s small.txt ls_gnu/link

ls -F ${workdir}/ls_gnu

Then #

  • after ls -F ${workdir}/ls_gnu:
    • exit code is 0
    • stdout contains adir/, run.sh*, link@

Scenario: omits * for executables with –file-type #

When #

mkdir -p ls_gnu/adir
printf 'xxxxxxxxxx' > ls_gnu/small.txt
dd if=/dev/zero of=ls_gnu/big.txt bs=1 count=5000 2>/dev/null
: > ls_gnu/a.log
: > ls_gnu/tmpfile
printf '#!/bin/sh\n' > ls_gnu/run.sh
chmod 0755 ls_gnu/run.sh
ln -s small.txt ls_gnu/link

ls --file-type ${workdir}/ls_gnu

Then #

  • after ls --file-type ${workdir}/ls_gnu:
    • exit code is 0
    • stdout contains adir/
    • stdout does not contain run.sh*

Scenario: marks only dirs with –indicator-style=slash #

When #

mkdir -p ls_gnu/adir
printf 'xxxxxxxxxx' > ls_gnu/small.txt
dd if=/dev/zero of=ls_gnu/big.txt bs=1 count=5000 2>/dev/null
: > ls_gnu/a.log
: > ls_gnu/tmpfile
printf '#!/bin/sh\n' > ls_gnu/run.sh
chmod 0755 ls_gnu/run.sh
ln -s small.txt ls_gnu/link

ls --indicator-style=slash ${workdir}/ls_gnu

Then #

  • after ls --indicator-style=slash ${workdir}/ls_gnu:
    • exit code is 0
    • stdout contains adir/
    • stdout does not contain link@

Scenario: lists largest first with –sort=size #

When #

mkdir -p ls_gnu/adir
printf 'xxxxxxxxxx' > ls_gnu/small.txt
dd if=/dev/zero of=ls_gnu/big.txt bs=1 count=5000 2>/dev/null
: > ls_gnu/a.log
: > ls_gnu/tmpfile
printf '#!/bin/sh\n' > ls_gnu/run.sh
chmod 0755 ls_gnu/run.sh
ln -s small.txt ls_gnu/link

ls --sort=size ${workdir}/ls_gnu

Then #

  • after ls --sort=size ${workdir}/ls_gnu:
    • exit code is 0
    • stdout equals an exact value

Scenario: lists directories first with –group-directories-first #

When #

mkdir -p ls_gnu/adir
printf 'xxxxxxxxxx' > ls_gnu/small.txt
dd if=/dev/zero of=ls_gnu/big.txt bs=1 count=5000 2>/dev/null
: > ls_gnu/a.log
: > ls_gnu/tmpfile
printf '#!/bin/sh\n' > ls_gnu/run.sh
chmod 0755 ls_gnu/run.sh
ln -s small.txt ls_gnu/link

ls --group-directories-first ${workdir}/ls_gnu

Then #

  • after ls --group-directories-first ${workdir}/ls_gnu:
    • exit code is 0
    • stdout equals an exact value

Scenario: drops matches with –ignore #

When #

mkdir -p ls_gnu/adir
printf 'xxxxxxxxxx' > ls_gnu/small.txt
dd if=/dev/zero of=ls_gnu/big.txt bs=1 count=5000 2>/dev/null
: > ls_gnu/a.log
: > ls_gnu/tmpfile
printf '#!/bin/sh\n' > ls_gnu/run.sh
chmod 0755 ls_gnu/run.sh
ln -s small.txt ls_gnu/link

ls --ignore=*.log ${workdir}/ls_gnu

Then #

  • after ls --ignore=*.log ${workdir}/ls_gnu:
    • exit code is 0
    • stdout does not contain a.log

Scenario: drops matches with –hide #

When #

mkdir -p ls_gnu/adir
printf 'xxxxxxxxxx' > ls_gnu/small.txt
dd if=/dev/zero of=ls_gnu/big.txt bs=1 count=5000 2>/dev/null
: > ls_gnu/a.log
: > ls_gnu/tmpfile
printf '#!/bin/sh\n' > ls_gnu/run.sh
chmod 0755 ls_gnu/run.sh
ln -s small.txt ls_gnu/link

ls --hide=tmp* ${workdir}/ls_gnu

Then #

  • after ls --hide=tmp* ${workdir}/ls_gnu:
    • exit code is 0
    • stdout does not contain tmpfile

Scenario: keeps hidden matches when -a is given #

When #

mkdir -p ls_gnu/adir
printf 'xxxxxxxxxx' > ls_gnu/small.txt
dd if=/dev/zero of=ls_gnu/big.txt bs=1 count=5000 2>/dev/null
: > ls_gnu/a.log
: > ls_gnu/tmpfile
printf '#!/bin/sh\n' > ls_gnu/run.sh
chmod 0755 ls_gnu/run.sh
ln -s small.txt ls_gnu/link

ls -a --hide=tmp* ${workdir}/ls_gnu

Then #

  • after ls -a --hide=tmp* ${workdir}/ls_gnu:
    • exit code is 0
    • stdout contains tmpfile

Scenario: prints an inode number with -i #

When #

mkdir -p ls_gnu/adir
printf 'xxxxxxxxxx' > ls_gnu/small.txt

ls -i ${workdir}/ls_gnu/small.txt

Then #

  • after ls -i ${workdir}/ls_gnu/small.txt:
    • exit code is 0
    • stdout matches /[0-9]+ +.*small.txt/

Scenario: scales sizes to 1024-byte blocks with -k #

When #

mkdir -p ls_gnu/adir
dd if=/dev/zero of=ls_gnu/big.txt bs=1 count=5000 2>/dev/null

ls -l -k ${workdir}/ls_gnu/big.txt

Then #

  • after ls -l -k ${workdir}/ls_gnu/big.txt:
    • exit code is 0
    • stdout contains 5

mimixbox mkdir #

Source: test/e2e/tools/mimixbox/fileutils/mkdir.atago.yaml

Scenario: make a single directory #

When #

mkdir -p mkdir && mkdir ${workdir}/mkdir/single && ls ${workdir}/mkdir

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: make three directories #

When #

mkdir -p mkdir && mkdir ${workdir}/mkdir/1 ${workdir}/mkdir/2 ${workdir}/mkdir/3 && ls ${workdir}/mkdir

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

1
2
3

Scenario: make a parent/child directory with -p #

When #

mkdir -p mkdir && mkdir -p ${workdir}/mkdir/parents/child && ls ${workdir}/mkdir/parents/

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: make a directory from a pipe #

When #

mkdir -p mkdir && echo "${workdir}/mkdir/pipe" | xargs mkdir && ls ${workdir}/mkdir

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: print error without operand #

When #

mkdir

Then #

  • exit code is not 0
  • stderr equals an exact value

Scenario: print error with –parents and no operand #

When #

mkdir -p

Then #

  • exit code is not 0
  • stderr equals an exact value

Scenario: make 1 and 3 but fail to make 2 at an unwritable path #

When #

mkdir -p mkdir && mkdir ${workdir}/mkdir/1 /mkdir/2 ${workdir}/mkdir/3; ls ${workdir}/mkdir/

Then #

  • stdout equals an exact value
  • stderr equals an exact value

Expected output #

expected stdout:

1
3

mimixbox mkfifo #

Source: test/e2e/tools/mimixbox/fileutils/mkfifo.atago.yaml

Scenario: make one named pipe with mode prw-r–r– #

When #

mkdir -p mkfifo && chmod 775 mkfifo && mkfifo ${workdir}/mkfifo/1 && ls -al ${workdir}/mkfifo/1 | cut -f 1 -d " "

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: make three named pipes with mode prw-r–r– #

When #

mkdir -p mkfifo && chmod 775 mkfifo
mkfifo ${workdir}/mkfifo/1 ${workdir}/mkfifo/2 ${workdir}/mkfifo/3
ls -al ${workdir}/mkfifo/1 | cut -f 1 -d " "
ls -al ${workdir}/mkfifo/2 | cut -f 1 -d " "
ls -al ${workdir}/mkfifo/3 | cut -f 1 -d " "

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

prw-r--r--
prw-r--r--
prw-r--r--

Scenario: print error for a non-existent path #

When #

mkfifo /no_exist_path/fifo

Then #

  • exit code is not 0
  • stderr equals an exact value

Scenario: print error when the same name already exists #

When #

mkdir -p mkfifo && chmod 775 mkfifo && mkfifo ${workdir}/mkfifo/1
mkfifo ${workdir}/mkfifo/1

Then #

  • after mkfifo ${workdir}/mkfifo/1:
    • exit code is not 0
    • stderr equals an exact value

Scenario: make two pipes and report the one that failed #

When #

mkdir -p mkfifo && chmod 775 mkfifo
mkfifo ${workdir}/mkfifo/1 /no_exist_path/fifo ${workdir}/mkfifo/3
ls ${workdir}/mkfifo

Then #

  • stdout equals an exact value
  • stderr equals an exact value

Expected output #

expected stdout:

1
3

mimixbox mountpoint #

Source: test/e2e/tools/mimixbox/fileutils/mountpoint.atago.yaml

Scenario: reports that / is a mountpoint #

When #

mountpoint /

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox mv #

Source: test/e2e/tools/mimixbox/fileutils/mv.atago.yaml

Scenario: rename a file #

When #

mkdir -p mv/inner mv2 mv3 mv4 && touch mv/1.txt mv/2.txt mv/3.txt mv/inner/inner.txt
mv ${workdir}/mv/1.txt ${workdir}/mv/rename.txt && ls ${workdir}/mv/rename.txt

Then #

  • after mv ${workdir}/mv/1.txt ${workdir}/mv/rename.txt && ls ${workdir}/mv/rename.txt:
    • exit code is 0
    • stdout equals an exact value

Scenario: move a file into an inner directory #

When #

mkdir -p mv/inner mv2 mv3 mv4 && touch mv/1.txt mv/2.txt mv/3.txt mv/inner/inner.txt
mv ${workdir}/mv/1.txt ${workdir}/mv/inner && ls ${workdir}/mv/inner

Then #

  • after mv ${workdir}/mv/1.txt ${workdir}/mv/inner && ls ${workdir}/mv/inner:
    • exit code is 0
    • stdout equals an exact value

Expected output #

expected stdout:

1.txt
inner.txt

Scenario: move three files into an inner directory #

When #

mkdir -p mv/inner mv2 mv3 mv4 && touch mv/1.txt mv/2.txt mv/3.txt mv/inner/inner.txt
mv ${workdir}/mv/1.txt ${workdir}/mv/2.txt ${workdir}/mv/3.txt ${workdir}/mv/inner && ls ${workdir}/mv/inner

Then #

  • after mv ${workdir}/mv/1.txt ${workdir}/mv/2.txt ${workdir}/mv/3.txt ${workdir}/mv/inner && ls ${workdir}/mv/inner:
    • exit code is 0
    • stdout equals an exact value

Expected output #

expected stdout:

1.txt
2.txt
3.txt
inner.txt

Scenario: move three files where one does not exist #

When #

mkdir -p mv/inner mv2 mv3 mv4 && touch mv/1.txt mv/2.txt mv/3.txt mv/inner/inner.txt
mv ${workdir}/mv/1.txt ${workdir}/mv/no_exist_file ${workdir}/mv/3.txt ${workdir}/mv/inner; ls ${workdir}/mv/inner

Then #

  • after mv ${workdir}/mv/1.txt ${workdir}/mv/no_exist_file ${workdir}/mv/3.txt ${workdir}/mv/inner; ls ${workdir}/mv/inner:
    • stdout equals an exact value
    • stderr equals an exact value

Expected output #

expected stdout:

1.txt
3.txt
inner.txt

Scenario: move a directory into a directory #

When #

mkdir -p mv/inner mv2 mv3 mv4 && touch mv/1.txt mv/2.txt mv/3.txt mv/inner/inner.txt
mv ${workdir}/mv2 ${workdir}/mv && ls ${workdir}/mv

Then #

  • after mv ${workdir}/mv2 ${workdir}/mv && ls ${workdir}/mv:
    • exit code is 0
    • stdout equals an exact value

Expected output #

expected stdout:

1.txt
2.txt
3.txt
inner
mv2

Scenario: move three directories #

When #

mkdir -p mv/inner mv2 mv3 mv4 && touch mv/1.txt mv/2.txt mv/3.txt mv/inner/inner.txt
mv ${workdir}/mv2 ${workdir}/mv3 ${workdir}/mv4 ${workdir}/mv && ls ${workdir}/mv

Then #

  • after mv ${workdir}/mv2 ${workdir}/mv3 ${workdir}/mv4 ${workdir}/mv && ls ${workdir}/mv:
    • exit code is 0
    • stdout equals an exact value

Expected output #

expected stdout:

1.txt
2.txt
3.txt
inner
mv2
mv3
mv4

Scenario: move three directories where one does not exist #

When #

mkdir -p mv/inner mv2 mv3 mv4 && touch mv/1.txt mv/2.txt mv/3.txt mv/inner/inner.txt
mv ${workdir}/mv2 ${workdir}/mv/no_exist_dir ${workdir}/mv4 ${workdir}/mv/inner; ls ${workdir}/mv/inner

Then #

  • after mv ${workdir}/mv2 ${workdir}/mv/no_exist_dir ${workdir}/mv4 ${workdir}/mv/inner; ls ${workdir}/mv/inner:
    • stdout equals an exact value
    • stderr equals an exact value

Expected output #

expected stdout:

inner.txt
mv2
mv4

Scenario: moving a file onto itself fails #

When #

mkdir -p mv/inner mv2 mv3 mv4 && touch mv/1.txt mv/2.txt mv/3.txt mv/inner/inner.txt
mv ${workdir}/mv/1.txt ${workdir}/mv/1.txt

Then #

  • after mv ${workdir}/mv/1.txt ${workdir}/mv/1.txt:
    • exit code is not 0
    • stderr equals an exact value

Expected output #

expected stderr:

mv: source '${workdir}/mv/1.txt' and destination '${workdir}/mv/1.txt' is same

Scenario: overwrite a file with the same destination name #

When #

mkdir -p mv/inner mv2 mv3 mv4 && touch mv/1.txt mv/2.txt mv/3.txt mv/inner/inner.txt
touch ${workdir}/mv/inner.txt && mv ${workdir}/mv/inner.txt ${workdir}/mv/inner/inner.txt && ls ${workdir}/mv && ls ${workdir}/mv/inner

Then #

  • after touch ${workdir}/mv/inner.txt && mv ${workdir}/mv/inner.txt ${workdir}/mv/inner/inner.txt && ls ${workdir}/mv && ls ${workdir}/mv/inner:
    • exit code is 0
    • stdout equals an exact value

Expected output #

expected stdout:

1.txt
2.txt
3.txt
inner
inner.txt

Scenario: overwrite with the backup option keeps a tilde copy #

When #

mkdir -p mv/inner mv2 mv3 mv4 && touch mv/1.txt mv/2.txt mv/3.txt mv/inner/inner.txt
touch ${workdir}/mv/inner.txt && mv -b ${workdir}/mv/inner.txt ${workdir}/mv/inner && ls ${workdir}/mv/inner

Then #

  • after touch ${workdir}/mv/inner.txt && mv -b ${workdir}/mv/inner.txt ${workdir}/mv/inner && ls ${workdir}/mv/inner:
    • exit code is 0
    • stdout equals an exact value

Expected output #

expected stdout:

inner.txt
inner.txt~

mimixbox mv GNU flags #

Source: test/e2e/tools/mimixbox/fileutils/mv_gnu.atago.yaml

Scenario: mv –target-directory moves each source into the directory #

When #

mkdir -p mv_gnu/dst
printf 'A\n' > mv_gnu/a.txt
printf 'B\n' > mv_gnu/b.txt

mv --target-directory ${workdir}/mv_gnu/dst ${workdir}/mv_gnu/a.txt ${workdir}/mv_gnu/b.txt && ls ${workdir}/mv_gnu/dst

Then #

  • after mv --target-directory ${workdir}/mv_gnu/dst ${workdir}/mv_gnu/a.txt ${workdir}/mv_gnu/b.txt && ls ${workdir}/mv_gnu/dst:
    • exit code is 0
    • stdout equals an exact value

Expected output #

expected stdout:

a.txt
b.txt

Scenario: mv –update preserves a newer destination #

When #

mkdir -p mv_gnu
printf 'source\n' > mv_gnu/src.txt
sleep 1
printf 'newer-dest\n' > mv_gnu/dest.txt
mv --update ${workdir}/mv_gnu/src.txt ${workdir}/mv_gnu/dest.txt
cat ${workdir}/mv_gnu/dest.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Source: test/e2e/tools/mimixbox/fileutils/readlink.atago.yaml

When #

printf 'x' > ${workdir}/rl_target && ln -sf ${workdir}/rl_target ${workdir}/rl_link
readlink ${workdir}/rl_link

Then #

  • after readlink ${workdir}/rl_link:
    • exit code is 0
    • stdout equals an exact value

Source: test/e2e/tools/mimixbox/fileutils/readlink_gnu.atago.yaml

Scenario: fails when -e is given a missing path #

Given #

  • Fixture file target is created.
  • Fixture file link is created.

When #

readlink -e ${workdir}/does-not-exist

Then #

  • exit code is not 0
  • stdout is empty

Given #

  • Fixture file target is created.
  • Fixture file link is created.

When #

readlink -e ${workdir}/link

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: succeeds with -m on a missing path #

Given #

  • Fixture file target is created.
  • Fixture file link is created.

When #

readlink -m ${workdir}/a/b/c

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: terminates output with NUL under -z #

Given #

  • Fixture file target is created.
  • Fixture file link is created.

When #

readlink -z ${workdir}/link

Then #

  • exit code is 0
  • stdout matches /target\x00$/

mimixbox rm #

Source: test/e2e/tools/mimixbox/fileutils/rm.atago.yaml

Scenario: remove one file #

When #

mkdir -p rm/inner && touch rm/1.txt rm/2.txt rm/3.txt rm/inner/inner.txt
rm ${workdir}/rm/1.txt && ls ${workdir}/rm

Then #

  • after rm ${workdir}/rm/1.txt && ls ${workdir}/rm:
    • exit code is 0
    • stdout equals an exact value

Expected output #

expected stdout:

2.txt
3.txt
inner

Scenario: remove files using a wildcard #

When #

mkdir -p rm/inner && touch rm/1.txt rm/2.txt rm/3.txt rm/inner/inner.txt
rm ${workdir}/rm/*.txt && ls ${workdir}/rm

Then #

  • after rm ${workdir}/rm/*.txt && ls ${workdir}/rm:
    • exit code is 0
    • stdout equals an exact value

Scenario: remove three files at the same time #

When #

mkdir -p rm/inner && touch rm/1.txt rm/2.txt rm/3.txt rm/inner/inner.txt
rm ${workdir}/rm/1.txt ${workdir}/rm/2.txt ${workdir}/rm/3.txt && ls ${workdir}/rm

Then #

  • after rm ${workdir}/rm/1.txt ${workdir}/rm/2.txt ${workdir}/rm/3.txt && ls ${workdir}/rm:
    • exit code is 0
    • stdout equals an exact value

Scenario: remove two files and report the missing one #

When #

mkdir -p rm/inner && touch rm/1.txt rm/2.txt rm/3.txt rm/inner/inner.txt
rm ${workdir}/rm/1.txt ${workdir}/rm/no_exist_file.txt ${workdir}/rm/3.txt; ls ${workdir}/rm

Then #

  • after rm ${workdir}/rm/1.txt ${workdir}/rm/no_exist_file.txt ${workdir}/rm/3.txt; ls ${workdir}/rm:
    • stdout equals an exact value
    • stderr equals an exact value

Expected output #

expected stdout:

2.txt
inner

expected stderr:

rm: can't remove ${workdir}/rm/no_exist_file.txt: No such file or directory exists

Scenario: can not remove a directory without the recursive option #

When #

mkdir -p rm/inner && touch rm/1.txt rm/2.txt rm/3.txt rm/inner/inner.txt
rm ${workdir}/rm; ls ${workdir}/rm

Then #

  • after rm ${workdir}/rm; ls ${workdir}/rm:
    • stdout equals an exact value
    • stderr equals an exact value

Expected output #

expected stdout:

1.txt
2.txt
3.txt
inner

Scenario: remove a directory with the recursive option #

When #

mkdir -p rm/inner && touch rm/1.txt rm/2.txt rm/3.txt rm/inner/inner.txt
rm -rf ${workdir}/rm && ls ${workdir}

Then #

  • after rm -rf ${workdir}/rm && ls ${workdir}:
    • exit code is 0

mimixbox rm GNU flags #

Source: test/e2e/tools/mimixbox/fileutils/rm_gnu.atago.yaml

Scenario: refuses to recurse on / by default (–preserve-root) #

When #

rm -r /

Then #

  • exit code is not 0
  • stderr contains it is dangerous to operate recursively on '/', use --no-preserve-root to override this failsafe

Scenario: removes an ordinary directory recursively (guard does not interfere) #

When #

mkdir -p tree/sub && : > tree/sub/leaf.txt && rm -r tree && [ ! -e tree ] && printf 'gone'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: removes a single-filesystem tree with –one-file-system #

When #

mkdir -p ofs/a/b && : > ofs/a/b/leaf.txt && : > ofs/top.txt && rm -r --one-file-system ofs && [ ! -e ofs ] && printf 'gone'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: removes a tree when –no-preserve-root is given (safe target) #

When #

mkdir -p victim/sub && : > victim/sub/f && rm -r --no-preserve-root victim && [ ! -e victim ] && printf 'gone'

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox rmdir #

Source: test/e2e/tools/mimixbox/fileutils/rmdir.atago.yaml

Scenario: removes an empty directory #

When #

mkdir -p ${workdir}/rmdir/empty && rmdir ${workdir}/rmdir/empty && test ! -d ${workdir}/rmdir/empty && echo "removed"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: fails on a non-empty directory #

When #

mkdir -p ${workdir}/rmdir/full && touch ${workdir}/rmdir/full/file.txt
rmdir ${workdir}/rmdir/full

Then #

  • after rmdir ${workdir}/rmdir/full:
    • exit code is not 0
    • stderr equals an exact value

Expected output #

expected stderr:

rmdir: failed to remove '${workdir}/rmdir/full': Directory not empty

Scenario: rmdir -p removes nested empty directories #

When #

mkdir -p ${workdir}/rmdir/a/b/c
cd ${workdir}/rmdir
rmdir -p a/b/c
test ! -d ${workdir}/rmdir/a && echo "removed"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: rmdir with no operand reports an error #

When #

rmdir

Then #

  • exit code is not 0
  • stderr equals an exact value

mimixbox serial #

Source: test/e2e/tools/mimixbox/fileutils/serial.atago.yaml

Scenario: adds a serial-number prefix to each file #

When #

mkdir -p serial && touch serial/apple.txt serial/banana.txt serial/cherry.txt
serial ${workdir}/serial > /dev/null && ls ${workdir}/serial

Then #

  • after serial ${workdir}/serial > /dev/null && ls ${workdir}/serial:
    • exit code is 0
    • stdout equals an exact value

Expected output #

expected stdout:

0_apple.txt
1_banana.txt
2_cherry.txt

Scenario: –dry-run does not rename anything #

When #

mkdir -p serial && touch serial/apple.txt serial/banana.txt serial/cherry.txt
serial -d ${workdir}/serial > /dev/null && ls ${workdir}/serial

Then #

  • after serial -d ${workdir}/serial > /dev/null && ls ${workdir}/serial:
    • exit code is 0
    • stdout equals an exact value

Expected output #

expected stdout:

apple.txt
banana.txt
cherry.txt

Scenario: serial with no operand reports an error #

When #

serial

Then #

  • exit code is not 0
  • stderr equals an exact value

mimixbox shred #

Source: test/e2e/tools/mimixbox/fileutils/shred.atago.yaml

Scenario: overwrites and removes the file #

Given #

  • Fixture file shred_file is created.

Inputs #

Fixture shred_file:

secret

When #

shred -u ${workdir}/shred_file && test ! -e ${workdir}/shred_file && echo gone

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox stat #

Source: test/e2e/tools/mimixbox/fileutils/stat.atago.yaml

Scenario: prints the size with a custom format #

Given #

  • Fixture file stat_file is created.

Inputs #

Fixture stat_file:

hello

When #

stat -c %s ${workdir}/stat_file

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox stat GNU flags #

Source: test/e2e/tools/mimixbox/fileutils/stat_gnu.atago.yaml

Scenario: prints name and size via –printf with no trailing newline #

Given #

  • Fixture file stat_file is created.

Inputs #

Fixture stat_file:

hello

When #

stat --printf '%n=%s' ${workdir}/stat_file

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: interprets backslash escapes in –printf #

Given #

  • Fixture file stat_file is created.

Inputs #

Fixture stat_file:

hello

When #

stat --printf '%n %s\n' ${workdir}/stat_file

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: appends a trailing newline for –format #

Given #

  • Fixture file stat_file is created.

Inputs #

Fixture stat_file:

hello

When #

stat --format '%s' ${workdir}/stat_file | wc -l | tr -d ' '

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: prints a single space-separated terse line #

Given #

  • Fixture file stat_file is created.

Inputs #

Fixture stat_file:

hello

When #

stat --terse ${workdir}/stat_file | awk '{print NF}'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: reports the size as the second terse field #

Given #

  • Fixture file stat_file is created.

Inputs #

Fixture stat_file:

hello

When #

stat --terse ${workdir}/stat_file | awk '{print $2}'

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox touch #

Source: test/e2e/tools/mimixbox/fileutils/touch.atago.yaml

Scenario: make one file #

When #

mkdir -p touch && touch ${workdir}/touch/touch.txt && ls ${workdir}/touch/touch.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: make three files at the same time #

When #

mkdir -p touch
touch ${workdir}/touch/1.txt ${workdir}/touch/2.txt ${workdir}/touch/3.txt
ls ${workdir}/touch/1.txt
ls ${workdir}/touch/2.txt
ls ${workdir}/touch/3.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

${workdir}/touch/1.txt
${workdir}/touch/2.txt
${workdir}/touch/3.txt

Scenario: make two files and fail to make one at an unwritable path #

When #

mkdir -p touch
touch ${workdir}/touch/1.txt /touch/2.txt ${workdir}/touch/3.txt
ls ${workdir}/touch/1.txt
ls ${workdir}/touch/3.txt

Then #

  • stdout equals an exact value
  • stderr equals an exact value

Expected output #

expected stdout:

${workdir}/touch/1.txt
${workdir}/touch/3.txt

mimixbox touch GNU flags #

Source: test/e2e/tools/mimixbox/fileutils/touch_gnu.atago.yaml

Scenario: copies the reference file mtime (–reference) #

When #

: > ref && : > dst && touch -d '2001-02-03 04:05:06' ref && touch --reference=ref dst && [ "$(/usr/bin/stat -c '%Y' ref)" = "$(/usr/bin/stat -c '%Y' dst)" ] && printf 'match'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: sets a known time with –date #

When #

: > f && touch -d '2020-06-15 12:34:56' f && [ "$(/bin/date -d '2020-06-15 12:34:56' '+%s')" = "$(/usr/bin/stat -c '%Y' f)" ] && printf 'match'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: accepts –time=atime without error #

When #

touch --time=atime g

Then #

  • exit code is 0
  • file g exists

Generated artifacts #

  • g

Scenario: rejects an invalid –time word #

When #

touch --time=bogus h

Then #

  • exit code is not 0
  • stderr contains invalid argument

When #

: > target && touch -d '2005-05-05 05:05:05' target && ln -s target link && touch -h -d '2030-01-01 00:00:00' link && [ "$(/bin/date -d '2005-05-05 05:05:05' '+%s')" = "$(/usr/bin/stat -c '%Y' target)" ] && printf 'target-unchanged'

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox truncate #

Source: test/e2e/tools/mimixbox/fileutils/truncate.atago.yaml

Scenario: sets the file to the given size #

When #

truncate -s 7 ${workdir}/tr_file && wc -c < ${workdir}/tr_file | tr -d ' '

Then #

  • exit code is 0
  • stdout equals an exact value

Source: test/e2e/tools/mimixbox/fileutils/unlink.atago.yaml

Scenario: removes a single file #

Given #

  • Fixture file unlink.txt is created.

Inputs #

Fixture unlink.txt:

x

When #

unlink ${workdir}/unlink.txt && test ! -e ${workdir}/unlink.txt && echo gone

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox alias parity #

Source: test/e2e/tools/mimixbox/findutils/alias_parity.atago.yaml

Scenario: egrep matches the same lines as grep -E over the same file #

Given #

  • Fixture file fixture.txt is created.

Inputs #

Fixture fixture.txt:

apple
banana
a.b
axb

When #

egrep 'a(p|x)' fixture.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

apple
axb

Scenario: fgrep matches the same lines as grep -F over the same file #

Given #

  • Fixture file fixture.txt is created.

Inputs #

Fixture fixture.txt:

apple
banana
a.b
axb

When #

fgrep 'a.b' fixture.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: netcat answers –help with exit 0 and an Examples section #

When #

netcat --help

Then #

  • exit code is 0
  • stdout contains Usage: netcat, Examples:
  • stderr is empty

Scenario: nc answers –help with exit 0 and an Examples section #

When #

nc --help

Then #

  • exit code is 0
  • stdout contains Usage: nc, Examples:
  • stderr is empty

mimixbox egrep #

Source: test/e2e/tools/mimixbox/findutils/egrep.atago.yaml

Scenario: describes itself with –help #

When #

egrep --help

Then #

  • exit code is 0
  • stdout contains Usage: egrep
  • stderr is empty

mimixbox fgrep #

Source: test/e2e/tools/mimixbox/findutils/fgrep.atago.yaml

Scenario: describes itself with –help #

When #

fgrep --help

Then #

  • exit code is 0
  • stdout contains Usage: fgrep
  • stderr is empty

mimixbox find #

Source: test/e2e/tools/mimixbox/findutils/find.atago.yaml

Scenario: finds a file by -name #

When #

mkdir -p find/sub && touch find/a.txt find/sub/b.txt
find ${workdir}/find -name a.txt

Then #

  • after find ${workdir}/find -name a.txt:
    • exit code is 0
    • stdout equals an exact value

Scenario: lists directories with -type d #

When #

mkdir -p find/sub && touch find/a.txt find/sub/b.txt
find ${workdir}/find -type d | wc -l | tr -d ' '

Then #

  • after find ${workdir}/find -type d | wc -l | tr -d ' ':
    • exit code is 0
    • stdout equals an exact value

Scenario: rejects an unknown predicate #

When #

mkdir -p find/sub && touch find/a.txt find/sub/b.txt
find ${workdir}/find -bogus

Then #

  • after find ${workdir}/find -bogus:
    • exit code is not 0
    • stderr contains unknown predicate

Scenario: prints usage for –help #

When #

find --help

Then #

  • exit code is 0
  • stdout contains Usage: find

Scenario: lists an Options block with –help and –version in –help #

When #

find --help

Then #

  • exit code is 0
  • stdout contains Options:, --help, --version

Scenario: documents the supported subset tokens in –help #

When #

find --help

Then #

  • exit code is 0
  • stdout contains -name, -type, -print0, -maxdepth, -mindepth

Scenario: prints the version line for –version #

When #

find --version

Then #

  • exit code is 0
  • stdout contains find (mimixbox)

mimixbox grep #

Source: test/e2e/tools/mimixbox/findutils/grep.atago.yaml

Scenario: matches lines from stdin #

When #

printf 'one\ntwo\nthree\n' | grep two

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: matches lines from a file #

Given #

  • Fixture file fruits.txt is created.

Inputs #

Fixture fruits.txt:

apple
banana
cherry

When #

grep an ${workdir}/fruits.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: counts matching lines with -c #

Given #

  • Fixture file fruits.txt is created.

Inputs #

Fixture fruits.txt:

apple
banana
cherry

When #

grep -c a ${workdir}/fruits.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: exits 1 when nothing matches #

When #

printf 'x\n' | grep zzz

Then #

  • exit code is 1

mimixbox grep GNU flags #

Source: test/e2e/tools/mimixbox/findutils/grep_gnu.atago.yaml

Scenario: prints trailing context with -A1 #

Given #

  • Fixture file grep_gnu/ctx.txt is created.

Inputs #

Fixture grep_gnu/ctx.txt:

1
2
MATCH
b
c

When #

grep -A1 MATCH ${workdir}/grep_gnu/ctx.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

MATCH
b

Scenario: prints leading context with -B1 #

Given #

  • Fixture file grep_gnu/ctx2.txt is created.

Inputs #

Fixture grep_gnu/ctx2.txt:

a
MATCH
b

When #

grep -B1 MATCH ${workdir}/grep_gnu/ctx2.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

a
MATCH

Scenario: prints surrounding context with -C1 #

Given #

  • Fixture file grep_gnu/ctx2.txt is created.

Inputs #

Fixture grep_gnu/ctx2.txt:

a
MATCH
b

When #

grep -C1 MATCH ${workdir}/grep_gnu/ctx2.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

a
MATCH
b

Scenario: separates non-contiguous groups with – #

Given #

  • Fixture file grep_gnu/groups.txt is created.

Inputs #

Fixture grep_gnu/groups.txt:

MATCH
b
c
d
e
f
MATCH

When #

grep -A1 MATCH ${workdir}/grep_gnu/groups.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: searches only included files with –include #

When #

mkdir -p grep_gnu
printf 'needle\n' > grep_gnu/keep.go
printf 'needle\n' > grep_gnu/skip.txt

grep -r --include=*.go needle ${workdir}/grep_gnu

Then #

  • after grep -r --include=*.go needle ${workdir}/grep_gnu:
    • exit code is 0
    • stdout contains keep.go
    • stdout does not contain skip.txt

Scenario: skips excluded files with –exclude #

When #

mkdir -p grep_gnu
printf 'needle\n' > grep_gnu/keep.go
printf 'needle\n' > grep_gnu/app.log

grep -r --exclude=*.log needle ${workdir}/grep_gnu

Then #

  • after grep -r --exclude=*.log needle ${workdir}/grep_gnu:
    • exit code is 0
    • stdout does not contain app.log

Scenario: skips excluded directories with –exclude-dir #

When #

mkdir -p grep_gnu/src grep_gnu/vendor
printf 'needle\n' > grep_gnu/src/a.txt
printf 'needle\n' > grep_gnu/vendor/b.txt

grep -r --exclude-dir=vendor needle ${workdir}/grep_gnu

Then #

  • after grep -r --exclude-dir=vendor needle ${workdir}/grep_gnu:
    • exit code is 0
    • stdout does not contain vendor

Scenario: highlights matches with –color=always #

When #

printf 'hello world\n' | grep --color=always world

Then #

  • exit code is 0
  • stdout contains world

Scenario: prints byte offsets with -b #

Given #

  • Fixture file grep_gnu/off.txt is created.

Inputs #

Fixture grep_gnu/off.txt:

aaa
bbb
ccc

When #

grep -b bbb ${workdir}/grep_gnu/off.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: prints files without a match with -L #

When #

mkdir -p grep_gnu
printf 'needle\n' > grep_gnu/hit.txt
printf 'nothing\n' > grep_gnu/miss.txt

grep -L needle ${workdir}/grep_gnu/hit.txt ${workdir}/grep_gnu/miss.txt

Then #

  • after grep -L needle ${workdir}/grep_gnu/hit.txt ${workdir}/grep_gnu/miss.txt:
    • exit code is 0
    • stdout contains miss.txt
    • stdout does not contain hit.txt

mimixbox findutils help helpers #

Source: test/e2e/tools/mimixbox/findutils/help_helpers_findutils.atago.yaml

Scenario: egrep –help is structured #

When #

egrep --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: fgrep –help is structured #

When #

fgrep --help

Then #

  • exit code is 0
  • stdout contains Usage:

mimixbox xargs #

Source: test/e2e/tools/mimixbox/findutils/xargs.atago.yaml

Scenario: appends stdin items to the command #

When #

printf 'a b c\n' | xargs echo

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: splits into groups with -n #

When #

printf '1 2 3 4\n' | xargs -n 2 echo | wc -l | tr -d ' '

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: substitutes with -I #

When #

printf 'world\n' | xargs -I {} echo hello {}

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox xargs GNU flags #

Source: test/e2e/tools/mimixbox/findutils/xargs_gnu.atago.yaml

Scenario: runs once per input line with -L 1 #

When #

printf 'a b\nc d\ne f\n' | xargs -L 1 echo | wc -l | tr -d ' '

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: groups two input lines per invocation with -L 2 #

When #

printf 'a\nb\nc\n' | xargs -L 2 echo | wc -l | tr -d ' '

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: splits a long input into multiple invocations with -s #

When #

printf '1 2 3 4 5 6 7 8\n' | xargs -s 8 echo | wc -l | tr -d ' '

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: keeps every item across the -s split invocations #

When #

printf '1 2 3 4 5 6 7 8\n' | xargs -s 8 echo | tr ' ' '\n' | grep -c .

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: runs all batches concurrently with -P 4 #

When #

printf 'a\nb\nc\nd\n' | xargs -P 4 -n 1 echo | sort | tr '\n' ' ' | sed 's/ $//'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: runs all batches with -P 0 #

When #

printf 'a\nb\nc\nd\n' | xargs -P 0 -n 1 echo | sort | tr '\n' ' ' | sed 's/ $//'

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox lifegame CLI contract #

Source: test/e2e/tools/mimixbox/games/lifegame.atago.yaml

Scenario: prints usage with –help and exits 0 #

When #

lifegame --help

Then #

  • exit code is 0
  • stdout contains Usage: lifegame

mimixbox banner #

Source: test/e2e/tools/mimixbox/jokeutils/banner.atago.yaml

Scenario: prints five rows of art #

When #

banner HI | wc -l | tr -d ' '

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox cmatrix #

Source: test/e2e/tools/mimixbox/jokeutils/cmatrix.atago.yaml

Scenario: exits gracefully without a terminal #

When #

cmatrix
echo "rc:$?"

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox cowsay #

Source: test/e2e/tools/mimixbox/jokeutils/cowsay.atago.yaml

Scenario: prints usage with –help and exits 0 #

When #

cowsay --help

Then #

  • exit code is 0
  • stdout contains Usage: cowsay

Scenario: renders the message in the speech bubble #

When #

cowsay hello

Then #

  • exit code is 0
  • stdout contains hello

mimixbox cowthink #

Source: test/e2e/tools/mimixbox/jokeutils/cowthink.atago.yaml

Scenario: draws the thought-bubble connector #

When #

cowthink hi | head -n 4 | tail -n 1

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox fakemovie #

Source: test/e2e/tools/mimixbox/jokeutils/fakemovie.atago.yaml

Scenario: prints usage with –help and exits 0 #

When #

fakemovie --help

Then #

  • exit code is 0
  • stdout contains Usage: fakemovie

Scenario: fails with a message when given no operand #

When #

fakemovie

Then #

  • exit code is not 0
  • stderr contains fakemovie

mimixbox fortune #

Source: test/e2e/tools/mimixbox/jokeutils/fortune.atago.yaml

Scenario: prints a single adage line #

When #

fortune | wc -l | tr -d ' '

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox jokeutils –help contract #

Source: test/e2e/tools/mimixbox/jokeutils/help_helpers.atago.yaml

Scenario: sl –help is structured #

When #

sl --help

Then #

  • exit code is 0
  • stdout contains Usage:

mimixbox nyancat #

Source: test/e2e/tools/mimixbox/jokeutils/nyancat.atago.yaml

Scenario: exits gracefully without a terminal #

When #

nyancat
echo "rc:$?"

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox sl #

Source: test/e2e/tools/mimixbox/jokeutils/sl.atago.yaml

Scenario: describes itself with –help #

When #

sl --help

Then #

  • exit code is 0
  • stdout contains Usage: sl
  • stderr is empty

mimixbox acpid #

Source: test/e2e/tools/mimixbox/loginutils/acpid.atago.yaml

Scenario: requires foreground mode #

When #

acpid

Then #

  • exit code is not 0

Scenario: describes itself with –help #

When #

acpid --help

Then #

  • exit code is 0
  • stdout contains Usage: acpid, ACPI

mimixbox addgroup #

Source: test/e2e/tools/mimixbox/loginutils/addgroup.atago.yaml

Scenario: describes itself with –help #

When #

addgroup --help

Then #

  • exit code is 0
  • stdout contains Usage: addgroup
  • stderr is empty

mimixbox adduser #

Source: test/e2e/tools/mimixbox/loginutils/adduser.atago.yaml

Scenario: requires a user name #

When #

adduser

Then #

  • exit code is not 0

Scenario: describes itself with –help #

When #

adduser --help

Then #

  • exit code is 0
  • stdout contains Usage: adduser, account

mimixbox bootchartd #

Source: test/e2e/tools/mimixbox/loginutils/bootchartd.atago.yaml

Scenario: records a proc_stat sample #

When #

bootchartd -o "${workdir}/bc" >/dev/null && grep -c '^cpu ' "${workdir}/bc/proc_stat.log"

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox chpasswd #

Source: test/e2e/tools/mimixbox/loginutils/chpasswd.atago.yaml

Scenario: rejects an unknown method #

Inputs #

stdin for chpasswd:

alice:secret

When #

chpasswd -c bogus

Then #

  • exit code is not 0

Scenario: describes itself with –help #

When #

chpasswd --help

Then #

  • exit code is 0
  • stdout contains Usage: chpasswd, password

mimixbox chsh #

Source: test/e2e/tools/mimixbox/loginutils/chsh.atago.yaml

Scenario: describes itself with –help #

When #

chsh --help

Then #

  • exit code is 0
  • stdout contains Usage: chsh, login shell

Scenario: lists shells and exits successfully #

When #

chsh -l

Then #

  • exit code is 0

Scenario: rejects an unknown user #

When #

chsh -s /bin/sh mimixbox-no-such-user-xyz

Then #

  • exit code is not 0

Scenario: rejects a relative shell path #

When #

chsh -s relative/shell root

Then #

  • exit code is not 0

mimixbox crond #

Source: test/e2e/tools/mimixbox/loginutils/crond.atago.yaml

Scenario: requires foreground mode #

When #

crond

Then #

  • exit code is not 0

Scenario: describes itself with –help #

When #

crond --help

Then #

  • exit code is 0
  • stdout contains Usage: crond, cron

mimixbox crontab #

Source: test/e2e/tools/mimixbox/loginutils/crontab.atago.yaml

Scenario: reports that interactive edit is unsupported #

When #

crontab -e

Then #

  • exit code is not 0

Scenario: describes itself with –help #

When #

crontab --help

Then #

  • exit code is 0
  • stdout contains Usage: crontab, crontab

mimixbox cryptpw #

Source: test/e2e/tools/mimixbox/loginutils/cryptpw.atago.yaml

Scenario: hashes a stdin password with sha-512 #

Inputs #

stdin for cryptpw:

secret

When #

cryptpw -S abcdefgh

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

$6$abcdefgh$ltjgWl6579NluT/Vi1nwEvcil.G5Nbc4NiXZaNGStk8PSwGfQv72N2CKPPrVACtLtip/cZ/1GM/O6IND4WQhG.

Scenario: supports the md5 method #

Inputs #

stdin for cryptpw:

secret

When #

cryptpw -m md5 -S abcdefgh

Then #

  • exit code is 0
  • stdout contains $1$abcdefgh$

mimixbox delgroup #

Source: test/e2e/tools/mimixbox/loginutils/delgroup.atago.yaml

Scenario: describes itself with –help #

When #

delgroup --help

Then #

  • exit code is 0
  • stdout contains Usage: delgroup
  • stderr is empty

mimixbox deluser #

Source: test/e2e/tools/mimixbox/loginutils/deluser.atago.yaml

Scenario: requires a user name #

When #

deluser

Then #

  • exit code is not 0

Scenario: describes itself with –help #

When #

deluser --help

Then #

  • exit code is 0
  • stdout contains Usage: deluser, user

mimixbox getty #

Source: test/e2e/tools/mimixbox/loginutils/getty.atago.yaml

Scenario: prints the login prompt #

When #

printf '\n' | getty tty1 2>/dev/null | grep -c 'login: '

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: requires a TTY argument #

Inputs #

stdin for getty:

alice

When #

getty

Then #

  • exit code is not 0

mimixbox addgroup / delgroup #

Source: test/e2e/tools/mimixbox/loginutils/group.atago.yaml

Scenario: addgroup requires a group name #

When #

addgroup

Then #

  • exit code is not 0

Scenario: delgroup requires a group name #

When #

delgroup

Then #

  • exit code is not 0

mimixbox loginutils –help helpers #

Source: test/e2e/tools/mimixbox/loginutils/help_helpers_loginutils.atago.yaml

Scenario: addgroup –help is structured #

When #

addgroup --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: delgroup –help is structured #

When #

delgroup --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: linuxrc –help is structured #

When #

linuxrc --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: run-init –help is structured #

When #

run-init --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: run-parts –help is structured #

When #

run-parts --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: start-stop-daemon –help is structured #

When #

start-stop-daemon --help

Then #

  • exit code is 0
  • stdout contains Usage:

mimixbox init #

Source: test/e2e/tools/mimixbox/loginutils/init.atago.yaml

Scenario: runs the inittab sysinit and wait actions #

Given #

  • Fixture file inittab is created.

Inputs #

Fixture inittab:

si::sysinit:echo SYSINIT
l::wait:echo WAIT

When #

init -t inittab

Then #

  • exit code is 0
  • stdout equals an exact value
  • stdout equals an exact value

Scenario: fails on a missing inittab #

When #

init -t no_such_inittab

Then #

  • exit code is not 0

mimixbox login #

Source: test/e2e/tools/mimixbox/loginutils/login.atago.yaml

Scenario: fails for an unknown user #

Inputs #

stdin for login:

nope

When #

login nonexistent_user_xyz

Then #

  • exit code is not 0

Scenario: describes itself with –help #

When #

login --help

Then #

  • exit code is 0
  • stdout contains Usage: login, login shell

mimixbox mkpasswd #

Source: test/e2e/tools/mimixbox/loginutils/mkpasswd.atago.yaml

Scenario: hashes with sha-512 and a fixed salt #

When #

mkpasswd -m sha-512 -S abcdefgh secret

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

$6$abcdefgh$ltjgWl6579NluT/Vi1nwEvcil.G5Nbc4NiXZaNGStk8PSwGfQv72N2CKPPrVACtLtip/cZ/1GM/O6IND4WQhG.

Scenario: reads the password from stdin #

Inputs #

stdin for mkpasswd:

frompipe

When #

mkpasswd -m md5 -S abcdefgh

Then #

  • exit code is 0
  • stdout contains $1$abcdefgh$

mimixbox nologin #

Source: test/e2e/tools/mimixbox/loginutils/nologin.atago.yaml

Scenario: prints a refusal and exits non-zero #

When #

nologin

Then #

  • exit code is not 0
  • stdout contains not available

Scenario: never runs a passed command #

When #

count=$(nologin -c "echo pwned" 2>/dev/null | grep -c pwned); echo "$count"

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox passwd #

Source: test/e2e/tools/mimixbox/loginutils/passwd.atago.yaml

Scenario: rejects conflicting flags #

When #

passwd -l -u alice

Then #

  • exit code is not 0

Scenario: describes itself with –help #

When #

passwd --help

Then #

  • exit code is 0
  • stdout contains Usage: passwd, password

mimixbox run-init #

Source: test/e2e/tools/mimixbox/loginutils/run-init.atago.yaml

Scenario: describes itself with –help #

When #

run-init --help

Then #

  • exit code is 0
  • stdout contains Usage: run-init
  • stderr is empty

mimixbox run-parts #

Source: test/e2e/tools/mimixbox/loginutils/run-parts.atago.yaml

Scenario: describes itself with –help #

When #

run-parts --help

Then #

  • exit code is 0
  • stdout contains Usage: run-parts
  • stderr is empty

mimixbox run-init #

Source: test/e2e/tools/mimixbox/loginutils/run_init.atago.yaml

Scenario: requires NEW_ROOT and INIT #

When #

run-init /tmp

Then #

  • exit code is not 0

Scenario: rejects a non-directory NEW_ROOT #

When #

run-init /no/such/dir /init

Then #

  • exit code is not 0

mimixbox run-parts #

Source: test/e2e/tools/mimixbox/loginutils/run_parts.atago.yaml

Scenario: runs executables in alphabetical order #

Given #

  • Fixture file parts/20-b is created.
  • Fixture file parts/10-a is created.

Inputs #

Fixture parts/20-b:

#!/bin/sh
echo B

Fixture parts/10-a:

#!/bin/sh
echo A

When #

run-parts parts

Then #

  • exit code is 0
  • stdout equals an exact value
  • stdout equals an exact value

Scenario: requires a directory #

When #

run-parts

Then #

  • exit code is not 0

mimixbox runlevel #

Source: test/e2e/tools/mimixbox/loginutils/runlevel.atago.yaml

Scenario: reports a runlevel or unknown #

When #

runlevel

Then #

  • stdout matches /.+/

mimixbox start-stop-daemon #

Source: test/e2e/tools/mimixbox/loginutils/start-stop-daemon.atago.yaml

Scenario: describes itself with –help #

When #

start-stop-daemon --help

Then #

  • exit code is 0
  • stdout contains Usage: start-stop-daemon
  • stderr is empty

mimixbox start-stop-daemon #

Source: test/e2e/tools/mimixbox/loginutils/start_stop_daemon.atago.yaml

Scenario: starts and stops a background program #

When #

p="${workdir}/foo.pid"
start-stop-daemon -S -p "$p" -x /bin/sleep -- 30 >/dev/null 2>&1
pid=$(cat "$p")
start-stop-daemon -K -p "$p" >/dev/null 2>&1
i=0
while [ "$i" -lt 50 ] && kill -0 "$pid" 2>/dev/null; do
    sleep 0.1
    i=$((i + 1))
done
if kill -0 "$pid" 2>/dev/null; then echo alive; else echo "stopped"; fi

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: requires a start or stop mode #

When #

start-stop-daemon -p /tmp/x

Then #

  • exit code is not 0

mimixbox su #

Source: test/e2e/tools/mimixbox/loginutils/su.atago.yaml

Scenario: fails for an unknown user #

Inputs #

stdin for su:

When #

su nonexistent_user_xyz

Then #

  • exit code is not 0

Scenario: describes itself with –help #

When #

su --help

Then #

  • exit code is 0
  • stdout contains Usage: su, user

mimixbox sulogin #

Source: test/e2e/tools/mimixbox/loginutils/sulogin.atago.yaml

Scenario: rejects a wrong root password #

Inputs #

stdin for sulogin:

definitely_wrong_password

When #

sulogin

Then #

  • exit code is not 0

Scenario: describes itself with –help #

When #

sulogin --help

Then #

  • exit code is 0
  • stdout contains Usage: sulogin, root

mimixbox vlock #

Source: test/e2e/tools/mimixbox/loginutils/vlock.atago.yaml

Scenario: fails on a wrong password #

Inputs #

stdin for vlock:

definitely_wrong_xyz

When #

vlock

Then #

  • exit code is not 0

Scenario: describes itself with –help #

When #

vlock --help

Then #

  • exit code is 0
  • stdout contains Usage: vlock, terminal

mimixbox mailutils commands expose a dedicated –help helper #

Source: test/e2e/tools/mimixbox/mailutils/help_helpers_mailutils.atago.yaml

Scenario: makemime –help is structured #

When #

makemime --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: popmaildir –help is structured #

When #

popmaildir --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: reformime –help is structured #

When #

reformime --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: sendmail –help is structured #

When #

sendmail --help

Then #

  • exit code is 0
  • stdout contains Usage:

mimixbox makemime #

Source: test/e2e/tools/mimixbox/mailutils/makemime.atago.yaml

Scenario: describes itself with –help #

When #

makemime --help

Then #

  • exit code is 0
  • stdout contains Usage: makemime
  • stderr is empty

mimixbox popmaildir #

Source: test/e2e/tools/mimixbox/mailutils/popmaildir.atago.yaml

Scenario: describes itself with –help #

When #

popmaildir --help

Then #

  • exit code is 0
  • stdout contains Usage: popmaildir
  • stderr is empty

mimixbox reformime #

Source: test/e2e/tools/mimixbox/mailutils/reformime.atago.yaml

Scenario: describes itself with –help #

When #

reformime --help

Then #

  • exit code is 0
  • stdout contains Usage: reformime
  • stderr is empty

mimixbox sendmail #

Source: test/e2e/tools/mimixbox/mailutils/sendmail.atago.yaml

Scenario: describes itself with –help #

When #

sendmail --help

Then #

  • exit code is 0
  • stdout contains Usage: sendmail
  • stderr is empty

mimixbox arp #

Source: test/e2e/tools/mimixbox/netutils/arp.atago.yaml

Scenario: describes itself with –help #

When #

arp --help

Then #

  • exit code is 0
  • stdout contains Usage: arp
  • stderr is empty

mimixbox arping #

Source: test/e2e/tools/mimixbox/netutils/arping.atago.yaml

Scenario: describes itself with –help #

When #

arping --help

Then #

  • exit code is 0
  • stdout contains Usage: arping
  • stderr is empty

mimixbox brctl #

Source: test/e2e/tools/mimixbox/netutils/brctl.atago.yaml

Scenario: describes itself with –help #

When #

brctl --help

Then #

  • exit code is 0
  • stdout contains Usage: brctl
  • stderr is empty

mimixbox dhcprelay #

Source: test/e2e/tools/mimixbox/netutils/dhcprelay.atago.yaml

Scenario: describes itself with –help #

When #

dhcprelay --help

Then #

  • exit code is 0
  • stdout contains Usage: dhcprelay
  • stderr is empty

mimixbox dnsd #

Source: test/e2e/tools/mimixbox/netutils/dnsd.atago.yaml

Scenario: describes itself with –help #

When #

dnsd --help

Then #

  • exit code is 0
  • stdout contains Usage: dnsd
  • stderr is empty

mimixbox dnsdomainname #

Source: test/e2e/tools/mimixbox/netutils/dnsdomainname.atago.yaml

Scenario: describes itself with –help #

When #

dnsdomainname --help

Then #

  • exit code is 0
  • stdout contains Usage: dnsdomainname
  • stderr is empty

mimixbox dumpleases #

Source: test/e2e/tools/mimixbox/netutils/dumpleases.atago.yaml

Scenario: describes itself with –help #

When #

dumpleases --help

Then #

  • exit code is 0
  • stdout contains Usage: dumpleases
  • stderr is empty

mimixbox ether-wake #

Source: test/e2e/tools/mimixbox/netutils/ether-wake.atago.yaml

Scenario: describes itself with –help #

When #

ether-wake --help

Then #

  • exit code is 0
  • stdout contains Usage: ether-wake
  • stderr is empty

mimixbox fakeidentd #

Source: test/e2e/tools/mimixbox/netutils/fakeidentd.atago.yaml

Scenario: describes itself with –help #

When #

fakeidentd --help

Then #

  • exit code is 0
  • stdout contains Usage: fakeidentd
  • stderr is empty

mimixbox ftpd #

Source: test/e2e/tools/mimixbox/netutils/ftpd.atago.yaml

Scenario: describes itself with –help #

When #

ftpd --help

Then #

  • exit code is 0
  • stdout contains Usage: ftpd
  • stderr is empty

mimixbox ftpget #

Source: test/e2e/tools/mimixbox/netutils/ftpget.atago.yaml

Scenario: describes itself with –help #

When #

ftpget --help

Then #

  • exit code is 0
  • stdout contains Usage: ftpget
  • stderr is empty

mimixbox ftpput #

Source: test/e2e/tools/mimixbox/netutils/ftpput.atago.yaml

Scenario: describes itself with –help #

When #

ftpput --help

Then #

  • exit code is 0
  • stdout contains Usage: ftpput
  • stderr is empty

mimixbox netutils –help helpers #

Source: test/e2e/tools/mimixbox/netutils/help_helpers_netutils.atago.yaml

Scenario: arp –help is structured #

When #

arp --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: arping –help is structured #

When #

arping --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: brctl –help is structured #

When #

brctl --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: dhcprelay –help is structured #

When #

dhcprelay --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: dnsd –help is structured #

When #

dnsd --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: dnsdomainname –help is structured #

When #

dnsdomainname --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: dumpleases –help is structured #

When #

dumpleases --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: ether-wake –help is structured #

When #

ether-wake --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: fakeidentd –help is structured #

When #

fakeidentd --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: ftpd –help is structured #

When #

ftpd --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: ftpget –help is structured #

When #

ftpget --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: ftpput –help is structured #

When #

ftpput --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: http-status-code –help is structured #

When #

http-status-code --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: httpd –help is structured #

When #

httpd --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: ifconfig –help is structured #

When #

ifconfig --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: ifdown –help is structured #

When #

ifdown --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: ifenslave –help is structured #

When #

ifenslave --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: ifplugd –help is structured #

When #

ifplugd --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: ifup –help is structured #

When #

ifup --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: inetd –help is structured #

When #

inetd --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: ip –help is structured #

When #

ip --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: ipaddr –help is structured #

When #

ipaddr --help

Then #

  • exit code is 0
  • stdout contains Usage:

When #

iplink --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: ipneigh –help is structured #

When #

ipneigh --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: iproute –help is structured #

When #

iproute --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: iprule –help is structured #

When #

iprule --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: iptunnel –help is structured #

When #

iptunnel --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: nameif –help is structured #

When #

nameif --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: nbd-client –help is structured #

When #

nbd-client --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: netcat –help is structured #

When #

netcat --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: netstat –help is structured #

When #

netstat --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: nslookup –help is structured #

When #

nslookup --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: ntpd –help is structured #

When #

ntpd --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: ping6 –help is structured #

When #

ping6 --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: pscan –help is structured #

When #

pscan --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: route –help is structured #

When #

route --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: slattach –help is structured #

When #

slattach --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: ssl_client –help is structured #

When #

ssl_client --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: ssl_server –help is structured #

When #

ssl_server --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: tc –help is structured #

When #

tc --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: tcpsvd –help is structured #

When #

tcpsvd --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: telnet –help is structured #

When #

telnet --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: telnetd –help is structured #

When #

telnetd --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: tftp –help is structured #

When #

tftp --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: tftpd –help is structured #

When #

tftpd --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: traceroute –help is structured #

When #

traceroute --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: traceroute6 –help is structured #

When #

traceroute6 --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: tunctl –help is structured #

When #

tunctl --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: udhcpc –help is structured #

When #

udhcpc --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: udhcpc6 –help is structured #

When #

udhcpc6 --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: udhcpd –help is structured #

When #

udhcpd --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: udpsvd –help is structured #

When #

udpsvd --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: vconfig –help is structured #

When #

vconfig --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: whois –help is structured #

When #

whois --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: zcip –help is structured #

When #

zcip --help

Then #

  • exit code is 0
  • stdout contains Usage:

mimixbox http-status-code #

Source: test/e2e/tools/mimixbox/netutils/http-status-code.atago.yaml

Scenario: describes itself with –help #

When #

http-status-code --help

Then #

  • exit code is 0
  • stdout contains Usage: http-status-code
  • stderr is empty

Scenario: looks up a status code by number #

When #

http-status-code search 404

Then #

  • exit code is 0
  • stdout contains 404 Not Found

mimixbox httpd #

Source: test/e2e/tools/mimixbox/netutils/httpd.atago.yaml

Scenario: describes itself with –help #

When #

httpd --help

Then #

  • exit code is 0
  • stdout contains Usage: httpd
  • stderr is empty

mimixbox http-status-code #

Source: test/e2e/tools/mimixbox/netutils/httpstatus.atago.yaml

Scenario: explains a status code #

When #

http-status-code search 404

Then #

  • exit code is 0
  • stdout contains 404 Not Found

mimixbox ifconfig #

Source: test/e2e/tools/mimixbox/netutils/ifconfig.atago.yaml

Scenario: describes itself with –help #

When #

ifconfig --help

Then #

  • exit code is 0
  • stdout contains Usage: ifconfig
  • stderr is empty

Scenario: documents its purpose in –help #

When #

ifconfig --help

Then #

  • exit code is 0
  • stdout contains network interfaces

mimixbox ifdown #

Source: test/e2e/tools/mimixbox/netutils/ifdown.atago.yaml

Scenario: describes itself with –help #

When #

ifdown --help

Then #

  • exit code is 0
  • stdout contains Usage: ifdown
  • stderr is empty

mimixbox ifenslave #

Source: test/e2e/tools/mimixbox/netutils/ifenslave.atago.yaml

Scenario: describes itself with –help #

When #

ifenslave --help

Then #

  • exit code is 0
  • stdout contains Usage: ifenslave
  • stderr is empty

mimixbox ifplugd #

Source: test/e2e/tools/mimixbox/netutils/ifplugd.atago.yaml

Scenario: describes itself with –help #

When #

ifplugd --help

Then #

  • exit code is 0
  • stdout contains Usage: ifplugd
  • stderr is empty

mimixbox inetd #

Source: test/e2e/tools/mimixbox/netutils/inetd.atago.yaml

Scenario: describes itself with –help #

When #

inetd --help

Then #

  • exit code is 0
  • stdout contains Usage: inetd
  • stderr is empty

mimixbox ipcalc #

Source: test/e2e/tools/mimixbox/netutils/ipcalc.atago.yaml

Scenario: describes itself with –help #

When #

ipcalc --help

Then #

  • exit code is 0
  • stdout contains Usage: ipcalc
  • stderr is empty

Scenario: documents its purpose in –help #

When #

ipcalc --help

Then #

  • exit code is 0
  • stdout contains IPv4 network parameters

mimixbox nc loopback #

Source: test/e2e/tools/mimixbox/netutils/nc.atago.yaml

Scenario: transfers data over TCP #

When #

recv="${workdir}/nc_recv.txt"
: > "$recv"
for attempt in $(seq 1 8); do
    port=$((18640 + attempt))
    (nc -l -p "$port" > "$recv") &
    lpid=$!
    for _ in $(seq 1 20); do
        echo "from-client" | nc 127.0.0.1 "$port" >/dev/null 2>&1
        if [ -s "$recv" ]; then
            break
        fi
        sleep 0.1
    done
    kill "$lpid" 2>/dev/null
    wait "$lpid" 2>/dev/null
    if [ -s "$recv" ]; then
        break
    fi
done
head -n 1 "$recv"

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox netcat #

Source: test/e2e/tools/mimixbox/netutils/netcat.atago.yaml

Scenario: describes itself with –help #

When #

netcat --help

Then #

  • exit code is 0
  • stdout contains Usage: netcat
  • stderr is empty

mimixbox netstat #

Source: test/e2e/tools/mimixbox/netutils/netstat.atago.yaml

Scenario: describes itself with –help #

When #

netstat --help

Then #

  • exit code is 0
  • stdout contains Usage: netstat
  • stderr is empty

mimixbox nslookup #

Source: test/e2e/tools/mimixbox/netutils/nslookup.atago.yaml

Scenario: describes itself with –help #

When #

nslookup --help

Then #

  • exit code is 0
  • stdout contains Usage: nslookup
  • stderr is empty

mimixbox ntpd #

Source: test/e2e/tools/mimixbox/netutils/ntpd.atago.yaml

Scenario: describes itself with –help #

When #

ntpd --help

Then #

  • exit code is 0
  • stdout contains Usage: ntpd
  • stderr is empty

mimixbox ping usage #

Source: test/e2e/tools/mimixbox/netutils/ping.atago.yaml

Scenario: reports an error when no host is given #

When #

ping

Then #

  • exit code is not 0

mimixbox pscan #

Source: test/e2e/tools/mimixbox/netutils/pscan.atago.yaml

Scenario: describes itself with –help #

When #

pscan --help

Then #

  • exit code is 0
  • stdout contains Usage: pscan
  • stderr is empty

mimixbox route #

Source: test/e2e/tools/mimixbox/netutils/route.atago.yaml

Scenario: describes itself with –help #

When #

route --help

Then #

  • exit code is 0
  • stdout contains Usage: route
  • stderr is empty

mimixbox slattach #

Source: test/e2e/tools/mimixbox/netutils/slattach.atago.yaml

Scenario: describes itself with –help #

When #

slattach --help

Then #

  • exit code is 0
  • stdout contains Usage: slattach
  • stderr is empty

mimixbox ssl_client #

Source: test/e2e/tools/mimixbox/netutils/ssl_client.atago.yaml

Scenario: describes itself with –help #

When #

ssl_client --help

Then #

  • exit code is 0
  • stdout contains Usage: ssl_client
  • stderr is empty

mimixbox ssl_server #

Source: test/e2e/tools/mimixbox/netutils/ssl_server.atago.yaml

Scenario: describes itself with –help #

When #

ssl_server --help

Then #

  • exit code is 0
  • stdout contains Usage: ssl_server
  • stderr is empty

mimixbox tc #

Source: test/e2e/tools/mimixbox/netutils/tc.atago.yaml

Scenario: describes itself with –help #

When #

tc --help

Then #

  • exit code is 0
  • stdout contains Usage: tc
  • stderr is empty

mimixbox tcpsvd #

Source: test/e2e/tools/mimixbox/netutils/tcpsvd.atago.yaml

Scenario: describes itself with –help #

When #

tcpsvd --help

Then #

  • exit code is 0
  • stdout contains Usage: tcpsvd
  • stderr is empty

mimixbox telnet #

Source: test/e2e/tools/mimixbox/netutils/telnet.atago.yaml

Scenario: describes itself with –help #

When #

telnet --help

Then #

  • exit code is 0
  • stdout contains Usage: telnet
  • stderr is empty

mimixbox telnetd #

Source: test/e2e/tools/mimixbox/netutils/telnetd.atago.yaml

Scenario: describes itself with –help #

When #

telnetd --help

Then #

  • exit code is 0
  • stdout contains Usage: telnetd
  • stderr is empty

mimixbox tftp #

Source: test/e2e/tools/mimixbox/netutils/tftp.atago.yaml

Scenario: describes itself with –help #

When #

tftp --help

Then #

  • exit code is 0
  • stdout contains Usage: tftp
  • stderr is empty

mimixbox tftpd #

Source: test/e2e/tools/mimixbox/netutils/tftpd.atago.yaml

Scenario: describes itself with –help #

When #

tftpd --help

Then #

  • exit code is 0
  • stdout contains Usage: tftpd
  • stderr is empty

mimixbox traceroute #

Source: test/e2e/tools/mimixbox/netutils/traceroute.atago.yaml

Scenario: describes itself with –help #

When #

traceroute --help

Then #

  • exit code is 0
  • stdout contains Usage: traceroute
  • stderr is empty

mimixbox traceroute6 #

Source: test/e2e/tools/mimixbox/netutils/traceroute6.atago.yaml

Scenario: describes itself with –help #

When #

traceroute6 --help

Then #

  • exit code is 0
  • stdout contains Usage: traceroute6
  • stderr is empty

mimixbox tunctl #

Source: test/e2e/tools/mimixbox/netutils/tunctl.atago.yaml

Scenario: describes itself with –help #

When #

tunctl --help

Then #

  • exit code is 0
  • stdout contains Usage: tunctl
  • stderr is empty

mimixbox udhcpc #

Source: test/e2e/tools/mimixbox/netutils/udhcpc.atago.yaml

Scenario: describes itself with –help #

When #

udhcpc --help

Then #

  • exit code is 0
  • stdout contains Usage: udhcpc
  • stderr is empty

mimixbox udhcpc6 #

Source: test/e2e/tools/mimixbox/netutils/udhcpc6.atago.yaml

Scenario: describes itself with –help #

When #

udhcpc6 --help

Then #

  • exit code is 0
  • stdout contains Usage: udhcpc6
  • stderr is empty

mimixbox udhcpd #

Source: test/e2e/tools/mimixbox/netutils/udhcpd.atago.yaml

Scenario: describes itself with –help #

When #

udhcpd --help

Then #

  • exit code is 0
  • stdout contains Usage: udhcpd
  • stderr is empty

mimixbox udpsvd #

Source: test/e2e/tools/mimixbox/netutils/udpsvd.atago.yaml

Scenario: describes itself with –help #

When #

udpsvd --help

Then #

  • exit code is 0
  • stdout contains Usage: udpsvd
  • stderr is empty

mimixbox vconfig #

Source: test/e2e/tools/mimixbox/netutils/vconfig.atago.yaml

Scenario: describes itself with –help #

When #

vconfig --help

Then #

  • exit code is 0
  • stdout contains Usage: vconfig
  • stderr is empty

mimixbox whois #

Source: test/e2e/tools/mimixbox/netutils/whois.atago.yaml

Scenario: describes itself with –help #

When #

whois --help

Then #

  • exit code is 0
  • stdout contains Usage: whois
  • stderr is empty

mimixbox whris usage #

Source: test/e2e/tools/mimixbox/netutils/whris.atago.yaml

Scenario: reports an error when no domain is given #

When #

whris

Then #

  • exit code is not 0

mimixbox zcip #

Source: test/e2e/tools/mimixbox/netutils/zcip.atago.yaml

Scenario: describes itself with –help #

When #

zcip --help

Then #

  • exit code is 0
  • stdout contains Usage: zcip
  • stderr is empty

mimixbox halt #

Source: test/e2e/tools/mimixbox/pmutils/halt.atago.yaml

Scenario: halt –help prints usage and lists the options #

When #

halt --help

Then #

  • exit code is 0
  • stdout contains Usage: halt, --poweroff, --wtmp-only

Scenario: poweroff –help prints usage #

When #

poweroff --help

Then #

  • exit code is 0
  • stdout contains Usage: poweroff

Scenario: reboot –help prints usage #

When #

reboot --help

Then #

  • exit code is 0
  • stdout contains Usage: reboot

Scenario: halt –version prints the version #

When #

halt --version

Then #

  • exit code is 0
  • stdout contains halt (mimixbox)

mimixbox pmutils –help contract #

Source: test/e2e/tools/mimixbox/pmutils/help_helpers.atago.yaml

Scenario: poweroff –help is structured #

When #

poweroff --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: reboot –help is structured #

When #

reboot --help

Then #

  • exit code is 0
  • stdout contains Usage:

mimixbox printutils commands expose a dedicated –help helper #

Source: test/e2e/tools/mimixbox/printutils/help_helpers_printutils.atago.yaml

Scenario: lpd –help is structured #

When #

lpd --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: lpq –help is structured #

When #

lpq --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: lpr –help is structured #

When #

lpr --help

Then #

  • exit code is 0
  • stdout contains Usage:

mimixbox depmod #

Source: test/e2e/tools/mimixbox/procps/depmod.atago.yaml

Scenario: describes itself with –help #

When #

depmod --help

Then #

  • exit code is 0
  • stdout contains Usage: depmod
  • stderr is empty

mimixbox fuser #

Source: test/e2e/tools/mimixbox/procps/fuser.atago.yaml

Scenario: finds processes using the current directory #

When #

fuser .

Then #

  • exit code is 0
  • stdout matches /[0-9]/

Scenario: exits non-zero when nothing uses the file #

When #

fuser /no/such/fuser/file

Then #

  • exit code is not 0

mimixbox procps –help contract #

Source: test/e2e/tools/mimixbox/procps/help_helpers_procps.atago.yaml

Scenario: depmod –help is structured #

When #

depmod --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: insmod –help is structured #

When #

insmod --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: lsmod –help is structured #

When #

lsmod --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: modinfo –help is structured #

When #

modinfo --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: modprobe –help is structured #

When #

modprobe --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: pkill –help is structured #

When #

pkill --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: pwdx –help is structured #

When #

pwdx --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: rmmod –help is structured #

When #

rmmod --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: uptime –help is structured #

When #

uptime --help

Then #

  • exit code is 0
  • stdout contains Usage:

mimixbox iostat #

Source: test/e2e/tools/mimixbox/procps/iostat.atago.yaml

Scenario: prints the avg-cpu header #

When #

iostat

Then #

  • exit code is 0
  • stdout contains avg-cpu, %idle

Scenario: prints the device table header #

When #

iostat

Then #

  • exit code is 0
  • stdout contains Device

mimixbox killall5 #

Source: test/e2e/tools/mimixbox/procps/killall5.atago.yaml

Scenario: describes itself with –help #

When #

killall5 --help

Then #

  • exit code is 0
  • stdout contains Usage: killall5, signal

mimixbox klogd #

Source: test/e2e/tools/mimixbox/procps/klogd.atago.yaml

Scenario: describes itself with –help #

When #

klogd --help

Then #

  • exit code is 0
  • stdout contains Usage: klogd, kernel

mimixbox logger #

Source: test/e2e/tools/mimixbox/procps/logger.atago.yaml

Scenario: rejects an unknown facility #

When #

logger -p nosuchfacility.info msg

Then #

  • exit code is not 0

mimixbox logread #

Source: test/e2e/tools/mimixbox/procps/logread.atago.yaml

Scenario: prints a given log file #

Given #

  • Fixture file sys.log is created.

Inputs #

Fixture sys.log:

msg one
msg two

When #

logread sys.log

Then #

  • exit code is 0
  • stdout equals an exact value
  • stdout equals an exact value

Scenario: fails when no readable log is found #

When #

logread nope.log

Then #

  • exit code is not 0

mimixbox lsmod #

Source: test/e2e/tools/mimixbox/procps/lsmod.atago.yaml

Scenario: describes itself with –help #

When #

lsmod --help

Then #

  • exit code is 0
  • stdout contains Usage: lsmod
  • stderr is empty

mimixbox lsof #

Source: test/e2e/tools/mimixbox/procps/lsof.atago.yaml

Scenario: lists the working directory of a process #

When #

lsof -p $$

Then #

  • exit code is 0
  • stdout contains cwd

Scenario: prints the column header #

When #

lsof -p $$

Then #

  • exit code is 0
  • stdout contains COMMAND
  • stdout contains NAME

mimixbox minips #

Source: test/e2e/tools/mimixbox/procps/minips.atago.yaml

Scenario: prints the PID/USER/COMMAND header #

When #

minips

Then #

  • exit code is 0
  • stdout contains COMMAND

Scenario: lists processes #

When #

minips

Then #

  • exit code is 0
  • stdout matches /(?m)^[0-9]+/

mimixbox modinfo #

Source: test/e2e/tools/mimixbox/procps/modinfo.atago.yaml

Scenario: describes itself with –help #

When #

modinfo --help

Then #

  • exit code is 0
  • stdout contains Usage: modinfo
  • stderr is empty

mimixbox mpstat #

Source: test/e2e/tools/mimixbox/procps/mpstat.atago.yaml

Scenario: prints the CPU column header #

When #

mpstat

Then #

  • exit code is 0
  • stdout contains %usr, %idle

Scenario: prints the aggregate all row #

When #

mpstat

Then #

  • exit code is 0
  • stdout matches /(?m)^all /

mimixbox nmeter #

Source: test/e2e/tools/mimixbox/procps/nmeter.atago.yaml

Scenario: expands a literal percent and copies text #

When #

nmeter "hello %% world"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: expands the total-memory directive #

When #

nmeter "mem:%M"

Then #

  • exit code is 0
  • stdout matches /mem:[0-9]+M/

mimixbox pgrep / pkill #

Source: test/e2e/tools/mimixbox/procps/pgrep.atago.yaml

Scenario: finds a running process by name #

When #

sleep 30 & p=$!; pgrep sleep | grep -c "^${p}$"; kill $p 2>/dev/null

Then #

  • exit code is 0
  • stdout contains 1

Scenario: exits non-zero when nothing matches #

When #

pgrep zzz_no_such_proc_zzz

Then #

  • exit code is not 0

mimixbox pmap #

Source: test/e2e/tools/mimixbox/procps/pmap.atago.yaml

Scenario: prints a total line for a process map #

When #

pmap $$

Then #

  • exit code is 0
  • stdout contains total

Scenario: rejects an invalid PID #

When #

pmap notapid

Then #

  • exit code is not 0

mimixbox powertop #

Source: test/e2e/tools/mimixbox/procps/powertop.atago.yaml

Scenario: runs and exits zero #

When #

powertop

Then #

  • exit code is 0

Scenario: describes itself with –help #

When #

powertop --help

Then #

  • exit code is 0
  • stdout contains Usage: powertop, power

mimixbox ps #

Source: test/e2e/tools/mimixbox/procps/ps.atago.yaml

Scenario: prints the standard header #

When #

ps

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: lists running processes #

When #

ps

Then #

  • exit code is 0
  • stdout matches /(?m)^ *[0-9]+ /

mimixbox pstree #

Source: test/e2e/tools/mimixbox/procps/pstree.atago.yaml

Scenario: builds a tree containing PID 1 #

When #

pstree

Then #

  • exit code is 0
  • stdout contains (1)

mimixbox pwdx #

Source: test/e2e/tools/mimixbox/procps/pwdx.atago.yaml

Scenario: describes itself with –help #

When #

pwdx --help

Then #

  • exit code is 0
  • stdout contains Usage: pwdx
  • stderr is empty

mimixbox rmmod #

Source: test/e2e/tools/mimixbox/procps/rmmod.atago.yaml

Scenario: describes itself with –help #

When #

rmmod --help

Then #

  • exit code is 0
  • stdout contains Usage: rmmod
  • stderr is empty

mimixbox smemcap #

Source: test/e2e/tools/mimixbox/procps/smemcap.atago.yaml

Scenario: captures a tar containing meminfo #

When #

smemcap > cap.tar; tar -tf cap.tar

Then #

  • exit code is 0
  • stdout matches /(?m)^meminfo$/

mimixbox sysctl #

Source: test/e2e/tools/mimixbox/procps/sysctl.atago.yaml

Scenario: reads a kernel parameter #

When #

sysctl kernel.ostype

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: lists parameters with -a #

When #

sysctl -a

Then #

  • exit code is 0
  • stdout contains =

mimixbox syslogd #

Source: test/e2e/tools/mimixbox/procps/syslogd.atago.yaml

Scenario: describes itself with –help #

When #

syslogd --help

Then #

  • exit code is 0
  • stdout contains Usage: syslogd, log

mimixbox top #

Source: test/e2e/tools/mimixbox/procps/top.atago.yaml

Scenario: prints the top summary line #

When #

top -bn1

Then #

  • exit code is 0
  • stdout matches /^top -/

Scenario: prints the tasks line #

When #

top -bn1

Then #

  • exit code is 0
  • stdout matches /(?m)^Tasks:/

mimixbox uptime #

Source: test/e2e/tools/mimixbox/procps/uptime.atago.yaml

Scenario: describes itself with –help #

When #

uptime --help

Then #

  • exit code is 0
  • stdout contains Usage: uptime
  • stderr is empty

Scenario: prints an uptime/load line #

When #

uptime

Then #

  • exit code is 0
  • stdout contains load average:

mimixbox uptime / pwdx #

Source: test/e2e/tools/mimixbox/procps/uptime_pwdx.atago.yaml

Scenario: uptime shows the load averages #

When #

uptime

Then #

  • exit code is 0
  • stdout contains load average

Scenario: pwdx prints a process working directory #

When #

pwdx $$

Then #

  • exit code is 0
  • stdout matches /^[0-9]+: //

mimixbox vmstat #

Source: test/e2e/tools/mimixbox/procps/vmstat.atago.yaml

Scenario: prints the column header #

When #

vmstat

Then #

  • exit code is 0
  • stdout contains swpd, free

Scenario: prints a numeric data row #

When #

vmstat

Then #

  • exit code is 0
  • stdout matches /^[ 0-9]+$/

mimixbox chpst #

Source: test/e2e/tools/mimixbox/runit/chpst.atago.yaml

Scenario: loads an environment directory #

Given #

  • Fixture file env/HELLO is created.

Inputs #

Fixture env/HELLO:

world

When #

chpst -e env sh -c 'echo "$HELLO"'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: requires a program #

When #

chpst -o 64

Then #

  • exit code is not 0

mimixbox envdir #

Source: test/e2e/tools/mimixbox/runit/envdir.atago.yaml

Scenario: sets a variable from a directory file #

Given #

  • Fixture file env/GREETING is created.

Inputs #

Fixture env/GREETING:

hello

When #

envdir env sh -c 'echo "$GREETING"'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: requires a directory and a program #

When #

envdir /only

Then #

  • exit code is not 0

mimixbox envuidgid #

Source: test/e2e/tools/mimixbox/runit/envuidgid.atago.yaml

Scenario: exports root uid and gid #

When #

envuidgid root sh -c 'echo "$UID:$GID"'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: fails for an unknown user #

When #

envuidgid nonexistent_xyz true

Then #

  • exit code is not 0

mimixbox runsv #

Source: test/e2e/tools/mimixbox/runit/runsv.atago.yaml

Scenario: requires a service directory #

When #

runsv

Then #

  • exit code is not 0

Scenario: describes itself with –help #

When #

runsv --help

Then #

  • exit code is 0
  • stdout contains Usage: runsv, service

mimixbox runsvdir #

Source: test/e2e/tools/mimixbox/runit/runsvdir.atago.yaml

Scenario: requires a services directory #

When #

runsvdir

Then #

  • exit code is not 0

Scenario: describes itself with –help #

When #

runsvdir --help

Then #

  • exit code is 0
  • stdout contains Usage: runsvdir, service

mimixbox setuidgid #

Source: test/e2e/tools/mimixbox/runit/setuidgid.atago.yaml

Scenario: fails for an unknown user #

When #

setuidgid nonexistent_user_xyz true

Then #

  • exit code is not 0

Scenario: requires a program #

When #

setuidgid root

Then #

  • exit code is not 0

mimixbox softlimit #

Source: test/e2e/tools/mimixbox/runit/softlimit.atago.yaml

Scenario: runs a program under the limits #

When #

softlimit -o 64 true

Then #

  • exit code is 0

Scenario: requires a program #

When #

softlimit -o 64

Then #

  • exit code is not 0

mimixbox sv #

Source: test/e2e/tools/mimixbox/runit/sv.atago.yaml

Scenario: writes the up control character #

Given #

  • Fixture file svc/supervise/control is created.
  • Fixture file svc/supervise/ok is created.

When #

sv up svc && cat svc/supervise/control

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: reports a running service #

Given #

  • Fixture file svc2/supervise/ok is created.
  • Fixture file svc2/supervise/pid is created.

Inputs #

Fixture svc2/supervise/pid:

99

When #

sv status svc2

Then #

  • exit code is 0
  • stdout contains run

mimixbox svc #

Source: test/e2e/tools/mimixbox/runit/svc.atago.yaml

Scenario: writes the down control character #

Given #

  • Fixture file svc/supervise/control is created.

When #

svc -d svc && cat svc/supervise/control

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: requires a control command #

Given #

  • Fixture file s2/supervise/control is created.

When #

svc s2

Then #

  • exit code is not 0

mimixbox svlogd #

Source: test/e2e/tools/mimixbox/runit/svlogd.atago.yaml

Scenario: appends stdin to the current log #

When #

printf 'hello\nworld\n' | svlogd log
cat log/current

Then #

  • exit code is 0
  • stdout equals an exact value
  • stdout equals an exact value

Scenario: requires a directory #

Inputs #

stdin for svlogd:

x

When #

svlogd

Then #

  • exit code is not 0

mimixbox svok #

Source: test/e2e/tools/mimixbox/runit/svok.atago.yaml

Scenario: succeeds for a supervised service #

Given #

  • Fixture file svc/supervise/ok is created.

When #

svok svc

Then #

  • exit code is 0

Scenario: returns 100 for an unsupervised service #

Given #

  • Fixture file down/.keep is created.

When #

svok down

Then #

  • exit code is 100

mimixbox chcon #

Source: test/e2e/tools/mimixbox/securityutils/chcon.atago.yaml

Scenario: describes itself with –help #

When #

chcon --help

Then #

  • exit code is 0
  • stdout contains Usage: chcon
  • stderr is empty

mimixbox getenforce #

Source: test/e2e/tools/mimixbox/securityutils/getenforce.atago.yaml

Scenario: describes itself with –help #

When #

getenforce --help

Then #

  • exit code is 0
  • stdout contains Usage: getenforce
  • stderr is empty

mimixbox getsebool #

Source: test/e2e/tools/mimixbox/securityutils/getsebool.atago.yaml

Scenario: describes itself with –help #

When #

getsebool --help

Then #

  • exit code is 0
  • stdout contains Usage: getsebool
  • stderr is empty

mimixbox securityutils –help contract #

Source: test/e2e/tools/mimixbox/securityutils/help_helpers.atago.yaml

Scenario: chcon –help is structured #

When #

chcon --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: getenforce –help is structured #

When #

getenforce --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: getsebool –help is structured #

When #

getsebool --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: load_policy –help is structured #

When #

load_policy --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: matchpathcon –help is structured #

When #

matchpathcon --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: restorecon –help is structured #

When #

restorecon --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: runcon –help is structured #

When #

runcon --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: selinuxenabled –help is structured #

When #

selinuxenabled --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: sestatus –help is structured #

When #

sestatus --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: setenforce –help is structured #

When #

setenforce --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: setfiles –help is structured #

When #

setfiles --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: setsebool –help is structured #

When #

setsebool --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: zip-pwcrack –help is structured #

When #

zip-pwcrack --help

Then #

  • exit code is 0
  • stdout contains Usage:

mimixbox pwcrack #

Source: test/e2e/tools/mimixbox/securityutils/pwcrack.atago.yaml

Scenario: finds a weak password in the wordlist #

Given #

  • Fixture file words.txt is created.

Inputs #

Fixture words.txt:

alpha
secret
beta

When #

pwcrack -w words.txt $6$abcdefgh$ltjgWl6579NluT/Vi1nwEvcil.G5Nbc4NiXZaNGStk8PSwGfQv72N2CKPPrVACtLtip/cZ/1GM/O6IND4WQhG.

Then #

  • exit code is 0
  • stdout contains : secret

mimixbox pwgen #

Source: test/e2e/tools/mimixbox/securityutils/pwgen.atago.yaml

Scenario: generates the requested number of passwords #

When #

pwgen -n 3 -l 8 | wc -l | tr -d ' '

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox pwscore #

Source: test/e2e/tools/mimixbox/securityutils/pwscore.atago.yaml

Scenario: scores a common password as zero #

When #

pwscore password | head -n 1

Then #

  • exit code is 0
  • stdout contains Score: 0/100

mimixbox runcon #

Source: test/e2e/tools/mimixbox/securityutils/runcon.atago.yaml

Scenario: describes itself with –help #

When #

runcon --help

Then #

  • exit code is 0
  • stdout contains Usage: runcon
  • stderr is empty

mimixbox selinuxenabled #

Source: test/e2e/tools/mimixbox/securityutils/selinuxenabled.atago.yaml

Scenario: describes itself with –help #

When #

selinuxenabled --help

Then #

  • exit code is 0
  • stdout contains Usage: selinuxenabled
  • stderr is empty

mimixbox sestatus #

Source: test/e2e/tools/mimixbox/securityutils/sestatus.atago.yaml

Scenario: describes itself with –help #

When #

sestatus --help

Then #

  • exit code is 0
  • stdout contains Usage: sestatus
  • stderr is empty

mimixbox setenforce #

Source: test/e2e/tools/mimixbox/securityutils/setenforce.atago.yaml

Scenario: describes itself with –help #

When #

setenforce --help

Then #

  • exit code is 0
  • stdout contains Usage: setenforce
  • stderr is empty

mimixbox setfiles #

Source: test/e2e/tools/mimixbox/securityutils/setfiles.atago.yaml

Scenario: describes itself with –help #

When #

setfiles --help

Then #

  • exit code is 0
  • stdout contains Usage: setfiles
  • stderr is empty

mimixbox setsebool #

Source: test/e2e/tools/mimixbox/securityutils/setsebool.atago.yaml

Scenario: describes itself with –help #

When #

setsebool --help

Then #

  • exit code is 0
  • stdout contains Usage: setsebool
  • stderr is empty

mimixbox unshadow #

Source: test/e2e/tools/mimixbox/securityutils/unshadow.atago.yaml

Scenario: merges the shadow hash into the passwd line #

Given #

  • Fixture file passwd is created.
  • Fixture file shadow is created.

Inputs #

Fixture passwd:

alice:x:1000:1000:Alice:/home/alice:/bin/sh

Fixture shadow:

alice:$6$abc$HASH:19000:0:99999:7:::

When #

unshadow passwd shadow

Then #

  • exit code is 0
  • stdout contains alice:$6$abc$HASH:1000:1000

mimixbox zip-pwcrack #

Source: test/e2e/tools/mimixbox/securityutils/zip-pwcrack.atago.yaml

Scenario: describes itself with –help #

When #

zip-pwcrack --help

Then #

  • exit code is 0
  • stdout contains Usage: zip-pwcrack
  • stderr is empty

mimixbox zip-pwcrack #

Source: test/e2e/tools/mimixbox/securityutils/zippwcrack.atago.yaml

Scenario: recovers the ZIP password from the wordlist #

Given #

  • Fixture file words.txt is created.
  • Fixture file enc.zip is created.

Inputs #

Fixture words.txt:

alpha
hunter2
beta

When #

zip-pwcrack enc.zip -w words.txt

Then #

  • exit code is 0
  • stdout contains password found: hunter2

mimixbox arch #

Source: test/e2e/tools/mimixbox/shellutils/arch.atago.yaml

Scenario: prints a non-empty machine name #

When #

arch

Then #

  • exit code is 0
  • stdout is not empty

mimixbox base64 #

Source: test/e2e/tools/mimixbox/shellutils/base64.atago.yaml

Scenario: encodes standard input #

When #

printf 'hello\n' | base64

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: encodes the file contents #

Given #

  • Fixture file base64.txt is created.

Inputs #

Fixture base64.txt:

hello

When #

base64 base64.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: decodes standard input #

When #

printf 'aGVsbG8K\n' | base64 -d

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: returns the original text (round trip) #

When #

printf 'MimixBox\n' | base64 | base64 -d

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: reports an error for a non-existent file #

When #

base64 /no_exist_file

Then #

  • exit code is not 0
  • stderr equals an exact value

mimixbox basename #

Source: test/e2e/tools/mimixbox/shellutils/basename.atago.yaml

Scenario: show test.txt #

When #

basename "/home/nao/test.txt"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: show test #

When #

basename "/home/nao/test"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: show .test #

When #

basename "/home/nao/.test"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: show nao for a trailing slash #

When #

basename "/home/nao/"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: show error without operand #

When #

basename

Then #

  • exit code is not 0
  • stderr equals an exact value

Scenario: show / for root #

When #

basename "/"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: show empty string #

When #

basename ""

Then #

  • exit code is 0
  • stdout is empty

Scenario: show error for extra operand #

When #

basename /bin/basename /home/nao /home

Then #

  • exit code is not 0
  • stderr equals an exact value

Scenario: show three basenames with -a #

When #

basename -a /bin/basename /home/nao /home

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

basename
nao
home

Scenario: show three basenames joined with -a -z #

When #

basename -a -z /bin/basename /home/nao /home

Then #

  • exit code is 0
  • stdout matches /^basename\x00nao\x00home\x00$/

Scenario: show basename without the suffix #

When #

basename -s .txt /home/nao/test.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: show basename built from an environment variable #

When #

TEST_DIR="/aaa/bbb/ccc"; basename "$TEST_DIR/ddd.txt"

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox bc #

Source: test/e2e/tools/mimixbox/shellutils/bc.atago.yaml

Scenario: respects operator precedence #

When #

echo '2 + 3 * 4' | bc

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: honors scale for division #

When #

echo 'scale=2; 7/3' | bc

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: supports variables #

When #

printf 'x = 5\nx * x\n' | bc

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: computes powers #

When #

echo '2^10' | bc

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox cal #

Source: test/e2e/tools/mimixbox/shellutils/cal.atago.yaml

Scenario: prints the month calendar #

When #

cal 11 2023

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

   November 2023
Su Mo Tu We Th Fr Sa
          1  2  3  4
 5  6  7  8  9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30

mimixbox chmod #

Source: test/e2e/tools/mimixbox/shellutils/chmod.atago.yaml

Scenario: sets the permission bits with an octal mode #

When #

mkdir -p chmod && touch chmod/file.txt && chmod 600 chmod/file.txt && chmod 644 chmod/file.txt && stat -c '%a' chmod/file.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: adds owner execute to mode 600 with a symbolic mode #

When #

mkdir -p chmod && touch chmod/file.txt && chmod 600 chmod/file.txt && chmod u+x chmod/file.txt && stat -c '%a' chmod/file.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: reports an error on a missing file #

When #

chmod 644 /no_such_file

Then #

  • exit code is not 0
  • stderr equals an exact value

Expected output #

expected stderr:

chmod: cannot access '/no_such_file': no such file or directory

mimixbox chroot #

Source: test/e2e/tools/mimixbox/shellutils/chroot.atago.yaml

Scenario: prints usage with –help and exits 0 #

When #

chroot --help

Then #

  • exit code is 0
  • stdout contains Usage: chroot

Scenario: documents the –userspec identity option in –help #

When #

chroot --help

Then #

  • exit code is 0
  • stdout contains --userspec

Scenario: fails with a message when given no operand #

When #

chroot

Then #

  • exit code is not 0
  • stderr contains chroot

mimixbox cmp #

Source: test/e2e/tools/mimixbox/shellutils/cmp.atago.yaml

Scenario: prints nothing and succeeds on identical files #

Given #

  • Fixture file cmp/a.txt is created.
  • Fixture file cmp/same.txt is created.

Inputs #

Fixture cmp/a.txt:

abc

Fixture cmp/same.txt:

abc

When #

cmp cmp/a.txt cmp/same.txt; echo "rc=$?"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: reports the first differing byte and line on differing files #

Given #

  • Fixture file cmp/a.txt is created.
  • Fixture file cmp/diff.txt is created.

Inputs #

Fixture cmp/a.txt:

abc

Fixture cmp/diff.txt:

abd

When #

cmp ${workdir}/cmp/a.txt ${workdir}/cmp/diff.txt

Then #

  • exit code is not 0
  • stdout equals an exact value

Expected output #

expected stdout:

${workdir}/cmp/a.txt ${workdir}/cmp/diff.txt differ: byte 3, line 1

Scenario: cmp -s prints nothing but exits non-zero #

Given #

  • Fixture file cmp/a.txt is created.
  • Fixture file cmp/diff.txt is created.

Inputs #

Fixture cmp/a.txt:

abc

Fixture cmp/diff.txt:

abd

When #

cmp -s cmp/a.txt cmp/diff.txt; echo "rc=$?"

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox cmp (GNU options) #

Source: test/e2e/tools/mimixbox/shellutils/cmp_gnu.atago.yaml

Scenario: -n reports equality when the difference is past the byte limit #

Given #

  • Fixture file cmp_gnu/a.txt is created.
  • Fixture file cmp_gnu/b.txt is created.

Inputs #

Fixture cmp_gnu/a.txt:

abcXdef

Fixture cmp_gnu/b.txt:

abcYdef

When #

cmp -n 3 cmp_gnu/a.txt cmp_gnu/b.txt; echo "rc=$?"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: –bytes reports the difference within the byte limit #

Given #

  • Fixture file cmp_gnu/a.txt is created.
  • Fixture file cmp_gnu/b.txt is created.

Inputs #

Fixture cmp_gnu/a.txt:

abcXdef

Fixture cmp_gnu/b.txt:

abcYdef

When #

cmp --bytes=4 ${workdir}/cmp_gnu/a.txt ${workdir}/cmp_gnu/b.txt

Then #

  • exit code is not 0
  • stdout contains differ: byte 4, line 1

Scenario: -i skips the first N bytes of both files #

Given #

  • Fixture file cmp_gnu/skip_a.txt is created.
  • Fixture file cmp_gnu/skip_b.txt is created.

Inputs #

Fixture cmp_gnu/skip_a.txt:

XXXcommon

Fixture cmp_gnu/skip_b.txt:

YYYcommon

When #

cmp -i 3 cmp_gnu/skip_a.txt cmp_gnu/skip_b.txt; echo "rc=$?"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: -i N:M skips N bytes of file1 and M of file2 #

Given #

  • Fixture file cmp_gnu/pair_a.txt is created.
  • Fixture file cmp_gnu/pair_b.txt is created.

Inputs #

Fixture cmp_gnu/pair_a.txt:

_abZ

Fixture cmp_gnu/pair_b.txt:

___abQ

When #

cmp -i 1:3 ${workdir}/cmp_gnu/pair_a.txt ${workdir}/cmp_gnu/pair_b.txt

Then #

  • exit code is not 0
  • stdout contains differ: byte 3, line 1

Scenario: -b prints the differing byte values in the message #

Given #

  • Fixture file cmp_gnu/pb_a.txt is created.
  • Fixture file cmp_gnu/pb_b.txt is created.

Inputs #

Fixture cmp_gnu/pb_a.txt:

first
second

Fixture cmp_gnu/pb_b.txt:

first
SECOND

When #

cmp -b ${workdir}/cmp_gnu/pb_a.txt ${workdir}/cmp_gnu/pb_b.txt

Then #

  • exit code is not 0
  • stdout contains differ: byte 7, line 2 is 163 s 123 S

mimixbox cp (permission preservation) #

Source: test/e2e/tools/mimixbox/shellutils/cp_perm.atago.yaml

Scenario: keeps the source file mode (execute bit) #

When #

printf '#!/bin/sh\necho hi\n' > script.sh && chmod 755 script.sh && cp script.sh copy.sh && stat -c '%a' copy.sh

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: keeps a private directory mode #

When #

mkdir -m 700 private && cp -r private private_copy && stat -c '%a' private_copy

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: overwrites a read-only destination with -f #

When #

printf 'old\n' > dst.txt && chmod 444 dst.txt && printf 'new\n' > src.txt && cp -f src.txt dst.txt && cat dst.txt

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox cut #

Source: test/e2e/tools/mimixbox/shellutils/cut.atago.yaml

Scenario: prints the chosen field #

When #

printf 'a,b,c\n' | cut -f 2 -d ,

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: prints the chosen fields joined by the delimiter #

When #

printf 'a,b,c,d\n' | cut -f 1,3 -d ,

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: prints from the field to the end #

When #

printf 'a,b,c,d\n' | cut -f 2- -d ,

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: prints the chosen character range #

When #

printf 'abcdef\n' | cut -c 1-3

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: reports an error without a list #

When #

printf 'a,b\n' | cut -d ,

Then #

  • exit code is not 0
  • stderr equals an exact value

mimixbox cut (GNU options) #

Source: test/e2e/tools/mimixbox/shellutils/cut_gnu.atago.yaml

Scenario: –complement keeps the fields not selected #

When #

printf 'a,b,c\n' | cut -f 2 -d , --complement

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: –complement keeps the bytes not selected #

When #

printf 'abcde\n' | cut -b 2-3 --complement

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: -z splits and joins records on NUL (fields) #

When #

printf 'a,b,c\000d,e,f\000' | cut -f 2 -d , -z | tr '\000' '|'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: -z cuts bytes from each NUL-delimited record #

When #

printf 'abc\000def\000' | cut -b 1-2 -z | tr '\000' '|'

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox date #

Source: test/e2e/tools/mimixbox/shellutils/date.atago.yaml

Scenario: formats the date portion of an epoch #

When #

date -u -d @0 +%F

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: formats the time portion of an epoch #

When #

date -u -d @0 +%T

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: prints a literal percent sign #

When #

date +%%

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: prints a four-digit year #

When #

date +%Y | grep -E '^[0-9]{4}$' > /dev/null && echo "ok"

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox dc #

Source: test/e2e/tools/mimixbox/shellutils/dc.atago.yaml

Scenario: performs integer division #

When #

echo '6 3 / p' | dc

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: honors the precision register #

When #

echo '2k 7 3 / p' | dc

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: evaluates -e expressions #

When #

dc -e '2 10 ^ p'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: stores and loads registers #

When #

echo '5 sa 3 la + p' | dc

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox dd #

Source: test/e2e/tools/mimixbox/shellutils/dd.atago.yaml

Scenario: reproduces the input (stdin to stdout) #

When #

printf 'hello world' | dd status=none

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: copies only the requested blocks with count #

When #

printf 'hello world' | dd bs=1 count=5 status=none

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: conv=ucase upper-cases the data #

When #

printf 'abc' | dd conv=ucase status=none

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox df #

Source: test/e2e/tools/mimixbox/shellutils/df.atago.yaml

Scenario: shows the column header #

When #

df . | head -n 1

Then #

  • exit code is 0
  • stdout contains Filesystem

Scenario: exits zero for the current directory #

When #

df . > /dev/null; echo "rc=$?"

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox df GNU flags #

Source: test/e2e/tools/mimixbox/shellutils/df_gnu.atago.yaml

Scenario: –output prints the selected column headers in order #

When #

df --output=source,fstype,size,used,avail,pcent,target

Then #

  • exit code is 0
  • stdout contains Filesystem
  • stdout contains Type
  • stdout contains Size
  • stdout contains Used
  • stdout contains Avail
  • stdout contains Use%
  • stdout contains Mounted on

Scenario: –output honors a reordered field list #

When #

df --output=target,source

Then #

  • exit code is 0
  • stdout matches /Mounted on.*Filesystem.*/

Scenario: –output rejects an unknown field #

When #

df --output=bogus

Then #

  • exit code is not 0
  • stderr contains bogus

Scenario: –total emits a row labeled total #

When #

df --total --output=source,size,used,avail,target

Then #

  • exit code is 0
  • stdout contains total

Scenario: –total works with the classic layout too #

When #

df --total

Then #

  • exit code is 0
  • stdout contains total

Scenario: –type accepts a type filter and exits cleanly #

When #

df --type=tmpfs --output=fstype,target

Then #

  • exit code is 0
  • stdout contains Type

Scenario: –type is repeatable #

When #

df -t tmpfs -t ext4 --output=fstype

Then #

  • exit code is 0
  • stdout contains Type

Scenario: –block-size labels the block-size in the classic header #

When #

df --block-size=1M

Then #

  • exit code is 0
  • stdout contains 1048576-blocks

Scenario: –block-size rejects an invalid size #

When #

df --block-size=1Z

Then #

  • exit code is not 0
  • stderr contains block-size

Scenario: –all lists at least as many rows with -a as without #

When #

test "$(df -a --output=target | wc -l)" -ge "$(df --output=target | wc -l)"

Then #

  • exit code is 0

mimixbox dirname #

Source: test/e2e/tools/mimixbox/shellutils/dirname.atago.yaml

Scenario: print /home/nao for an absolute file path #

When #

dirname "/home/nao/test.txt"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: print /home/nao for a filename without extension #

When #

dirname "/home/nao/test"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: print /home/nao for a hidden file #

When #

dirname "/home/nao/.test"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: print error without operand #

When #

dirname

Then #

  • exit code is not 0
  • stderr equals an exact value

Scenario: print / for the root directory #

When #

dirname "/"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: print . for an empty string #

When #

dirname ""

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: print /bin /home / with line feed for three arguments #

When #

dirname /bin/dirname /home/nao /home

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

/bin
/home
/

Scenario: print NUL-separated dirnames for three arguments with -z #

When #

dirname -z /bin/dirname /home/nao /home

Then #

  • exit code is 0
  • stdout matches /^/bin\x00/home\x00/\x00$/

Scenario: print /aaa/bbb/ccc built from an environment variable #

When #

TEST_DIR="/aaa/bbb/ccc"; dirname $TEST_DIR/ddd.txt

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox du #

Source: test/e2e/tools/mimixbox/shellutils/du.atago.yaml

Scenario: -b reports the total apparent byte size #

When #

mkdir -p du/sub && printf '%0.s.' $(seq 1 100) > du/a.txt && printf '%0.s.' $(seq 1 50) > du/sub/b.txt && du -s -b ${workdir}/du

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: -s reports the total in 1K blocks #

When #

mkdir -p du/sub && printf '%0.s.' $(seq 1 100) > du/a.txt && printf '%0.s.' $(seq 1 50) > du/sub/b.txt && du -s ${workdir}/du

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox du GNU flags #

Source: test/e2e/tools/mimixbox/shellutils/du_gnu.atago.yaml

Scenario: omits directories deeper than –max-depth #

When #

mkdir -p sub/deep && head -c 1000 /dev/zero > a.txt && head -c 2000 /dev/zero > sub/b.txt && head -c 3000 /dev/zero > sub/deep/c.txt && du --max-depth=1 "${workdir}" | sed "s#${workdir}#ROOT#"

Then #

  • exit code is 0
  • stdout equals an exact value
  • stdout equals an exact value

Scenario: prints only the operand total with –max-depth=0 #

When #

mkdir -p sub/deep && head -c 1000 /dev/zero > a.txt && head -c 2000 /dev/zero > sub/b.txt && head -c 3000 /dev/zero > sub/deep/c.txt && du --max-depth=0 "${workdir}" | sed "s#${workdir}#ROOT#"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: skips entries matching –exclude #

When #

mkdir -p sub/deep && head -c 1000 /dev/zero > a.txt && head -c 2000 /dev/zero > sub/b.txt && head -c 3000 /dev/zero > sub/deep/c.txt && du --exclude='sub' "${workdir}" | sed "s#${workdir}#ROOT#"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: skips glob-matching files under -a #

When #

mkdir -p sub/deep && head -c 1000 /dev/zero > a.txt && head -c 2000 /dev/zero > sub/b.txt && head -c 3000 /dev/zero > sub/deep/c.txt && head -c 4096 /dev/zero > drop.tmp && du -a --exclude='*.tmp' "${workdir}" | grep -c 'drop.tmp' || true

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: reports exact bytes with –apparent-size #

When #

mkdir -p sub/deep && head -c 1000 /dev/zero > a.txt && head -c 2000 /dev/zero > sub/b.txt && head -c 3000 /dev/zero > sub/deep/c.txt && du -s --apparent-size "${workdir}" | sed "s#${workdir}#ROOT#"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: reports block counts by default #

When #

mkdir -p sub/deep && head -c 1000 /dev/zero > a.txt && head -c 2000 /dev/zero > sub/b.txt && head -c 3000 /dev/zero > sub/deep/c.txt && du -s "${workdir}" | sed "s#${workdir}#ROOT#"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: matches a plain run on a single filesystem with -x #

When #

mkdir -p sub/deep && head -c 1000 /dev/zero > a.txt && head -c 2000 /dev/zero > sub/b.txt && head -c 3000 /dev/zero > sub/deep/c.txt && du -x -s "${workdir}" | sed "s#${workdir}#ROOT#"

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox echo #

Source: test/e2e/tools/mimixbox/shellutils/echo.atago.yaml

Scenario: says Hello World! #

When #

echo "Hello World!"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: says Hello World! (helper ignores the positional argument) #

When #

echo "Hello World!"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: expands an environment variable #

When #

export TEST_ENV="TEST_ENV_VAR"; echo ${TEST_ENV}

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: pipes data through xargs #

When #

echo "pipe" | xargs echo

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: says nothing with no arguments #

When #

echo

Then #

  • exit code is 0
  • stdout is empty

Scenario: redirects data to a file and shows it #

When #

echo "MimixBox" > echo.txt && cat echo.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: –help as the first argument prints usage instead of the literal text #

When #

echo --help

Then #

  • exit code is 0
  • stdout contains Usage: echo

Scenario: –version as the first argument prints the version line #

When #

echo --version

Then #

  • exit code is 0
  • stdout contains echo (mimixbox)

Scenario: –help that is not the first argument stays literal #

When #

echo foo --help

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox env #

Source: test/e2e/tools/mimixbox/shellutils/env.atago.yaml

Scenario: adds the assignment to the printed environment #

When #

env FOO=bar | grep '^FOO=bar$'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: -i prints only the given assignment #

When #

env -i ONLY=here

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: passes the variable to the run command #

When #

env GREETING=hi sh -c 'echo $GREETING'

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox env GNU flags #

Source: test/e2e/tools/mimixbox/shellutils/env_gnu.atago.yaml

Scenario: –chdir reports the chdir target via pwd (long flag with =) #

When #

env --chdir=/tmp pwd

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: –chdir reports the chdir target via pwd (-C short flag) #

When #

mkdir -p sub && env -C "${workdir}/sub" pwd

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: –chdir fails when the directory does not exist #

When #

env --chdir=${workdir}/nope pwd

Then #

  • exit code is 125
  • stderr contains cannot change directory

Scenario: –split-string splits the command and its arguments (-S) #

When #

env -S 'printf %s-%s a b'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: –split-string splits with the long flag and whitespace runs #

When #

env --split-string='printf   %s   hi'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: –ignore-signal accepts known names and still runs the command #

When #

env --ignore-signal=INT,TERM printf '%s' ok

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: –ignore-signal rejects an unknown signal name #

When #

env --ignore-signal=BOGUS printf x

Then #

  • exit code is 125
  • stderr contains invalid signal

mimixbox expr #

Source: test/e2e/tools/mimixbox/shellutils/expr.atago.yaml

Scenario: adds two numbers #

When #

expr 6 + 7

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: multiplies two numbers #

When #

expr 3 \* 4

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: respects parentheses #

When #

expr \( 1 + 2 \) \* 3

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: prints the string length #

When #

expr length abcd

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: prints 0 and exits non-zero for a zero result #

When #

expr 0

Then #

  • exit code is not 0
  • stdout equals an exact value

mimixbox factor #

Source: test/e2e/tools/mimixbox/shellutils/factor.atago.yaml

Scenario: describes itself with –help #

When #

factor --help

Then #

  • exit code is 0
  • stdout contains Usage: factor
  • stderr is empty

Scenario: documents its purpose in –help #

When #

factor --help

Then #

  • exit code is 0
  • stdout contains Print the prime factors

Scenario: factors a small integer #

When #

factor 12

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: fails on a non-numeric operand #

When #

factor notanumber

Then #

  • exit code is not 0
  • stderr contains factor:

mimixbox false #

Source: test/e2e/tools/mimixbox/shellutils/false.atago.yaml

Scenario: prints nothing and exits 1 #

When #

false

Then #

  • exit code is not 0
  • stdout is empty

mimixbox free #

Source: test/e2e/tools/mimixbox/shellutils/free.atago.yaml

Scenario: prints the column header #

When #

free | head -n 1

Then #

  • exit code is 0
  • stdout contains total, available

mimixbox fsync #

Source: test/e2e/tools/mimixbox/shellutils/fsync.atago.yaml

Scenario: describes itself with –help #

When #

fsync --help

Then #

  • exit code is 0
  • stdout contains Usage: fsync
  • stderr is empty

mimixbox ghrdc #

Source: test/e2e/tools/mimixbox/shellutils/ghrdc.atago.yaml

Scenario: prints usage with –help and exits 0 #

When #

ghrdc --help

Then #

  • exit code is 0
  • stdout contains Usage: ghrdc

Scenario: fails with a message when given no operand #

When #

ghrdc

Then #

  • exit code is not 0
  • stderr contains ghrdc

mimixbox groups #

Source: test/e2e/tools/mimixbox/shellutils/groups.atago.yaml

Scenario: describes itself with –help #

When #

groups --help

Then #

  • exit code is 0
  • stdout contains Usage: groups
  • stderr is empty

Scenario: prints the groups of a named user #

When #

groups root

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox gzip #

Source: test/e2e/tools/mimixbox/shellutils/gzip.atago.yaml

Scenario: compresses and decompresses back to the original #

Given #

  • Fixture file g.txt is created.

Inputs #

Fixture g.txt:

hello gzip roundtrip

When #

gzip ${workdir}/g.txt && gunzip ${workdir}/g.txt.gz && cat ${workdir}/g.txt

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox shellutils –help helpers #

Source: test/e2e/tools/mimixbox/shellutils/help_helpers_shellutils.atago.yaml

Scenario: fsync –help is structured #

When #

env -- fsync --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: log-collect –help is structured #

When #

env -- log-collect --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: sddf –help is structured #

When #

env -- sddf --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: time –help is structured #

When #

env -- time --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: usleep –help is structured #

When #

env -- usleep --help

Then #

  • exit code is 0
  • stdout contains Usage:

mimixbox hermetic harness #

Source: test/e2e/tools/mimixbox/shellutils/hermetic.atago.yaml

Scenario: resolves cat to the MimixBox binary, not the host command #

When #

path=$(command -v cat) && basename "$(readlink -f "${path}")"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: resolves head to the MimixBox binary, not the host command #

When #

path=$(command -v head) && basename "$(readlink -f "${path}")"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: resolves base64 to the MimixBox binary, not the host command #

When #

path=$(command -v base64) && basename "$(readlink -f "${path}")"

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox hostid #

Source: test/e2e/tools/mimixbox/shellutils/hostid.atago.yaml

Scenario: prints 8 hexadecimal digits #

When #

hostid

Then #

  • exit code is 0
  • stdout matches /^[0-9a-f]{8}/

Scenario: prints the same value on repeated calls #

When #

a=$(hostid); b=$(hostid); test "$a" = "$b" && echo "stable"

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox hostname #

Source: test/e2e/tools/mimixbox/shellutils/hostname.atago.yaml

Scenario: prints a non-empty host name #

When #

hostname

Then #

  • exit code is 0
  • stdout is not empty

mimixbox id #

Source: test/e2e/tools/mimixbox/shellutils/id.atago.yaml

Scenario: describes itself with –help #

When #

id --help

Then #

  • exit code is 0
  • stdout contains Usage: id
  • stderr is empty

Scenario: prints the current uid/gid line #

When #

id

Then #

  • exit code is 0
  • stdout contains uid=, gid=

mimixbox install #

Source: test/e2e/tools/mimixbox/shellutils/install.atago.yaml

Scenario: copies the file content #

Given #

  • Fixture file install/src is created.

Inputs #

Fixture install/src:

hello

When #

install -m 640 install/src install/dst && printf '%s' "$(cat install/dst)"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: sets the requested mode #

Given #

  • Fixture file install/src is created.

Inputs #

Fixture install/src:

hello

When #

install -m 640 install/src install/dst2 && stat -c '%a' install/dst2

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: creates directories with -d #

When #

install -d install/a/b/c && [ -d install/a/b/c ] && echo ok

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: fails without a destination #

When #

install only-source

Then #

  • exit code is not 0
  • stderr contains missing destination

mimixbox install_gnu #

Source: test/e2e/tools/mimixbox/shellutils/install_gnu.atago.yaml

Scenario: makes a simple backup before overwriting with –backup=simple #

When #

printf 'new\n' > src
printf 'old\n' > dst
install --backup=simple src dst
cat dst dst~

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

new
old

Scenario: honors –suffix when backing up #

When #

printf 'new\n' > src
printf 'old\n' > dst
install --backup=simple -S .bak src dst
cat dst.bak

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: makes numbered backups with –backup=numbered #

When #

printf 'v1\n' > src
printf 'orig\n' > dst
install --backup=numbered src dst
printf 'v2\n' > src
install --backup=numbered src dst
cat dst dst.~1~ dst.~2~

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

v2
orig
v1

Scenario: uses a simple backup with –backup=existing when none are numbered #

When #

printf 'new\n' > src
printf 'old\n' > dst
install --backup=existing src dst
cat dst~

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: attempts chown and fails as non-root with –owner/–group #

When #

printf 'data\n' > src
install -o 0 -g 0 src dst

Then #

  • exit code is not 0
  • stderr contains ownership
  • file dst exists

Generated artifacts #

  • dst

Scenario: rejects an invalid owner name #

When #

printf 'data\n' > src
install -o no-such-user-xyz src dst

Then #

  • exit code is not 0
  • stderr contains invalid user

Scenario: rejects an invalid –backup control #

When #

printf 'data\n' > src
install --backup=bogus src dst

Then #

  • exit code is not 0
  • stderr contains invalid argument

mimixbox kill #

Source: test/e2e/tools/mimixbox/shellutils/kill.atago.yaml

Scenario: lists signal names with -l #

When #

kill -l | grep -q KILL && echo ok

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox killall #

Source: test/e2e/tools/mimixbox/shellutils/killall.atago.yaml

Scenario: kills a process by name #

When #

sleep 30 & sleep 0.2; killall sleep; echo "killed:$?"

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox leadtime #

Source: test/e2e/tools/mimixbox/shellutils/leadtime.atago.yaml

Scenario: prints usage with –help and exits 0 #

When #

leadtime --help

Then #

  • exit code is 0
  • stdout contains Usage: leadtime, LT_GITHUB_ACCESS_TOKEN

Scenario: fails when no subcommand is given #

When #

leadtime

Then #

  • exit code is not 0
  • stderr contains stat

Scenario: fails on an unknown subcommand #

When #

leadtime bogus --owner=a --repo=b

Then #

  • exit code is not 0
  • stderr contains unknown subcommand

Scenario: fails with a deterministic error when no token is set #

When #

LT_GITHUB_ACCESS_TOKEN= GITHUB_TOKEN= leadtime stat --owner=acme --repo=demo

Then #

  • exit code is not 0
  • stderr contains no GitHub token

Scenario: fails when –owner/–repo are missing #

When #

LT_GITHUB_ACCESS_TOKEN=x leadtime stat

Then #

  • exit code is not 0
  • stderr contains --owner and --repo are required

Scenario: rejects –json with –markdown #

When #

LT_GITHUB_ACCESS_TOKEN=x leadtime stat --owner=a --repo=b --json --markdown

Then #

  • exit code is not 0
  • stderr contains mutually exclusive

mimixbox top-level list/suggestion CLI #

Source: test/e2e/tools/mimixbox/shellutils/list_topcli.atago.yaml

Scenario: –list –json emits a JSON array containing cat and ls on stdout #

When #

mimixbox --list --json

Then #

  • exit code is 0
  • stdout contains "name": "cat", "name": "ls", "subsystem":, "stability":, [, ]

Scenario: –list –filter=cat includes cat and excludes ls #

When #

mimixbox --list --filter=cat

Then #

  • exit code is 0
  • stdout contains cat
  • stdout contains cat

Scenario: –list –subsystem=textutils includes cat and excludes ls #

When #

mimixbox --list --subsystem=textutils

Then #

  • exit code is 0
  • stdout contains cat
  • stdout does not contain ls -

Scenario: an unknown command suggests the nearest applet, error-first #

When #

mimixbox lss

Then #

  • exit code is not 0
  • stdout is empty
  • stderr contains 'lss' is not a mimixbox command., Did you mean:, ls

mimixbox log-collect #

Source: test/e2e/tools/mimixbox/shellutils/logcollect.atago.yaml

Scenario: copies log files into the output directory #

Given #

  • Fixture file src/a.log is created.

Inputs #

Fixture src/a.log:

log

When #

log-collect -o ${workdir}/out ${workdir}/src >/dev/null && cat ${workdir}/out/a.log

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox logname #

Source: test/e2e/tools/mimixbox/shellutils/logname.atago.yaml

Scenario: prints the login name from LOGNAME #

When #

LOGNAME=mimixuser logname

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox mbsh #

Source: test/e2e/tools/mimixbox/shellutils/mbsh.atago.yaml

Scenario: runs an external command and shows a cwd-aware prompt #

When #

printf 'echo hello\nexit\n' | mbsh 2>/dev/null

Then #

  • exit code is 0
  • stdout contains hello, mbsh:

Scenario: ignores comment lines #

When #

printf '# a comment\necho ok\nexit\n' | mbsh 2>/dev/null

Then #

  • exit code is 0
  • stdout contains ok

Scenario: expands $? to the last exit status #

When #

printf 'false\necho status=$?\nexit\n' | mbsh 2>/dev/null

Then #

  • exit code is 0
  • stdout contains status=1

Scenario: lets a stdin-consuming command read the remaining script input #

When #

printf 'cat\nhello\nexit\n' | mbsh 2>/dev/null

Then #

  • exit code is 0
  • stdout contains hello

Scenario: does not reparse command-consumed stdin as later commands #

When #

err=$(printf 'cat\nhello\nexit\n' | mbsh 2>&1 >/dev/null)
case "${err}" in
    *"not a mimixbox command"*) echo reparsed ;;
    *) echo ok ;;
esac

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: keeps double-quoted spaces in one argument #

When #

printf 'echo "a b"\nexit\n' | mbsh 2>/dev/null

Then #

  • exit code is 0
  • stdout contains a b

Scenario: expands $HOME #

When #

out=$(printf 'echo $HOME\nexit\n' | mbsh 2>/dev/null)
case "${out}" in
    *"${HOME}"*) echo expanded ;;
    *) echo literal ;;
esac

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: passes a NAME=value prefix to the command environment #

When #

printf 'FOO=bar env\nexit\n' | mbsh 2>/dev/null | grep '^FOO=bar$'

Then #

  • exit code is 0
  • stdout contains FOO=bar

Scenario: runs commands in sequence and redirects output #

When #

d=$(mktemp -d)
printf 'echo one > %s/o; echo two >> %s/o\nexit\n' "$d" "$d" | mbsh >/dev/null 2>&1
cat "$d/o"
rm -rf "$d"

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

one
two

Scenario: pipes one command into another #

When #

d=$(mktemp -d)
printf 'printf foo | wc -c > %s/o\nexit\n' "$d" | mbsh >/dev/null 2>&1
tr -d ' \n' < "$d/o"
rm -rf "$d"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: redirects input with < #

When #

d=$(mktemp -d)
printf 'a\nb\nc\n' > "$d/in"
printf 'wc -l < %s/in > %s/o\nexit\n' "$d" "$d" | mbsh >/dev/null 2>&1
tr -d ' \n' < "$d/o"
rm -rf "$d"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: changes directory with cd #

When #

mkdir -p ${workdir}/mbsh && printf 'cd %s\npwd\nexit\n' "${workdir}/mbsh" | mbsh 2>/dev/null

Then #

  • exit code is 0
  • stdout contains ${workdir}/mbsh

mimixbox top-level CLI #

Source: test/e2e/tools/mimixbox/shellutils/mimixbox.atago.yaml

Scenario: prints usage to stdout with –help and exits success #

When #

mimixbox --help

Then #

  • exit code is 0
  • stdout contains Usage: mimixbox, Examples:

Scenario: lists the applets with –list #

When #

mimixbox --list

Then #

  • exit code is 0
  • stdout contains cat, pidof

Scenario: rejects an unknown option on stderr without polluting stdout #

When #

mimixbox --definitely-not-an-option

Then #

  • exit code is not 0
  • stdout is empty
  • stderr contains is not a mimixbox command or option

When #

d=$(mktemp -d) || exit 1
trap "rm -rf '$d'" EXIT
mimixbox --full-install "$d" >/dev/null 2>&1 || exit 1
[ -L "$d/cat" ] || exit 1
[ -L "$d/pidof" ] || exit 1
mimixbox --remove "$d" >/dev/null 2>&1 || exit 1
[ -L "$d/cat" ] && exit 1
[ -L "$d/pidof" ] && exit 1
echo ok

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox mknod #

Source: test/e2e/tools/mimixbox/shellutils/mknod.atago.yaml

Scenario: creates a FIFO with type p #

When #

mknod ${workdir}/pipe p && [ -p ${workdir}/pipe ] && echo fifo

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: rejects an invalid device type #

When #

mknod ${workdir}/x z

Then #

  • exit code is not 0
  • stderr contains invalid device type

mimixbox nice #

Source: test/e2e/tools/mimixbox/shellutils/nice.atago.yaml

Scenario: describes itself with –help #

When #

nice --help

Then #

  • exit code is 0
  • stdout contains Usage: nice
  • stderr is empty

mimixbox nohup #

Source: test/e2e/tools/mimixbox/shellutils/nohup.atago.yaml

Scenario: runs the command and passes output through #

When #

nohup echo hello

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox nproc #

Source: test/e2e/tools/mimixbox/shellutils/nproc.atago.yaml

Scenario: prints a positive number #

When #

nproc

Then #

  • exit code is 0
  • stdout matches /^[0-9]+\n?$/

mimixbox od #

Source: test/e2e/tools/mimixbox/shellutils/od.atago.yaml

Scenario: dumps characters with C escapes #

When #

printf 'ABC\n' | od -c

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

0000000   A   B   C  \n
0000004

Scenario: dumps hex bytes with hex addresses #

When #

printf 'AB' | od -A x -t x1

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

000000 41 42
000002

Scenario: suppresses the address column #

When #

printf 'A' | od -A n -t o1

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox path #

Source: test/e2e/tools/mimixbox/shellutils/path.atago.yaml

Scenario: prints the base name with –basename #

When #

path -b /home/nao/test.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: prints the directory with –dirname #

When #

path -d /home/nao/test.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: prints the extension with –extension #

When #

path -e /home/nao/test.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: prints the cleaned path with –canonical #

When #

path -c /home/nao/../nao/./test.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: reports an error with no operand #

When #

path

Then #

  • exit code is not 0
  • stderr equals an exact value

mimixbox pidof #

Source: test/e2e/tools/mimixbox/shellutils/pidof.atago.yaml

Scenario: finds the PID of a running process via MimixBox pidof #

When #

mimixbox pidof mimixbox >/dev/null 2>&1
sleep 5 &
SLEEP_PID=$!
RESULT=$(mimixbox pidof sleep)
kill ${SLEEP_PID} 2>/dev/null
echo "${RESULT}" | grep -q "${SLEEP_PID}" && echo found

Then #

  • exit code is 0
  • stdout equals an exact value

When #

pidof_path=$(command -v pidof) || exit 1
[ -L "${pidof_path}" ] || exit 1
target=$(readlink "${pidof_path}")
case "${target}" in
  *mimixbox) echo linked ;;
  *) exit 1 ;;
esac

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox posixer #

Source: test/e2e/tools/mimixbox/shellutils/posixer.atago.yaml

Scenario: prints a table header #

When #

posixer | head -n 1

Then #

  • exit code is 0
  • stdout contains NAME, INSTALLED

mimixbox printenv #

Source: test/e2e/tools/mimixbox/shellutils/printenv.atago.yaml

Scenario: prints an environment variable #

When #

MB_TEST_VAR=hello printenv MB_TEST_VAR

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox printf #

Source: test/e2e/tools/mimixbox/shellutils/printf.atago.yaml

Scenario: formats arguments #

When #

printf %s-%s\n foo bar

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox printf_meta #

Source: test/e2e/tools/mimixbox/shellutils/printf_meta.atago.yaml

Scenario: prints help for a leading –help #

When #

printf --help

Then #

  • exit code is 0
  • stdout contains Examples:
  • stdout matches /^Usage: printf/

Scenario: prints the version banner for a leading –version #

When #

printf --version

Then #

  • exit code is 0
  • stdout contains printf (mimixbox)

Scenario: treats a later –help as an ordinary operand #

When #

printf 'foo --help\n'

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox pwd #

Source: test/e2e/tools/mimixbox/shellutils/pwd.atago.yaml

Scenario: prints the working directory #

When #

cd /tmp && pwd

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox realpath #

Source: test/e2e/tools/mimixbox/shellutils/realpath.atago.yaml

Scenario: resolves an existing file to its absolute path #

Given #

  • Fixture file file.txt is created.

When #

realpath file.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: prints the cleaned absolute path with -m on a missing path #

When #

realpath -m ${workdir}/does/not/exist

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: reports an error with no operand #

When #

realpath

Then #

  • exit code is not 0
  • stderr equals an exact value

mimixbox realpath_gnu #

Source: test/e2e/tools/mimixbox/shellutils/realpath_gnu.atago.yaml

Scenario: prints a path relative to –relative-to #

Given #

  • Fixture file a/b/.keep is created.

When #

realpath --relative-to ${workdir}/a ${workdir}/a/b

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: resolves .. lexically with -L -m #

When #

realpath -L -m /tmp/../etc/./hosts

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox richhelp #

Source: test/e2e/tools/mimixbox/shellutils/richhelp.atago.yaml

Scenario: cp –help has a description, examples, and exit status #

When #

cp --help

Then #

  • exit code is 0
  • stdout contains Examples:, Exit status:

Scenario: tail –help documents follow mode with examples #

When #

tail --help

Then #

  • exit code is 0
  • stdout contains Examples:, Follow the file

Scenario: wget –help has examples and compatibility notes #

When #

wget --help

Then #

  • exit code is 0
  • stdout contains Examples:, Notes:

Scenario: mbsh –help describes the shell and its limits #

When #

mbsh --help

Then #

  • exit code is 0
  • stdout contains Examples:, Notes:

Scenario: vi –help lists the supported keys #

When #

vi --help

Then #

  • exit code is 0
  • stdout contains Motions:

Scenario: find –help has examples and notes #

When #

find --help

Then #

  • exit code is 0
  • stdout contains Examples:, Notes:

mimixbox sddf #

Source: test/e2e/tools/mimixbox/shellutils/sddf.atago.yaml

Scenario: prints usage with –help and exits 0 #

When #

sddf --help

Then #

  • exit code is 0
  • stdout contains Usage: sddf

Scenario: fails with a message when given no operand #

When #

sddf

Then #

  • exit code is not 0
  • stderr contains sddf

mimixbox seq #

Source: test/e2e/tools/mimixbox/shellutils/seq.atago.yaml

Scenario: counts from 1 to LAST #

When #

seq 3

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

1
2
3

Scenario: counts from FIRST to LAST #

When #

seq 2 5

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

2
3
4
5

Scenario: counts by INCREMENT #

When #

seq 1 2 9

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

1
3
5
7
9

Scenario: joins the numbers with the separator #

When #

seq -s , 1 3

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: pads numbers with leading zeros #

When #

seq -w 8 10

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

08
09
10

Scenario: reports an error for an invalid operand #

When #

seq abc

Then #

  • exit code is not 0
  • stderr equals an exact value

mimixbox sleep #

Source: test/e2e/tools/mimixbox/shellutils/sleep.atago.yaml

Scenario: sleeps then returns #

When #

sleep 0.1 && echo slept

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox sort #

Source: test/e2e/tools/mimixbox/shellutils/sort.atago.yaml

Scenario: sorts lines alphabetically #

When #

printf 'banana\napple\ncherry\n' | sort

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

apple
banana
cherry

Scenario: sorts by numeric value #

When #

printf '10\n2\n1\n' | sort -n

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

1
2
10

Scenario: reverses the order #

When #

printf 'a\nb\nc\n' | sort -r

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

c
b
a

Scenario: drops duplicate lines #

When #

printf 'a\na\nb\n' | sort -u

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

a
b

mimixbox sort (GNU extensions) #

Source: test/e2e/tools/mimixbox/shellutils/sort_gnu.atago.yaml

Scenario: -V orders version numbers by value #

When #

printf '1.10\n1.2\n1.1\n' | sort -V

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

1.1
1.2
1.10

Scenario: -g orders floating-point values including exponents #

When #

printf '1e3\n2.5\n100\n0.5\n' | sort -g

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

0.5
2.5
100
1e3

Scenario: -h orders human-readable sizes by magnitude #

When #

printf '1G\n2K\n1M\n' | sort -h

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

2K
1M
1G

Scenario: -s keeps input order for equal keys #

When #

printf '5 zebra\n5 apple\n5 mango\n' | sort -s -n

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

5 zebra
5 apple
5 mango

Scenario: -z reads and writes NUL-delimited records #

When #

printf 'banana\000apple\000cherry\000' | sort -z | tr '\000' '|'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: -m merges already-sorted input #

When #

printf 'apple\nbanana\ncherry\n' | sort -m

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

apple
banana
cherry

Scenario: –parallel is accepted without error #

When #

printf 'b\na\n' | sort --parallel=4

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

a
b

Scenario: –temporary-directory is accepted without error #

When #

printf 'b\na\n' | sort --temporary-directory=/tmp

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

a
b

mimixbox speaker #

Source: test/e2e/tools/mimixbox/shellutils/speaker.atago.yaml

Scenario: errors when no text is given #

When #

speaker 2>&1; echo "rc:$?"

Then #

  • exit code is 0
  • stdout contains rc:1

mimixbox sync #

Source: test/e2e/tools/mimixbox/shellutils/sync.atago.yaml

Scenario: flushes filesystem buffers #

When #

sync && echo synced

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox tee #

Source: test/e2e/tools/mimixbox/shellutils/tee.atago.yaml

Scenario: echoes standard input to stdout #

When #

printf 'hello\n' | tee ${workdir}/out.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: also writes the input to the file #

When #

printf 'hello\n' | tee ${workdir}/out.txt > /dev/null; cat ${workdir}/out.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: appends to a file with -a keeping the existing content #

When #

printf 'one\n' | tee ${workdir}/log.txt > /dev/null
printf 'two\n' | tee -a ${workdir}/log.txt > /dev/null
cat ${workdir}/log.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

one
two

mimixbox tee –output-error #

Source: test/e2e/tools/mimixbox/shellutils/tee_output_error.atago.yaml

Scenario: copies input and succeeds with an explicit MODE #

When #

printf 'hello\n' | tee --output-error=warn ${workdir}/good.txt > /dev/null; cat ${workdir}/good.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: warn mode still writes the good file but exits nonzero #

When #

printf 'payload\n' | tee --output-error=warn \
  ${workdir}/missing-dir/bad.txt ${workdir}/good.txt > /dev/null 2>&1
rc=$?
cat ${workdir}/good.txt 2>/dev/null
exit ${rc}

Then #

  • exit code is not 0
  • stdout equals an exact value

Scenario: exit mode does not create the later good file and exits nonzero #

When #

printf 'payload\n' | tee --output-error=exit \
  ${workdir}/missing-dir/bad.txt ${workdir}/good.txt > /dev/null 2>&1
rc=$?
if [ -f ${workdir}/good.txt ]; then
  printf 'present\n'
else
  printf 'absent\n'
fi
exit ${rc}

Then #

  • exit code is not 0
  • stdout equals an exact value

mimixbox test #

Source: test/e2e/tools/mimixbox/shellutils/test.atago.yaml

Scenario: string equality is true for equal strings #

When #

test abc = abc; echo "rc=$?"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: integer comparison is true when 2 > 1 #

When #

test 2 -gt 1; echo "rc=$?"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: integer comparison is false when 1 > 2 #

When #

test 1 -gt 2; echo "rc=$?"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: file existence is true for an existing file #

Given #

  • Fixture file file.txt is created.

When #

test -f ${workdir}/file.txt; echo "rc=$?"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: negation negates the expression #

When #

test ! -f /no_such_file; echo "rc=$?"

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox test (meta) #

Source: test/e2e/tools/mimixbox/shellutils/test_meta.atago.yaml

Scenario: prints help for a sole –help #

When #

env test --help

Then #

  • exit code is 0
  • stdout contains Usage: test

Scenario: prints the version banner for a sole –version #

When #

env test --version

Then #

  • exit code is 0
  • stdout contains test (mimixbox)

Scenario: evaluates an expression when –help is not the sole argument #

When #

env test foo = --help

Then #

  • exit code is not 0
  • stdout does not contain Usage: test

mimixbox time #

Source: test/e2e/tools/mimixbox/shellutils/time.atago.yaml

Scenario: describes itself with –help #

When #

time --help

Then #

  • exit code is 0
  • stdout contains Usage: time
  • stderr is empty

mimixbox time / fsync #

Source: test/e2e/tools/mimixbox/shellutils/timefsync.atago.yaml

Scenario: time runs the command and passes its output through #

When #

env time echo timed 2>/dev/null

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: time reports the real elapsed time on stderr #

When #

env time echo x 2>&1 1>/dev/null | grep -c real

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: fsync succeeds on an existing file #

Given #

  • Fixture file f.txt is created.

Inputs #

Fixture f.txt:

data

When #

fsync ${workdir}/f.txt; echo $?

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: fsync fails on a missing file #

When #

fsync /no/such/mimixbox/file 2>/dev/null; echo $?

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox timeout #

Source: test/e2e/tools/mimixbox/shellutils/timeout.atago.yaml

Scenario: runs the command to completion #

When #

timeout 5 echo done

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: returns exit code 124 on timeout #

When #

timeout 0.1 sleep 5; echo "exit:$?"

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox tree / nice #

Source: test/e2e/tools/mimixbox/shellutils/tree.atago.yaml

Scenario: tree counts directories and files in its summary #

Given #

  • Fixture file sub/leaf.txt is created.
  • Fixture file root.txt is created.

When #

tree ${workdir} | grep directories

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: tree exits successfully on a readable directory #

Given #

  • Fixture file sub/leaf.txt is created.
  • Fixture file root.txt is created.

When #

tree ${workdir} > /dev/null; echo $?

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: nice prints a numeric niceness #

When #

nice

Then #

  • exit code is 0
  • stdout matches /[0-9]/

mimixbox true #

Source: test/e2e/tools/mimixbox/shellutils/true.atago.yaml

Scenario: prints nothing and exits 0 #

When #

true

Then #

  • exit code is 0
  • stdout is empty

mimixbox tsort #

Source: test/e2e/tools/mimixbox/shellutils/tsort.atago.yaml

Scenario: describes itself with –help #

When #

tsort --help

Then #

  • exit code is 0
  • stdout contains Usage: tsort
  • stderr is empty

Scenario: documents its purpose in –help #

When #

tsort --help

Then #

  • exit code is 0
  • stdout contains total ordering

Scenario: produces a topological order #

Inputs #

stdin for tsort:

a b
b c

When #

tsort

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

a
b
c

mimixbox tty #

Source: test/e2e/tools/mimixbox/shellutils/tty.atago.yaml

Scenario: reports not a tty when stdin is a pipe #

When #

echo "" | tty

Then #

  • exit code is not 0
  • stdout equals an exact value

mimixbox uname #

Source: test/e2e/tools/mimixbox/shellutils/uname.atago.yaml

Scenario: prints the kernel name #

When #

uname -s

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox uniq #

Source: test/e2e/tools/mimixbox/shellutils/uniq.atago.yaml

Scenario: collapses repeated adjacent lines #

When #

printf 'a\na\nb\nc\nc\nc\n' | uniq

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

a
b
c

Scenario: -c prefixes each line with its count #

When #

printf 'a\na\nb\nc\nc\nc\n' | uniq -c

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

      2 a
      1 b
      3 c

Scenario: -d prints only repeated lines once #

When #

printf 'a\na\nb\nc\nc\n' | uniq -d

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

a
c

Scenario: -u prints only lines that never repeat #

When #

printf 'a\na\nb\nc\nc\n' | uniq -u

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox users #

Source: test/e2e/tools/mimixbox/shellutils/users.atago.yaml

Scenario: runs and exits successfully #

When #

users >/dev/null 2>&1; echo $?

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: treats a missing utmp as nobody logged in #

When #

out=$(users /no/such/mimixbox/utmp); echo "[$out] rc=$?"

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox usleep #

Source: test/e2e/tools/mimixbox/shellutils/usleep.atago.yaml

Scenario: describes itself with –help #

When #

usleep --help

Then #

  • exit code is 0
  • stdout contains Usage: usleep
  • stderr is empty

Scenario: rejects a non-numeric microsecond count #

When #

usleep notanumber

Then #

  • exit code is not 0
  • stderr contains usleep:

mimixbox uuidgen #

Source: test/e2e/tools/mimixbox/shellutils/uuidgen.atago.yaml

Scenario: prints a well-formed UUID #

When #

uuidgen | grep -Eq '^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$' && echo ok

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox w #

Source: test/e2e/tools/mimixbox/shellutils/w.atago.yaml

Scenario: prints a summary header with the load averages #

When #

w | sed -n '1p'

Then #

  • exit code is 0
  • stdout contains load average:, up

Scenario: prints the column header #

When #

w | sed -n '2p'

Then #

  • exit code is 0
  • stdout contains USER, LOGIN@

mimixbox watch #

Source: test/e2e/tools/mimixbox/shellutils/watch.atago.yaml

Scenario: runs the command and shows its output #

When #

timeout 0.6 watch -t -n 0.2 echo tick 2>/dev/null

Then #

  • exit code is not 0
  • stdout contains tick

mimixbox wget #

Source: test/e2e/tools/mimixbox/shellutils/wget.atago.yaml

Scenario: prints usage with –help and exits 0 #

When #

wget --help

Then #

  • exit code is 0
  • stdout contains Usage: wget

Scenario: fails with a message when given no operand #

When #

wget

Then #

  • exit code is not 0
  • stderr contains wget

Scenario: documents the added download options #

When #

wget --help

Then #

  • exit code is 0
  • stdout contains --directory-prefix, --continue, --timeout, --tries, --user-agent

mimixbox which #

Source: test/e2e/tools/mimixbox/shellutils/which.atago.yaml

Scenario: prints the MimixBox path #

When #

[ "$(which mimixbox)" = "$(dirname "$(command -v mimixbox)")/mimixbox" ] && echo match

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: prints nothing for a binary that does not exist #

When #

which no_exist_binary

Then #

  • exit code is not 0
  • stdout is empty

Scenario: prints paths of three binaries #

When #

d=$(dirname "$(command -v mimixbox)")
[ "$(which mimixbox cat tac)" = "$(printf '%s\n%s\n%s' "$d/mimixbox" "$d/cat" "$d/tac")" ] && echo match

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: prints paths of two binaries and fails when one of three is missing #

When #

which mimixbox not_exist_binary tac

Then #

  • exit code is not 0
  • stdout matches //mimixbox\n.*/tac\n?$/

Scenario: prints nothing without an operand #

When #

which

Then #

  • exit code is not 0
  • stdout is empty

Scenario: prints nothing when data comes from a pipe #

When #

echo "test" | which

Then #

  • exit code is not 0
  • stdout is empty

mimixbox who #

Source: test/e2e/tools/mimixbox/shellutils/who.atago.yaml

Scenario: prints nothing and succeeds on an empty utmp #

When #

who /dev/null; echo "rc=$?"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: -q reports zero users on an empty utmp #

When #

who -q /dev/null

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: –help prints usage #

When #

who --help

Then #

  • exit code is 0
  • stdout contains Usage: who

mimixbox whoami #

Source: test/e2e/tools/mimixbox/shellutils/whoami.atago.yaml

Scenario: prints the current user name #

When #

[ "$(whoami)" = "$(id -un)" ] && echo match

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: reports an error with an extra operand #

When #

whoami extra

Then #

  • exit code is not 0
  • stderr equals an exact value

mimixbox yes #

Source: test/e2e/tools/mimixbox/shellutils/yes.atago.yaml

Scenario: repeats y until the reader closes #

When #

yes | head -n 3

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

y
y
y

Scenario: repeats the given string #

When #

yes mimix | head -n 2

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

mimix
mimix

mimixbox base32 #

Source: test/e2e/tools/mimixbox/textutils/base32.atago.yaml

Scenario: encodes standard input #

When #

printf 'hello\n' | base32

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: decodes standard input #

When #

printf 'NBSWY3DPBI======\n' | base32 -d

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox cat #

Source: test/e2e/tools/mimixbox/textutils/cat.atago.yaml

Scenario: show shell family name #

Given #

  • Fixture file cat.txt is created.

Inputs #

Fixture cat.txt:

sh
ash
csh
bash

When #

cat cat.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

sh
ash
csh
bash

Scenario: show shell family name with line numbers #

Given #

  • Fixture file cat.txt is created.

Inputs #

Fixture cat.txt:

sh
ash
csh
bash

When #

cat -n cat.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

     1	sh
     2	ash
     3	csh
     4	bash

Scenario: show the piped path unchanged #

When #

echo "${workdir}/cat.txt" | cat

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: cat only the file operand, ignoring pipe data #

Given #

  • Fixture file cat.txt is created.

Inputs #

Fixture cat.txt:

sh
ash
csh
bash

When #

echo "${workdir}/cat2.txt" | cat cat.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

sh
ash
csh
bash

Scenario: concatenate two files #

Given #

  • Fixture file cat.txt is created.
  • Fixture file cat2.txt is created.

Inputs #

Fixture cat.txt:

sh
ash
csh
bash

Fixture cat2.txt:

fish
zsh

When #

cat cat.txt cat2.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

sh
ash
csh
bash
fish
zsh

Scenario: concatenate two files with line numbers #

Given #

  • Fixture file cat.txt is created.
  • Fixture file cat2.txt is created.

Inputs #

Fixture cat.txt:

sh
ash
csh
bash

Fixture cat2.txt:

fish
zsh

When #

cat -n cat.txt cat2.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

     1	sh
     2	ash
     3	csh
     4	bash
     5	fish
     6	zsh

Scenario: concatenate a heredoc and a file via redirect #

Given #

  • Fixture file cat.txt is created.

Inputs #

Fixture cat.txt:

sh
ash
csh
bash

When #

cat - << EOS cat.txt > cat2.txt
fish
zsh
EOS
cat cat2.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

fish
zsh
sh
ash
csh
bash

Scenario: show error for a missing file #

When #

cat no_exist_file

Then #

  • exit code is not 0
  • stderr equals an exact value

mimixbox cat_showall #

Source: test/e2e/tools/mimixbox/textutils/cat_showall.atago.yaml

Scenario: -A and –show-all are aliases #

Given #

  • Fixture file cat_nonprinting.bin is created.

When #

cat -A "${workdir}/cat_nonprinting.bin" > short.out
cat --show-all "${workdir}/cat_nonprinting.bin" > long.out
if cmp -s short.out long.out; then echo "identical"; else echo "different"; fi

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: -v and –show-nonprinting are aliases #

Given #

  • Fixture file cat_nonprinting.bin is created.

When #

cat -v "${workdir}/cat_nonprinting.bin" > short.out
cat --show-nonprinting "${workdir}/cat_nonprinting.bin" > long.out
if cmp -s short.out long.out; then echo "identical"; else echo "different"; fi

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: –show-all renders tabs as ^I, non-printing bytes, and $ line ends #

Given #

  • Fixture file cat_nonprinting.bin is created.

When #

cat --show-all ${workdir}/cat_nonprinting.bin

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

a^Ib^A$
$
^?M-^@$

Scenario: –show-nonprinting leaves TAB alone and renders ^X, ^?, and M- notation #

Given #

  • Fixture file cat_nonprinting.bin is created.

When #

cat --show-nonprinting ${workdir}/cat_nonprinting.bin

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

a	b^A

^?M-^@

mimixbox checksum #

Source: test/e2e/tools/mimixbox/textutils/checksum.atago.yaml

Scenario: sum prints the BSD checksum and block count #

When #

printf 'hello\n' | sum

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: crc32 prints the CRC-32 of stdin #

When #

printf 'hello\n' | crc32

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: sha384sum prints the SHA-384 digest #

When #

printf 'hello\n' | sha384sum

Then #

  • exit code is 0
  • stdout contains 1d0f284efe3edea4b9ca3bd514fa134b17eae361ccc7a1eefeff801b9bd6604e

mimixbox cksum #

Source: test/e2e/tools/mimixbox/textutils/cksum.atago.yaml

Scenario: prints the CRC checksum and byte count #

When #

printf 'hello\n' | cksum

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox comm #

Source: test/e2e/tools/mimixbox/textutils/comm.atago.yaml

Scenario: print lines common to both files #

Given #

  • Fixture file comm_a.txt is created.
  • Fixture file comm_b.txt is created.

Inputs #

Fixture comm_a.txt:

apple
banana

Fixture comm_b.txt:

banana
cherry

When #

comm -1 -2 ${workdir}/comm_a.txt ${workdir}/comm_b.txt

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox comm_gnu #

Source: test/e2e/tools/mimixbox/textutils/comm_gnu.atago.yaml

Scenario: separate the columns with –output-delimiter #

Given #

  • Fixture file comm_gnu/a.txt is created.
  • Fixture file comm_gnu/b.txt is created.

Inputs #

Fixture comm_gnu/a.txt:

apple
banana
cherry

Fixture comm_gnu/b.txt:

banana
cherry
date

When #

comm --output-delimiter=, ${workdir}/comm_gnu/a.txt ${workdir}/comm_gnu/b.txt

Then #

  • exit code is 0
  • stdout equals an exact value
  • stdout equals an exact value
  • stdout equals an exact value
  • stdout equals an exact value

Scenario: read and write NUL-terminated records with -z #

Given #

  • Fixture file comm_gnu/za.txt is created.
  • Fixture file comm_gnu/zb.txt is created.

When #

comm -z -1 -2 ${workdir}/comm_gnu/za.txt ${workdir}/comm_gnu/zb.txt | tr '\0' '#'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: report an unsorted input on stderr and fail with –check-order #

Given #

  • Fixture file comm_gnu/unsorted.txt is created.
  • Fixture file comm_gnu/b.txt is created.

Inputs #

Fixture comm_gnu/unsorted.txt:

cherry
banana

Fixture comm_gnu/b.txt:

banana
cherry
date

When #

comm --check-order ${workdir}/comm_gnu/unsorted.txt ${workdir}/comm_gnu/b.txt
echo "rc=$?"

Then #

  • exit code is 0
  • stdout equals an exact value
  • stderr contains file 1 is not in sorted order

mimixbox convert_mode #

Source: test/e2e/tools/mimixbox/textutils/convert_mode.atago.yaml

Scenario: dos2unix keeps the original mode #

Given #

  • Fixture file d2u.txt is created.

Inputs #

Fixture d2u.txt:

a
b

When #

dos2unix "${workdir}/d2u.txt" >/dev/null 2>&1
stat -c '%a' "${workdir}/d2u.txt"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: unix2dos keeps the original mode #

Given #

  • Fixture file u2d.txt is created.

Inputs #

Fixture u2d.txt:

a
b

When #

unix2dos "${workdir}/u2d.txt" >/dev/null 2>&1
stat -c '%a' "${workdir}/u2d.txt"

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox crc32 #

Source: test/e2e/tools/mimixbox/textutils/crc32.atago.yaml

Scenario: describes itself with –help #

When #

crc32 --help

Then #

  • exit code is 0
  • stdout contains Usage: crc32
  • stderr is empty

Scenario: prints the CRC-32 of stdin #

Inputs #

stdin for crc32:

hello

When #

crc32

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox dos2unix #

Source: test/e2e/tools/mimixbox/textutils/dos2unix.atago.yaml

Scenario: convert a CRLF file to LF and reclassify it #

Given #

  • Fixture file dos2unix/1.txt is created.

Inputs #

Fixture dos2unix/1.txt:

abc
def
ghi

When #

dos2unix "${workdir}/dos2unix/1.txt"
file "${workdir}/dos2unix/1.txt"

Then #

  • stdout equals an exact value

Expected output #

expected stdout:

dos2unix: converting file ${workdir}/dos2unix/1.txt to Unix format...
${workdir}/dos2unix/1.txt: ASCII text

Scenario: convert a CRLF file and exit success #

Given #

  • Fixture file dos2unix/1.txt is created.

Inputs #

Fixture dos2unix/1.txt:

abc
def
ghi

When #

dos2unix "${workdir}/dos2unix/1.txt"

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

dos2unix: converting file ${workdir}/dos2unix/1.txt to Unix format...

Scenario: convert three CRLF files at once and reclassify each #

Given #

  • Fixture file dos2unix/1.txt is created.
  • Fixture file dos2unix/2.txt is created.
  • Fixture file dos2unix/3.txt is created.

Inputs #

Fixture dos2unix/1.txt:

abc
def
ghi

Fixture dos2unix/2.txt:

abc
def
ghi

Fixture dos2unix/3.txt:

abc
def
ghi

When #

dos2unix "${workdir}/dos2unix/1.txt" "${workdir}/dos2unix/2.txt" "${workdir}/dos2unix/3.txt"
file "${workdir}/dos2unix/1.txt"
file "${workdir}/dos2unix/2.txt"
file "${workdir}/dos2unix/3.txt"

Then #

  • stdout equals an exact value

Expected output #

expected stdout:

dos2unix: converting file ${workdir}/dos2unix/1.txt to Unix format...
dos2unix: converting file ${workdir}/dos2unix/2.txt to Unix format...
dos2unix: converting file ${workdir}/dos2unix/3.txt to Unix format...
${workdir}/dos2unix/1.txt: ASCII text
${workdir}/dos2unix/2.txt: ASCII text
${workdir}/dos2unix/3.txt: ASCII text

Scenario: convert three CRLF files at once and exit success #

Given #

  • Fixture file dos2unix/1.txt is created.
  • Fixture file dos2unix/2.txt is created.
  • Fixture file dos2unix/3.txt is created.

Inputs #

Fixture dos2unix/1.txt:

abc
def
ghi

Fixture dos2unix/2.txt:

abc
def
ghi

Fixture dos2unix/3.txt:

abc
def
ghi

When #

dos2unix "${workdir}/dos2unix/1.txt" "${workdir}/dos2unix/2.txt" "${workdir}/dos2unix/3.txt"

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

dos2unix: converting file ${workdir}/dos2unix/1.txt to Unix format...
dos2unix: converting file ${workdir}/dos2unix/2.txt to Unix format...
dos2unix: converting file ${workdir}/dos2unix/3.txt to Unix format...

Scenario: refuse a directory with a not-regular-file error #

Given #

  • Fixture file dos2unix/1.txt is created.

Inputs #

Fixture dos2unix/1.txt:

abc
def
ghi

When #

dos2unix ${workdir}/dos2unix

Then #

  • exit code is not 0
  • stderr equals an exact value

Scenario: convert the two files but fail on the directory operand #

Given #

  • Fixture file dos2unix/1.txt is created.
  • Fixture file dos2unix/3.txt is created.

Inputs #

Fixture dos2unix/1.txt:

abc
def
ghi

Fixture dos2unix/3.txt:

abc
def
ghi

When #

dos2unix ${workdir}/dos2unix/1.txt ${workdir}/dos2unix ${workdir}/dos2unix/3.txt

Then #

  • exit code is not 0
  • stdout equals an exact value
  • stderr equals an exact value

Expected output #

expected stdout:

dos2unix: converting file ${workdir}/dos2unix/1.txt to Unix format...
dos2unix: converting file ${workdir}/dos2unix/3.txt to Unix format...

mimixbox expand #

Source: test/e2e/tools/mimixbox/textutils/expand.atago.yaml

Scenario: converts tabs to spaces (default tab stop 8) #

When #

printf 'a\tb\n' | expand

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: converts tabs to the given width #

When #

printf 'a\tb\n' | expand -t 4

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: converts tabs in the file #

Given #

  • Fixture file expand.txt is created.

Inputs #

Fixture expand.txt:

a	b

When #

expand expand.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: reports an error for a non-existent file #

When #

expand /no_exist_file

Then #

  • exit code is not 0
  • stderr equals an exact value

mimixbox fmt #

Source: test/e2e/tools/mimixbox/textutils/fmt.atago.yaml

Scenario: reflows text to the given width #

When #

printf 'aa bb cc dd\n' | fmt -w 5

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

aa bb
cc dd

mimixbox fold #

Source: test/e2e/tools/mimixbox/textutils/fold.atago.yaml

Scenario: wraps lines to the given width #

When #

printf 'abcdefgh\n' | fold -w 3

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

abc
def
gh

mimixbox head #

Source: test/e2e/tools/mimixbox/textutils/head.atago.yaml

Scenario: print the first 10 lines #

Given #

  • Fixture file head.txt is created.

Inputs #

Fixture head.txt:

1
2
3
4
5
6
7
8
9
10
11
12

When #

head head.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

1
2
3
4
5
6
7
8
9
10

Scenario: print the first N lines #

Given #

  • Fixture file head.txt is created.

Inputs #

Fixture head.txt:

1
2
3
4
5
6
7
8
9
10
11
12

When #

head -n 3 head.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

1
2
3

Scenario: print the first N bytes #

When #

printf 'hello world' | head -c 5

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: print the first N lines of stdin #

When #

printf 'a\nb\nc\nd\n' | head -n 2

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

a
b

Scenario: report an error for a non-existent file #

When #

head /no_exist_file

Then #

  • exit code is not 0
  • stderr equals an exact value

mimixbox head –zero-terminated #

Source: test/e2e/tools/mimixbox/textutils/head_zero.atago.yaml

Scenario: prints the first NUL-delimited record, preserving the embedded newline #

When #

printf 'a\nb\0c\nd\0' | head -z -n 1 | tr '\0' '|'

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

a
b|

Scenario: prints two NUL-delimited records with embedded newlines preserved #

When #

printf 'a\nb\0c\nd\0' | head --zero-terminated -n 2 | tr '\0' '|'

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

a
b|c
d|

mimixbox textutils –help helpers #

Source: test/e2e/tools/mimixbox/textutils/help_helpers_textutils.atago.yaml

Scenario: crc32 –help is structured #

When #

env -- crc32 --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: sha384sum –help is structured #

When #

env -- sha384sum --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: sha3sum –help is structured #

When #

env -- sha3sum --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: sum –help is structured #

When #

env -- sum --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: uudecode –help is structured #

When #

env -- uudecode --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: uuencode –help is structured #

When #

env -- uuencode --help

Then #

  • exit code is 0
  • stdout contains Usage:

mimixbox man #

Source: test/e2e/tools/mimixbox/textutils/man.atago.yaml

Scenario: show a plain manual page #

Given #

  • Fixture file man/man1/foo.1 is created.

Inputs #

Fixture man/man1/foo.1:

FOO(1)
the foo page

When #

man -M "${workdir}/man" foo

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

FOO(1)
the foo page

Scenario: decompress a gzipped manual page #

When #

mkdir -p "${workdir}/man/man1"; printf 'BAR(1)\nthe bar page\n' | gzip > "${workdir}/man/man1/bar.1.gz"
man -M "${workdir}/man" bar

Then #

  • after man -M "${workdir}/man" bar:
    • exit code is 0
    • stdout equals an exact value

Expected output #

expected stdout:

BAR(1)
the bar page

Scenario: report a missing page with exit 16 #

Given #

  • Fixture file man/man1/foo.1 is created.

Inputs #

Fixture man/man1/foo.1:

FOO(1)
the foo page

When #

man -M "${workdir}/man" missing 2>/dev/null; echo "exit=$?"

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox md5sum #

Source: test/e2e/tools/mimixbox/textutils/md5sum.atago.yaml

Scenario: get md5sum of one file #

Given #

  • Fixture file md5sum/1.txt is created.

Inputs #

Fixture md5sum/1.txt:

Dungeon of Regalias

When #

md5sum ${workdir}/md5sum/1.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: cannot get md5sum of one directory #

Given #

  • Fixture file md5sum/1.txt is created.

Inputs #

Fixture md5sum/1.txt:

Dungeon of Regalias

When #

md5sum ${workdir}/md5sum

Then #

  • exit code is not 0
  • stderr equals an exact value

Scenario: cannot get md5sum of not exist file #

When #

md5sum /not_exist_file

Then #

  • exit code is not 0
  • stderr equals an exact value

Scenario: get md5sum of three files #

Given #

  • Fixture file md5sum/1.txt is created.
  • Fixture file md5sum/2.txt is created.
  • Fixture file md5sum/3.txt is created.

Inputs #

Fixture md5sum/1.txt:

Dungeon of Regalias

Fixture md5sum/2.txt:

DEMONION

Fixture md5sum/3.txt:

Dungeon Crusadearz

When #

md5sum ${workdir}/md5sum/1.txt ${workdir}/md5sum/2.txt ${workdir}/md5sum/3.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

d0d8ffef81b3c7160ac655d5939548c5  ${workdir}/md5sum/1.txt
07e280ad4bd77b9321f0ce3386775019  ${workdir}/md5sum/2.txt
15e924f84517598e828f49dc85765bc5  ${workdir}/md5sum/3.txt

Scenario: check md5sum with –check option #

Given #

  • Fixture file md5sum/1.txt is created.
  • Fixture file md5sum/2.txt is created.
  • Fixture file md5sum/3.txt is created.
  • Fixture file md5sum/checksum.txt is created.

Inputs #

Fixture md5sum/1.txt:

Dungeon of Regalias

Fixture md5sum/2.txt:

DEMONION

Fixture md5sum/3.txt:

Dungeon Crusadearz

Fixture md5sum/checksum.txt:

d0d8ffef81b3c7160ac655d5939548c5  ${workdir}/md5sum/1.txt
07e280ad4bd77b9321f0ce3386775019  ${workdir}/md5sum/2.txt
15e924f84517598e828f49dc85765bc5  ${workdir}/md5sum/3.txt

When #

md5sum -c ${workdir}/md5sum/checksum.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

${workdir}/md5sum/1.txt: OK
${workdir}/md5sum/2.txt: OK
${workdir}/md5sum/3.txt: OK

Scenario: get md5sum for pipe data #

When #

echo "test" | md5sum

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: get md5sum for pipe data and file at same time #

Given #

  • Fixture file md5sum/1.txt is created.

Inputs #

Fixture md5sum/1.txt:

Dungeon of Regalias

When #

echo "test" | md5sum ${workdir}/md5sum/1.txt

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox nl #

Source: test/e2e/tools/mimixbox/textutils/nl.atago.yaml

Scenario: number each line of a file #

Given #

  • Fixture file nl.txt is created.

Inputs #

Fixture nl.txt:

sh
ash
csh
bash

When #

nl nl.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

     1	sh
     2	ash
     3	csh
     4	bash

Scenario: number the single line read from pipe data #

Given #

  • Fixture file nl.txt is created.

Inputs #

Fixture nl.txt:

sh
ash
csh
bash

When #

echo "${workdir}/nl.txt" | nl

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: number only the file operand, ignoring pipe data #

Given #

  • Fixture file nl.txt is created.

Inputs #

Fixture nl.txt:

sh
ash
csh
bash

When #

echo "${workdir}/nl.txt" | nl nl.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

     1	sh
     2	ash
     3	csh
     4	bash

Scenario: number lines across two files #

Given #

  • Fixture file nl.txt is created.
  • Fixture file nl2.txt is created.

Inputs #

Fixture nl.txt:

sh
ash
csh
bash

Fixture nl2.txt:

fish
zsh

When #

nl nl.txt nl2.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

     1	sh
     2	ash
     3	csh
     4	bash
     5	fish
     6	zsh

Scenario: number heredoc then file via a redirect #

Given #

  • Fixture file nl.txt is created.

Inputs #

Fixture nl.txt:

sh
ash
csh
bash

When #

nl - << EOS nl.txt > nl2.txt
fish
zsh
EOS
cat nl2.txt

Then #

  • stdout equals an exact value

Expected output #

expected stdout:

     1	fish
     2	zsh
     3	sh
     4	ash
     5	csh
     6	bash

Scenario: number heredoc then file via a redirect with success status #

Given #

  • Fixture file nl.txt is created.

Inputs #

Fixture nl.txt:

sh
ash
csh
bash

When #

nl - << EOS nl.txt > nl2.txt
fish
zsh
EOS
cat nl2.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

     1	fish
     2	zsh
     3	sh
     4	ash
     5	csh
     6	bash

Scenario: report an error for a non-existent file #

When #

nl no_exist_file

Then #

  • exit code is not 0
  • stderr equals an exact value

mimixbox nl sections #

Source: test/e2e/tools/mimixbox/textutils/nl_sections.atago.yaml

Scenario: number every line in every section with -h a -b a -f a #

Given #

  • Fixture file nl_sec.txt is created.

Inputs #

Fixture nl_sec.txt:

H1
\:\:\:
HDR
\:\:
B1
\:
F1

When #

nl -h a -b a -f a nl_sec.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

     1	H1

     1	HDR

     1	B1

     1	F1

Given #

  • Fixture file nl_sec.txt is created.

Inputs #

Fixture nl_sec.txt:

H1
\:\:\:
HDR
\:\:
B1
\:
F1

When #

nl -h a -b t -f n nl_sec.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

     1	H1

     1	HDR

     1	B1

       F1

Scenario: number every second blank line with -l 2 #

Given #

  • Fixture file nl_blank.txt is created.

Inputs #

Fixture nl_blank.txt:

a




b

When #

nl -b a -l 2 nl_blank.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

     1	a
       
     2	
       
     3	
     4	b

mimixbox paste #

Source: test/e2e/tools/mimixbox/textutils/paste.atago.yaml

Scenario: joins lines with a delimiter #

When #

printf 'a\nb\nc\n' | paste -s -d ,

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox rev #

Source: test/e2e/tools/mimixbox/textutils/rev.atago.yaml

Scenario: reverses the characters of a line #

When #

printf 'abc\n' | rev

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox sha1sum #

Source: test/e2e/tools/mimixbox/textutils/sha1sum.atago.yaml

Scenario: get sha1sum of one file #

Given #

  • Fixture file sha1sum/1.txt is created.

Inputs #

Fixture sha1sum/1.txt:

Dungeon of Regalias

When #

sha1sum ${workdir}/sha1sum/1.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

9dc2936d38932f9ffc6738cb677e4a8722116070  ${workdir}/sha1sum/1.txt

Scenario: cannot get sha1sum of one directory #

Given #

  • Fixture file sha1sum/1.txt is created.

Inputs #

Fixture sha1sum/1.txt:

Dungeon of Regalias

When #

sha1sum ${workdir}/sha1sum

Then #

  • exit code is not 0
  • stderr equals an exact value

Scenario: cannot get sha1sum of not exist file #

When #

sha1sum /not_exist_file

Then #

  • exit code is not 0
  • stderr equals an exact value

Scenario: get sha1sum of three files #

Given #

  • Fixture file sha1sum/1.txt is created.
  • Fixture file sha1sum/2.txt is created.
  • Fixture file sha1sum/3.txt is created.

Inputs #

Fixture sha1sum/1.txt:

Dungeon of Regalias

Fixture sha1sum/2.txt:

DEMONION

Fixture sha1sum/3.txt:

Dungeon Crusadearz

When #

sha1sum ${workdir}/sha1sum/1.txt ${workdir}/sha1sum/2.txt ${workdir}/sha1sum/3.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

9dc2936d38932f9ffc6738cb677e4a8722116070  ${workdir}/sha1sum/1.txt
317e30648976d62fae4662fe4435e6568648e8a7  ${workdir}/sha1sum/2.txt
d4e9619d949de0c0182a09757346ad22e80114b3  ${workdir}/sha1sum/3.txt

Scenario: check sha1sum with –check option #

Given #

  • Fixture file sha1sum/1.txt is created.
  • Fixture file sha1sum/2.txt is created.
  • Fixture file sha1sum/3.txt is created.
  • Fixture file sha1sum/checksum.txt is created.

Inputs #

Fixture sha1sum/1.txt:

Dungeon of Regalias

Fixture sha1sum/2.txt:

DEMONION

Fixture sha1sum/3.txt:

Dungeon Crusadearz

Fixture sha1sum/checksum.txt:

9dc2936d38932f9ffc6738cb677e4a8722116070  ${workdir}/sha1sum/1.txt
317e30648976d62fae4662fe4435e6568648e8a7  ${workdir}/sha1sum/2.txt
d4e9619d949de0c0182a09757346ad22e80114b3  ${workdir}/sha1sum/3.txt

When #

sha1sum -c ${workdir}/sha1sum/checksum.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

${workdir}/sha1sum/1.txt: OK
${workdir}/sha1sum/2.txt: OK
${workdir}/sha1sum/3.txt: OK

Scenario: get sha1sum for pipe data #

When #

echo "test" | sha1sum

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: get sha1sum for pipe data and file at same time #

Given #

  • Fixture file sha1sum/1.txt is created.

Inputs #

Fixture sha1sum/1.txt:

Dungeon of Regalias

When #

echo "test" | sha1sum ${workdir}/sha1sum/1.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

9dc2936d38932f9ffc6738cb677e4a8722116070  ${workdir}/sha1sum/1.txt

mimixbox sha256sum #

Source: test/e2e/tools/mimixbox/textutils/sha256sum.atago.yaml

Scenario: get sha256sum of one file #

Given #

  • Fixture file sha256sum/1.txt is created.

Inputs #

Fixture sha256sum/1.txt:

Dungeon of Regalias

When #

sha256sum ${workdir}/sha256sum/1.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

5f2864b5833190b07b0b95228682ff5ec43a13a2a3f31514c57d5c92aa3fb2e7  ${workdir}/sha256sum/1.txt

Scenario: cannot get sha256sum of one directory #

Given #

  • Fixture file sha256sum/1.txt is created.

Inputs #

Fixture sha256sum/1.txt:

Dungeon of Regalias

When #

sha256sum ${workdir}/sha256sum

Then #

  • exit code is not 0
  • stderr equals an exact value

Scenario: cannot get sha256sum of not exist file #

When #

sha256sum /not_exist_file

Then #

  • exit code is not 0
  • stderr equals an exact value

Scenario: get sha256sum of three files #

Given #

  • Fixture file sha256sum/1.txt is created.
  • Fixture file sha256sum/2.txt is created.
  • Fixture file sha256sum/3.txt is created.

Inputs #

Fixture sha256sum/1.txt:

Dungeon of Regalias

Fixture sha256sum/2.txt:

DEMONION

Fixture sha256sum/3.txt:

Dungeon Crusadearz

When #

sha256sum ${workdir}/sha256sum/1.txt ${workdir}/sha256sum/2.txt ${workdir}/sha256sum/3.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

5f2864b5833190b07b0b95228682ff5ec43a13a2a3f31514c57d5c92aa3fb2e7  ${workdir}/sha256sum/1.txt
833d8136112b60552a0f83165a2ebffeac4b0c0249480d651ea58b9073ec925b  ${workdir}/sha256sum/2.txt
8e774f75a5a23c83e6f7d5e92863a2615e0335e06aec18d9c3ec1c5315d1a777  ${workdir}/sha256sum/3.txt

Scenario: check sha256sum with –check option #

Given #

  • Fixture file sha256sum/1.txt is created.
  • Fixture file sha256sum/2.txt is created.
  • Fixture file sha256sum/3.txt is created.
  • Fixture file sha256sum/checksum.txt is created.

Inputs #

Fixture sha256sum/1.txt:

Dungeon of Regalias

Fixture sha256sum/2.txt:

DEMONION

Fixture sha256sum/3.txt:

Dungeon Crusadearz

Fixture sha256sum/checksum.txt:

5f2864b5833190b07b0b95228682ff5ec43a13a2a3f31514c57d5c92aa3fb2e7  ${workdir}/sha256sum/1.txt
833d8136112b60552a0f83165a2ebffeac4b0c0249480d651ea58b9073ec925b  ${workdir}/sha256sum/2.txt
8e774f75a5a23c83e6f7d5e92863a2615e0335e06aec18d9c3ec1c5315d1a777  ${workdir}/sha256sum/3.txt

When #

sha256sum -c ${workdir}/sha256sum/checksum.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

${workdir}/sha256sum/1.txt: OK
${workdir}/sha256sum/2.txt: OK
${workdir}/sha256sum/3.txt: OK

Scenario: get sha256sum for pipe data #

When #

echo "test" | sha256sum

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

f2ca1bb6c7e907d06dafe4687e579fce76b37e4e93b7605022da52e6ccc26fd2  -

Scenario: get sha256sum for pipe data and file at same time #

Given #

  • Fixture file sha256sum/1.txt is created.

Inputs #

Fixture sha256sum/1.txt:

Dungeon of Regalias

When #

echo "test" | sha256sum ${workdir}/sha256sum/1.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

5f2864b5833190b07b0b95228682ff5ec43a13a2a3f31514c57d5c92aa3fb2e7  ${workdir}/sha256sum/1.txt

mimixbox sha384sum #

Source: test/e2e/tools/mimixbox/textutils/sha384sum.atago.yaml

Scenario: describes itself with –help #

When #

sha384sum --help

Then #

  • exit code is 0
  • stdout contains Usage: sha384sum
  • stderr is empty

Scenario: prints the SHA-384 digest of stdin #

Inputs #

stdin for sha384sum:

hello

When #

sha384sum

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

1d0f284efe3edea4b9ca3bd514fa134b17eae361ccc7a1eefeff801b9bd6604e01f21f6bf249ef030599f0c218f2ba8c  -

mimixbox sha3sum #

Source: test/e2e/tools/mimixbox/textutils/sha3sum.atago.yaml

Scenario: defaults to SHA3-256 #

When #

printf 'hello\n' | sha3sum | cut -d' ' -f1

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

b314e28493eae9dab57ac4f0c6d887bddbbeb810e900d818395ace558e96516d

Scenario: selects SHA3-512 with -a #

When #

printf 'hello\n' | sha3sum -a 512 | cut -c1-16

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox sha512sum #

Source: test/e2e/tools/mimixbox/textutils/sha512sum.atago.yaml

Scenario: get sha512sum of one file #

Given #

  • Fixture file sha512sum/1.txt is created.

Inputs #

Fixture sha512sum/1.txt:

Dungeon of Regalias

When #

sha512sum ${workdir}/sha512sum/1.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

05eec7dcf412f63d5a291d019f6b3d62d4f8f5236592815ed171f7d6d0a7969f65a589a092740bd04a2f181d7d5a27ff36808e04a69bd84a854aad0a01da3612  ${workdir}/sha512sum/1.txt

Scenario: cannot get sha512sum of one directory #

Given #

  • Fixture file sha512sum/1.txt is created.

Inputs #

Fixture sha512sum/1.txt:

Dungeon of Regalias

When #

sha512sum ${workdir}/sha512sum

Then #

  • exit code is not 0
  • stderr equals an exact value

Scenario: cannot get sha512sum of not exist file #

When #

sha512sum /not_exist_file

Then #

  • exit code is not 0
  • stderr equals an exact value

Scenario: get sha512sum of three files #

Given #

  • Fixture file sha512sum/1.txt is created.
  • Fixture file sha512sum/2.txt is created.
  • Fixture file sha512sum/3.txt is created.

Inputs #

Fixture sha512sum/1.txt:

Dungeon of Regalias

Fixture sha512sum/2.txt:

DEMONION

Fixture sha512sum/3.txt:

Dungeon Crusadearz

When #

sha512sum ${workdir}/sha512sum/1.txt ${workdir}/sha512sum/2.txt ${workdir}/sha512sum/3.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

05eec7dcf412f63d5a291d019f6b3d62d4f8f5236592815ed171f7d6d0a7969f65a589a092740bd04a2f181d7d5a27ff36808e04a69bd84a854aad0a01da3612  ${workdir}/sha512sum/1.txt
cb2389a103184f607973b1acd073dc15310c8172b03f340a52bdc3843621cf9fbc6263c7dbbd786ceb0244f5147a83aa32ce09a485f544093b7fc5c7533e564f  ${workdir}/sha512sum/2.txt
3dafa5f1ec7f09cbe551dc0d4bdb153dedb81104b7e930b7c20733965f7ebb86ee2abea64b6bfa1c54045032865044a3feca5dcc89c28def410b2954094a1890  ${workdir}/sha512sum/3.txt

Scenario: check sha512sum with –check option #

Given #

  • Fixture file sha512sum/1.txt is created.
  • Fixture file sha512sum/2.txt is created.
  • Fixture file sha512sum/3.txt is created.
  • Fixture file sha512sum/checksum.txt is created.

Inputs #

Fixture sha512sum/1.txt:

Dungeon of Regalias

Fixture sha512sum/2.txt:

DEMONION

Fixture sha512sum/3.txt:

Dungeon Crusadearz

Fixture sha512sum/checksum.txt:

05eec7dcf412f63d5a291d019f6b3d62d4f8f5236592815ed171f7d6d0a7969f65a589a092740bd04a2f181d7d5a27ff36808e04a69bd84a854aad0a01da3612  ${workdir}/sha512sum/1.txt
cb2389a103184f607973b1acd073dc15310c8172b03f340a52bdc3843621cf9fbc6263c7dbbd786ceb0244f5147a83aa32ce09a485f544093b7fc5c7533e564f  ${workdir}/sha512sum/2.txt
3dafa5f1ec7f09cbe551dc0d4bdb153dedb81104b7e930b7c20733965f7ebb86ee2abea64b6bfa1c54045032865044a3feca5dcc89c28def410b2954094a1890  ${workdir}/sha512sum/3.txt

When #

sha512sum -c ${workdir}/sha512sum/checksum.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

${workdir}/sha512sum/1.txt: OK
${workdir}/sha512sum/2.txt: OK
${workdir}/sha512sum/3.txt: OK

Scenario: get sha512sum for pipe data #

When #

echo "test" | sha512sum

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

0e3e75234abc68f4378a86b3f4b32a198ba301845b0cd6e50106e874345700cc6663a86c1ea125dc5e92be17c98f9a0f85ca9d5f595db2012f7cc3571945c123  -

Scenario: get sha512sum for pipe data and file at same time #

Given #

  • Fixture file sha512sum/1.txt is created.

Inputs #

Fixture sha512sum/1.txt:

Dungeon of Regalias

When #

echo "test" | sha512sum ${workdir}/sha512sum/1.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

05eec7dcf412f63d5a291d019f6b3d62d4f8f5236592815ed171f7d6d0a7969f65a589a092740bd04a2f181d7d5a27ff36808e04a69bd84a854aad0a01da3612  ${workdir}/sha512sum/1.txt

mimixbox shuf #

Source: test/e2e/tools/mimixbox/textutils/shuf.atago.yaml

Scenario: shuffles a single-element range #

When #

shuf -i 1-1

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox split #

Source: test/e2e/tools/mimixbox/textutils/split.atago.yaml

Scenario: split input into files of N lines #

When #

printf '1\n2\n3\n' | split -l 2 - "${workdir}/part-"; cat "${workdir}/part-aa"

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

1
2

mimixbox split (GNU flags) #

Source: test/e2e/tools/mimixbox/textutils/split_gnu.atago.yaml

Scenario: use numeric suffixes with -d #

When #

printf '1\n2\n3\n4\n5\n' | split -l 2 -d - "${workdir}/num-"; ls "${workdir}"/num-* | sed "s#${workdir}/##" | sort | tr '\n' ' ' | sed 's/ $//'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: write expected content to the first numeric piece #

When #

printf '1\n2\n3\n4\n5\n' | split -l 2 -d - "${workdir}/num-"; cat "${workdir}/num-00"

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

1
2

Scenario: append an additional suffix to each name #

When #

printf '1\n2\n3\n' | split -l 2 --additional-suffix=.txt - "${workdir}/add-"; ls "${workdir}"/add-* | sed "s#${workdir}/##" | sort | tr '\n' ' ' | sed 's/ $//'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: honor a custom suffix length with -a #

When #

printf '1\n2\n' | split -l 1 -a 3 - "${workdir}/len-"; ls "${workdir}"/len-* | sed "s#${workdir}/##" | sort | tr '\n' ' ' | sed 's/ $//'

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox sqluv #

Source: test/e2e/tools/mimixbox/textutils/sqluv.atago.yaml

Scenario: print usage with –help and exit 0 #

When #

sqluv --help

Then #

  • exit code is 0
  • stdout contains Usage: sqluv, headless

Scenario: print the version and exit 0 #

When #

sqluv --version

Then #

  • exit code is 0
  • stdout contains sqluv (mimixbox)

Scenario: fail with a message when given no operand #

When #

sqluv

Then #

  • exit code is not 0
  • stderr contains sqluv

Scenario: query a CSV fixture in headless mode #

When #

dir=$(mktemp -d "${TMPDIR:-/tmp}/sqluv-it.XXXXXX")
printf 'id,name\n1,alice\n2,bob\n3,carol\n' > "$dir/data.csv"
sqluv "$dir/data.csv" \
    --history-file "$dir/history.log" \
    --output csv \
    --execute 'select name from data order by id limit 2'
rm -rf "$dir"

Then #

  • exit code is 0
  • stdout contains alice, bob

Scenario: query a SQLite-style table as JSON #

When #

dir=$(mktemp -d "${TMPDIR:-/tmp}/sqluv-it.XXXXXX")
printf 'title\ngo-in-action\nthe-go-programming-language\n' > "$dir/books.csv"
sqluv "$dir/books.csv" \
    --history-file "$dir/history.log" \
    --output json \
    --execute 'select title from books order by title'
rm -rf "$dir"

Then #

  • exit code is 0
  • stdout contains go-in-action

Scenario: fail deterministically on an unsupported S3 source #

When #

sqluv --execute 'select 1' 's3://bucket/data.csv'

Then #

  • exit code is not 0
  • stderr contains S3 sources are not migrated

mimixbox sqluv (compressed input) #

Source: test/e2e/tools/mimixbox/textutils/sqluv_compressed.atago.yaml

Scenario: query a gzip-compressed CSV fixture #

When #

dir=$(mktemp -d "${TMPDIR:-/tmp}/sqluv-it.XXXXXX")
printf 'id,name\n1,alice\n2,bob\n' | gzip -c > "$dir/data.csv.gz"
sqluv "$dir/data.csv.gz" \
    --history-file "$dir/history.log" \
    --output csv \
    --execute 'select count(*) as n from data'
rm -rf "$dir"

Then #

  • exit code is 0
  • stdout contains 2

mimixbox sqluv (history file) #

Source: test/e2e/tools/mimixbox/textutils/sqluv_history.atago.yaml

Scenario: write query history to the path given by –history-file #

When #

dir=$(mktemp -d "${TMPDIR:-/tmp}/sqluv-it.XXXXXX")
hist="$dir/sqluv-history.log"
printf 'id\n1\n2\n' > "$dir/nums.csv"
sqluv "$dir/nums.csv" --history-file "$hist" \
    --execute 'select count(*) from nums' >/dev/null
cat "$hist"
rm -rf "$dir"

Then #

  • exit code is 0
  • stdout contains select count(*) from nums

mimixbox sqluv (TUI smoke) #

Source: test/e2e/tools/mimixbox/textutils/sqluv_tui_smoke.atago.yaml

Scenario: render the minimal viewer and exit cleanly on quit #

When #

dir=$(mktemp -d "${TMPDIR:-/tmp}/sqluv-it.XXXXXX")
printf 'id,name\n1,alice\n' > "$dir/data.csv"
printf 'q\n' | sqluv "$dir/data.csv" --history-file "$dir/history.log"
rm -rf "$dir"

Then #

  • exit code is 0
  • stdout contains minimal viewer, bye

mimixbox strings #

Source: test/e2e/tools/mimixbox/textutils/strings.atago.yaml

Scenario: prints printable sequences #

When #

printf 'hi\000hello\000world' | strings

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

hello
world

mimixbox sum #

Source: test/e2e/tools/mimixbox/textutils/sum.atago.yaml

Scenario: describes itself with –help #

When #

sum --help

Then #

  • exit code is 0
  • stdout contains Usage: sum
  • stderr is empty

Scenario: documents its purpose in –help #

When #

sum --help

Then #

  • exit code is 0
  • stdout contains BSD algorithm

Scenario: prints a BSD checksum and block count for stdin #

Inputs #

stdin for sum:

hello

When #

sum

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox tac #

Source: test/e2e/tools/mimixbox/textutils/tac.atago.yaml

Scenario: print the lines in reverse order #

Given #

  • Fixture file tac.txt is created.

Inputs #

Fixture tac.txt:

first
second
third

When #

tac tac.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

third
second
first

Scenario: reverse standard input #

When #

printf 'a\nb\nc\n' | tac

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

c
b
a

Scenario: report an error for a non-existent file #

When #

tac /no_exist_file

Then #

  • exit code is not 0
  • stderr equals an exact value

mimixbox tail #

Source: test/e2e/tools/mimixbox/textutils/tail.atago.yaml

Scenario: print the last 10 lines #

Given #

  • Fixture file tail.txt is created.

Inputs #

Fixture tail.txt:

1
2
3
4
5
6
7
8
9
10
11
12

When #

tail tail.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

3
4
5
6
7
8
9
10
11
12

Scenario: print the last N lines #

Given #

  • Fixture file tail.txt is created.

Inputs #

Fixture tail.txt:

1
2
3
4
5
6
7
8
9
10
11
12

When #

tail -n 3 tail.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

10
11
12

Scenario: print the last N bytes #

When #

printf 'hello world' | tail -c 5

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: print the last N lines of stdin #

When #

printf 'a\nb\nc\nd\n' | tail -n 2

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

c
d

Scenario: report an error for a non-existent file #

When #

tail /no_exist_file

Then #

  • exit code is not 0
  • stderr equals an exact value

Scenario: print data appended while following #

Given #

  • Fixture file follow.txt is created.

Inputs #

Fixture follow.txt:

start

When #

( sleep 0.2; printf 'appended\n' >> follow.txt ) &
timeout 0.5 tail -f -s 0.05 follow.txt

Then #

  • exit code is not 0
  • stdout contains start, appended

mimixbox tail –pid #

Source: test/e2e/tools/mimixbox/textutils/tail_pid.atago.yaml

Scenario: stop following once the watched process exits #

Given #

  • Fixture file follow_pid.txt is created.

Inputs #

Fixture follow_pid.txt:

start

When #

sleep 1 &
sleeper_pid=$!
( sleep 0.2; printf 'appended\n' >> follow_pid.txt ) &
timeout 5 tail -f -s 0.1 --pid="${sleeper_pid}" follow_pid.txt

Then #

  • exit code is 0
  • stdout contains start, appended

mimixbox tail –zero-terminated #

Source: test/e2e/tools/mimixbox/textutils/tail_zero.atago.yaml

Scenario: prints the last NUL-delimited record, preserving the embedded newline #

When #

printf 'a\nb\0c\nd\0' | tail -z -n 1 | tr '\0' '|'

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

c
d|

Scenario: prints two NUL-delimited records with embedded newlines preserved #

When #

printf 'a\nb\0c\nd\0' | tail --zero-terminated -n 2 | tr '\0' '|'

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

a
b|c
d|

mimixbox tr #

Source: test/e2e/tools/mimixbox/textutils/tr.atago.yaml

Scenario: translates lowercase to uppercase #

When #

printf 'abc\n' | tr a-z A-Z

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox tr –truncate-set1 #

Source: test/e2e/tools/mimixbox/textutils/tr_truncate.atago.yaml

Scenario: truncates SET1 to SET2 length, leaving extra chars unchanged #

When #

printf 'abc\n' | tr --truncate-set1 abc xy

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: accepts the -t short form #

When #

printf 'abc\n' | tr -t abc xy

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox unexpand #

Source: test/e2e/tools/mimixbox/textutils/unexpand.atago.yaml

Scenario: convert leading spaces to a tab #

When #

printf '        a\n' | unexpand

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: convert internal space runs to tabs with –all #

When #

printf 'a        b\n' | unexpand -a

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: report an error for a non-existent file #

When #

unexpand /no_exist_file

Then #

  • exit code is not 0
  • stderr equals an exact value

mimixbox unix2dos #

Source: test/e2e/tools/mimixbox/textutils/unix2dos.atago.yaml

Scenario: convert an LF file to CRLF and reclassify it #

Given #

  • Fixture file unix2dos/1.txt is created.

Inputs #

Fixture unix2dos/1.txt:

abc
def
ghi

When #

unix2dos "${workdir}/unix2dos/1.txt"
file "${workdir}/unix2dos/1.txt"

Then #

  • stdout equals an exact value

Expected output #

expected stdout:

unix2dos: converting file ${workdir}/unix2dos/1.txt to DOS format...
${workdir}/unix2dos/1.txt: ASCII text, with CRLF line terminators

Scenario: convert an LF file and exit success #

Given #

  • Fixture file unix2dos/1.txt is created.

Inputs #

Fixture unix2dos/1.txt:

abc
def
ghi

When #

unix2dos "${workdir}/unix2dos/1.txt"

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

unix2dos: converting file ${workdir}/unix2dos/1.txt to DOS format...

Scenario: convert three LF files at once and reclassify each #

Given #

  • Fixture file unix2dos/1.txt is created.
  • Fixture file unix2dos/2.txt is created.
  • Fixture file unix2dos/3.txt is created.

Inputs #

Fixture unix2dos/1.txt:

abc
def
ghi

Fixture unix2dos/2.txt:

abc
def
ghi

Fixture unix2dos/3.txt:

abc
def
ghi

When #

unix2dos "${workdir}/unix2dos/1.txt" "${workdir}/unix2dos/2.txt" "${workdir}/unix2dos/3.txt"
file "${workdir}/unix2dos/1.txt"
file "${workdir}/unix2dos/2.txt"
file "${workdir}/unix2dos/3.txt"

Then #

  • stdout equals an exact value

Expected output #

expected stdout:

unix2dos: converting file ${workdir}/unix2dos/1.txt to DOS format...
unix2dos: converting file ${workdir}/unix2dos/2.txt to DOS format...
unix2dos: converting file ${workdir}/unix2dos/3.txt to DOS format...
${workdir}/unix2dos/1.txt: ASCII text, with CRLF line terminators
${workdir}/unix2dos/2.txt: ASCII text, with CRLF line terminators
${workdir}/unix2dos/3.txt: ASCII text, with CRLF line terminators

Scenario: convert three LF files at once and exit success #

Given #

  • Fixture file unix2dos/1.txt is created.
  • Fixture file unix2dos/2.txt is created.
  • Fixture file unix2dos/3.txt is created.

Inputs #

Fixture unix2dos/1.txt:

abc
def
ghi

Fixture unix2dos/2.txt:

abc
def
ghi

Fixture unix2dos/3.txt:

abc
def
ghi

When #

unix2dos "${workdir}/unix2dos/1.txt" "${workdir}/unix2dos/2.txt" "${workdir}/unix2dos/3.txt"

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

unix2dos: converting file ${workdir}/unix2dos/1.txt to DOS format...
unix2dos: converting file ${workdir}/unix2dos/2.txt to DOS format...
unix2dos: converting file ${workdir}/unix2dos/3.txt to DOS format...

Scenario: refuse a directory with a not-regular-file error #

Given #

  • Fixture file unix2dos/1.txt is created.

Inputs #

Fixture unix2dos/1.txt:

abc
def
ghi

When #

unix2dos ${workdir}/unix2dos

Then #

  • exit code is not 0
  • stderr equals an exact value

Scenario: convert the two files but fail on the directory operand #

Given #

  • Fixture file unix2dos/1.txt is created.
  • Fixture file unix2dos/3.txt is created.

Inputs #

Fixture unix2dos/1.txt:

abc
def
ghi

Fixture unix2dos/3.txt:

abc
def
ghi

When #

unix2dos ${workdir}/unix2dos/1.txt ${workdir}/unix2dos ${workdir}/unix2dos/3.txt

Then #

  • exit code is not 0
  • stdout equals an exact value
  • stderr equals an exact value

Expected output #

expected stdout:

unix2dos: converting file ${workdir}/unix2dos/1.txt to DOS format...
unix2dos: converting file ${workdir}/unix2dos/3.txt to DOS format...

mimixbox uuencode/uudecode/usleep #

Source: test/e2e/tools/mimixbox/textutils/uucode.atago.yaml

Scenario: uuencode then uudecode round-trips (traditional) #

When #

d=$(mktemp -d); printf 'round trip data\n' > "$d/in"
uuencode "$d/in" out | uudecode -o -
rm -rf "$d"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: uuencode -m then uudecode round-trips (base64) #

When #

d=$(mktemp -d); printf 'base64 round trip\n' > "$d/in"
uuencode -m "$d/in" out | uudecode -o -
rm -rf "$d"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: usleep waits and exits 0 #

When #

usleep 1000 && echo slept

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox uudecode #

Source: test/e2e/tools/mimixbox/textutils/uudecode.atago.yaml

Scenario: describes itself with –help #

When #

uudecode --help

Then #

  • exit code is 0
  • stdout contains Usage: uudecode
  • stderr is empty

mimixbox uuencode #

Source: test/e2e/tools/mimixbox/textutils/uuencode.atago.yaml

Scenario: describes itself with –help #

When #

uuencode --help

Then #

  • exit code is 0
  • stdout contains Usage: uuencode
  • stderr is empty

Scenario: uuencodes stdin with a begin header #

Inputs #

stdin for uuencode:

hello

When #

uuencode hi.txt

Then #

  • exit code is 0
  • stdout contains begin 644 hi.txt, end

mimixbox wc #

Source: test/e2e/tools/mimixbox/textutils/wc.atago.yaml

Scenario: count lines/words/bytes of one file #

Given #

  • Fixture file game.txt is created.

Inputs #

Fixture game.txt:

NieR Replicant ver.1.22474487139...
NieR:Automata
The Legend of Zelda: Majora's Mask
KICHIKUOU RANCE
DARK SOULS
SHADOW HEARTS

When #

wc game.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: count only lines with –lines #

Given #

  • Fixture file game.txt is created.

Inputs #

Fixture game.txt:

NieR Replicant ver.1.22474487139...
NieR:Automata
The Legend of Zelda: Majora's Mask
KICHIKUOU RANCE
DARK SOULS
SHADOW HEARTS

When #

wc -l game.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: count only bytes with –bytes #

Given #

  • Fixture file game.txt is created.

Inputs #

Fixture game.txt:

NieR Replicant ver.1.22474487139...
NieR:Automata
The Legend of Zelda: Majora's Mask
KICHIKUOU RANCE
DARK SOULS
SHADOW HEARTS

When #

wc -c game.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: report the longest line with –max-line-length #

Given #

  • Fixture file game.txt is created.

Inputs #

Fixture game.txt:

NieR Replicant ver.1.22474487139...
NieR:Automata
The Legend of Zelda: Majora's Mask
KICHIKUOU RANCE
DARK SOULS
SHADOW HEARTS

When #

wc -L game.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: count an empty file as all zeros #

Given #

  • Fixture file empty.txt is created.

When #

wc empty.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: count three files and print a total #

Given #

  • Fixture file empty.txt is created.
  • Fixture file game.txt is created.
  • Fixture file metal.txt is created.

Inputs #

Fixture game.txt:

NieR Replicant ver.1.22474487139...
NieR:Automata
The Legend of Zelda: Majora's Mask
KICHIKUOU RANCE
DARK SOULS
SHADOW HEARTS

Fixture metal.txt:

MEGADETH
GALNERYUS
SYSTEM OF A DOWN

When #

wc empty.txt game.txt metal.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

  0   0   0 empty.txt
  6  16 126 game.txt
  3   6  36 metal.txt
  9  22 162 total

Scenario: count piped data #

When #

echo "${workdir}/game.txt" | wc

Then #

  • exit code is 0
  • stdout matches /1 +1 +[0-9]+/

Scenario: count only the file operand, ignoring pipe data #

Given #

  • Fixture file game.txt is created.

Inputs #

Fixture game.txt:

NieR Replicant ver.1.22474487139...
NieR:Automata
The Legend of Zelda: Majora's Mask
KICHIKUOU RANCE
DARK SOULS
SHADOW HEARTS

When #

echo "${workdir}/game.txt" | wc game.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: report a directory as not a regular file #

When #

wc "${workdir}"

Then #

  • exit code is not 0
  • stdout equals an exact value
  • stderr equals an exact value

Scenario: count the file but zero the directory when given both #

Given #

  • Fixture file game.txt is created.

Inputs #

Fixture game.txt:

NieR Replicant ver.1.22474487139...
NieR:Automata
The Legend of Zelda: Majora's Mask
KICHIKUOU RANCE
DARK SOULS
SHADOW HEARTS

When #

wc "${workdir}" "${workdir}/game.txt"

Then #

  • exit code is not 0
  • stdout equals an exact value
  • stderr equals an exact value

Expected output #

expected stdout:

      0       0       0 ${workdir}
      6      16     126 ${workdir}/game.txt
      6      16     126 total

Scenario: count a single line piped in with –lines #

When #

echo "no_exist_file" | wc -l

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox wc (GNU flags) #

Source: test/e2e/tools/mimixbox/textutils/wc_gnu.atago.yaml

Scenario: print only the combined total with –total=only #

Given #

  • Fixture file wc_a.txt is created.
  • Fixture file wc_b.txt is created.

Inputs #

Fixture wc_a.txt:

a
b
c

Fixture wc_b.txt:

x

When #

wc --total=only wc_a.txt wc_b.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: suppress the total line with –total=never #

Given #

  • Fixture file wc_a.txt is created.
  • Fixture file wc_b.txt is created.

Inputs #

Fixture wc_a.txt:

a
b
c

Fixture wc_b.txt:

x

When #

wc --total=never "${workdir}/wc_a.txt" "${workdir}/wc_b.txt"

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

3 3 6 ${workdir}/wc_a.txt
1 1 2 ${workdir}/wc_b.txt

Scenario: print a total even for one file with –total=always #

Given #

  • Fixture file wc_a.txt is created.

Inputs #

Fixture wc_a.txt:

a
b
c

When #

wc --total=always "${workdir}/wc_a.txt"

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

3 3 6 ${workdir}/wc_a.txt
3 3 6 total

Scenario: read a NUL-separated name list with –files0-from #

Given #

  • Fixture file wc_a.txt is created.
  • Fixture file wc_b.txt is created.

Inputs #

Fixture wc_a.txt:

a
b
c

Fixture wc_b.txt:

x

When #

printf '%s\0%s\0' "${workdir}/wc_a.txt" "${workdir}/wc_b.txt" > wc_list.nul
wc --files0-from=wc_list.nul

Then #

  • after wc --files0-from=wc_list.nul:
    • exit code is 0
    • stdout equals an exact value

Expected output #

expected stdout:

3 3 6 ${workdir}/wc_a.txt
1 1 2 ${workdir}/wc_b.txt
4 4 8 total

Scenario: read the name list from standard input with –files0-from=- #

Given #

  • Fixture file wc_a.txt is created.
  • Fixture file wc_b.txt is created.

Inputs #

Fixture wc_a.txt:

a
b
c

Fixture wc_b.txt:

x

When #

printf '%s\0%s\0' "${workdir}/wc_a.txt" "${workdir}/wc_b.txt" | wc --files0-from=-

Then #

  • exit code is 0
  • stdout equals an exact value

Expected output #

expected stdout:

3 3 6 ${workdir}/wc_a.txt
1 1 2 ${workdir}/wc_b.txt
4 4 8 total

Scenario: combine –files0-from with –total=only #

Given #

  • Fixture file wc_a.txt is created.
  • Fixture file wc_b.txt is created.

Inputs #

Fixture wc_a.txt:

a
b
c

Fixture wc_b.txt:

x

When #

printf '%s\0%s\0' "${workdir}/wc_a.txt" "${workdir}/wc_b.txt" > wc_list.nul
wc --files0-from=wc_list.nul --total=only

Then #

  • after wc --files0-from=wc_list.nul --total=only:
    • exit code is 0
    • stdout equals an exact value

mimixbox xxd #

Source: test/e2e/tools/mimixbox/textutils/xxd.atago.yaml

Scenario: prints a hex dump #

When #

printf 'hello\n' | xxd

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: reverses a hex dump #

When #

printf 'hello\n' | xxd | xxd -r

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox blkdiscard #

Source: test/e2e/tools/mimixbox/util-linux/blkdiscard.atago.yaml

Scenario: requires a device #

When #

blkdiscard

Then #

  • exit code is not 0

Scenario: describes itself with –help #

When #

blkdiscard --help

Then #

  • exit code is 0
  • stdout contains Usage: blkdiscard, Discard

mimixbox blkid #

Source: test/e2e/tools/mimixbox/util-linux/blkid.atago.yaml

Scenario: identifies an ext filesystem #

When #

dd if=/dev/zero of=ext.img bs=1024 count=2 2>/dev/null; printf '\123\357' | dd of=ext.img bs=1 seek=1080 conv=notrunc 2>/dev/null; blkid ext.img

Then #

  • exit code is 0
  • stdout contains TYPE="ext2"

Scenario: identifies an xfs filesystem #

When #

printf 'XFSB' > xfs.img; blkid xfs.img

Then #

  • exit code is 0
  • stdout contains TYPE="xfs"

Scenario: exits 2 when nothing is identified #

When #

printf 'nothing here' > blank.img; blkid blank.img

Then #

  • exit code is 2

mimixbox blockdev #

Source: test/e2e/tools/mimixbox/util-linux/blockdev.atago.yaml

Scenario: describes itself with –help #

When #

blockdev --help

Then #

  • exit code is 0
  • stdout contains Usage: blockdev, DEVICE

Scenario: fails when no query flag is given #

When #

blockdev /dev/null

Then #

  • exit code is not 0

mimixbox chattr #

Source: test/e2e/tools/mimixbox/util-linux/chattr.atago.yaml

Scenario: rejects a malformed mode #

When #

chattr xi /tmp/f

Then #

  • exit code is not 0

Scenario: rejects an unknown attribute #

When #

chattr +Z /tmp/f

Then #

  • exit code is not 0

mimixbox chrt #

Source: test/e2e/tools/mimixbox/util-linux/chrt.atago.yaml

Scenario: prints a process scheduling policy #

When #

chrt -p $$ | grep -c 'scheduling policy'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: runs a command under a scheduling policy #

When #

chrt -o 0 -- echo scheduled

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox dmesg #

Source: test/e2e/tools/mimixbox/util-linux/dmesg.atago.yaml

Scenario: describes itself with –help #

When #

dmesg --help

Then #

  • exit code is 0
  • stdout contains Usage: dmesg, kernel ring buffer

mimixbox eject #

Source: test/e2e/tools/mimixbox/util-linux/eject.atago.yaml

Scenario: describes itself with –help #

When #

eject --help

Then #

  • exit code is 0
  • stdout contains Usage: eject, media

Scenario: fails on a missing device #

When #

eject /dev/no_such_cdrom

Then #

  • exit code is not 0

mimixbox fallocate #

Source: test/e2e/tools/mimixbox/util-linux/fallocate.atago.yaml

Scenario: describes itself with –help #

When #

fallocate --help

Then #

  • exit code is 0
  • stdout contains Usage: fallocate
  • stderr is empty

mimixbox fatattr #

Source: test/e2e/tools/mimixbox/util-linux/fatattr.atago.yaml

Scenario: requires a file #

When #

fatattr

Then #

  • exit code is not 0

Scenario: rejects an unknown attribute #

When #

fatattr +Z /tmp/x

Then #

  • exit code is not 0

mimixbox fbset #

Source: test/e2e/tools/mimixbox/util-linux/fbset.atago.yaml

Scenario: fails on a missing framebuffer #

When #

fbset -fb /dev/no_such_fb

Then #

  • exit code is not 0

Scenario: describes itself with –help #

When #

fbset --help

Then #

  • exit code is 0
  • stdout contains Usage: fbset, framebuffer

mimixbox fdflush #

Source: test/e2e/tools/mimixbox/util-linux/fdflush.atago.yaml

Scenario: requires a device #

When #

fdflush

Then #

  • exit code is not 0

Scenario: describes itself with –help #

When #

fdflush --help

Then #

  • exit code is 0
  • stdout contains Usage: fdflush, floppy

mimixbox fdformat #

Source: test/e2e/tools/mimixbox/util-linux/fdformat.atago.yaml

Scenario: requires a device #

When #

fdformat

Then #

  • exit code is not 0

Scenario: describes itself with –help #

When #

fdformat --help

Then #

  • exit code is 0
  • stdout contains Usage: fdformat, floppy

mimixbox fdisk #

Source: test/e2e/tools/mimixbox/util-linux/fdisk.atago.yaml

Scenario: lists an MBR Linux partition #

When #

dd if=/dev/zero of=disk.img bs=512 count=1 2>/dev/null; printf '\203' | dd of=disk.img bs=1 seek=450 count=1 conv=notrunc 2>/dev/null; printf '\000\010\000\000' | dd of=disk.img bs=1 seek=454 count=4 conv=notrunc 2>/dev/null; printf '\144\000\000\000' | dd of=disk.img bs=1 seek=458 count=4 conv=notrunc 2>/dev/null; printf '\125\252' | dd of=disk.img bs=1 seek=510 count=2 conv=notrunc 2>/dev/null; fdisk -l disk.img | grep -c 'Linux'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: rejects an image without an MBR signature #

When #

dd if=/dev/zero of=n.img bs=512 count=1 2>/dev/null; fdisk -l n.img

Then #

  • exit code is not 0

mimixbox findfs #

Source: test/e2e/tools/mimixbox/util-linux/findfs.atago.yaml

Scenario: fails for an unknown label #

When #

findfs LABEL=no_such_label_xyz

Then #

  • exit code is not 0

Scenario: rejects a malformed tag #

When #

findfs notatag

Then #

  • exit code is not 0

mimixbox flock #

Source: test/e2e/tools/mimixbox/util-linux/flock.atago.yaml

Scenario: runs a command while holding the lock #

When #

flock lock echo locked-run

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: fails -n when the lock is already held #

When #

flock lock sleep 1 & sleep 0.2; flock -n lock echo nope

Then #

  • exit code is not 0

mimixbox freeramdisk #

Source: test/e2e/tools/mimixbox/util-linux/freeramdisk.atago.yaml

Scenario: requires a device #

When #

freeramdisk

Then #

  • exit code is not 0

Scenario: describes itself with –help #

When #

freeramdisk --help

Then #

  • exit code is 0
  • stdout contains Usage: freeramdisk, ramdisk

mimixbox fsck #

Source: test/e2e/tools/mimixbox/util-linux/fsck.atago.yaml

Scenario: detects a Minix filesystem #

When #

dd if=/dev/zero of=m.img bs=1024 count=2048 2>/dev/null; mkfs.minix m.img >/dev/null; fsck m.img

Then #

  • exit code is 0
  • stdout contains minix

Scenario: fails on an unrecognized image #

When #

dd if=/dev/zero of=u.img bs=1024 count=8 2>/dev/null; fsck u.img

Then #

  • exit code is not 0

mimixbox fsck.minix #

Source: test/e2e/tools/mimixbox/util-linux/fsck.minix.atago.yaml

Scenario: describes itself with –help #

When #

fsck.minix --help

Then #

  • exit code is 0
  • stdout contains Usage: fsck.minix
  • stderr is empty

mimixbox fsck.minix #

Source: test/e2e/tools/mimixbox/util-linux/fsck_minix.atago.yaml

Scenario: validates a freshly made Minix filesystem #

When #

dd if=/dev/zero of=f.img bs=1024 count=2048 2>/dev/null; mkfs.minix f.img >/dev/null; fsck.minix f.img | sed -n '1p'

Then #

  • exit code is 0
  • stdout contains Minix v1

Scenario: rejects a non-Minix image #

When #

dd if=/dev/zero of=b.img bs=1024 count=4 2>/dev/null; fsck.minix b.img

Then #

  • exit code is not 0

mimixbox fsfreeze #

Source: test/e2e/tools/mimixbox/util-linux/fsfreeze.atago.yaml

Scenario: requires a freeze or unfreeze mode #

When #

fsfreeze /mnt

Then #

  • exit code is not 0

Scenario: rejects both modes at once #

When #

fsfreeze -f -u /mnt

Then #

  • exit code is not 0

mimixbox fstrim #

Source: test/e2e/tools/mimixbox/util-linux/fstrim.atago.yaml

Scenario: requires a mount point #

When #

fstrim

Then #

  • exit code is not 0

Scenario: describes itself with –help #

When #

fstrim --help

Then #

  • exit code is 0
  • stdout contains Usage: fstrim, Discard

mimixbox getopt #

Source: test/e2e/tools/mimixbox/util-linux/getopt.atago.yaml

Scenario: normalizes short and long options with quoted args #

When #

getopt -o ab: --long alpha,beta: -- -a -b val --alpha pos

Then #

  • exit code is 0
  • stdout contains -b 'val', --alpha, -- 'pos'

Scenario: produces output a script can eval #

When #

eval set -- "$(getopt -o n: -- -n hello world)"; printf '%s|' "$@"

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox hd #

Source: test/e2e/tools/mimixbox/util-linux/hd.atago.yaml

Scenario: describes itself with –help #

When #

hd --help

Then #

  • exit code is 0
  • stdout contains Usage: hd
  • stderr is empty

Scenario: hexdumps stdin in canonical form #

Inputs #

stdin for hd:

hi

When #

hd

Then #

  • exit code is 0
  • stdout contains 68 69 0a, |hi.|

mimixbox util-linux –help helpers #

Source: test/e2e/tools/mimixbox/util-linux/help_helpers_util-linux.atago.yaml

Scenario: fallocate –help is structured #

When #

env -- fallocate --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: fsck.minix –help is structured #

When #

env -- fsck.minix --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: linux32 –help is structured #

When #

env -- linux32 --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: linux64 –help is structured #

When #

env -- linux64 --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: mkdosfs –help is structured #

When #

env -- mkdosfs --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: mkfs.ext2 –help is structured #

When #

env -- mkfs.ext2 --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: mkfs.minix –help is structured #

When #

env -- mkfs.minix --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: mkfs.reiser –help is structured #

When #

env -- mkfs.reiser --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: mkfs.vfat –help is structured #

When #

env -- mkfs.vfat --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: scriptreplay –help is structured #

When #

env -- scriptreplay --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: setsid –help is structured #

When #

env -- setsid --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: sh –help is structured #

When #

env -- sh --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: swapoff –help is structured #

When #

env -- swapoff --help

Then #

  • exit code is 0
  • stdout contains Usage:

Scenario: swapon –help is structured #

When #

env -- swapon --help

Then #

  • exit code is 0
  • stdout contains Usage:

mimixbox hexdump / hd #

Source: test/e2e/tools/mimixbox/util-linux/hexdump.atago.yaml

Scenario: hd shows the canonical hex+ASCII layout #

When #

printf 'hello world\n' | hd

Then #

  • exit code is 0
  • stdout contains 00000000 68 65 6c 6c 6f 20 77 6f 72 6c 64 0a, |hello world.|

Scenario: hexdump -C matches hd #

When #

printf 'hello world\n' | hexdump -C

Then #

  • exit code is 0
  • stdout contains |hello world.|

Scenario: hexdump default shows two-byte words #

When #

printf 'hello world\n' | hexdump

Then #

  • exit code is 0
  • stdout contains 6568 6c6c 206f

mimixbox hwclock #

Source: test/e2e/tools/mimixbox/util-linux/hwclock.atago.yaml

Scenario: describes itself with –help #

When #

hwclock --help

Then #

  • exit code is 0
  • stdout contains Usage: hwclock, RTC

mimixbox ionice #

Source: test/e2e/tools/mimixbox/util-linux/ionice.atago.yaml

Scenario: prints a process I/O class #

When #

ionice -p $$ | grep -cE 'prio|idle'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: runs a command at a given I/O class #

When #

ionice -c 3 -- echo idled

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox ipcrm #

Source: test/e2e/tools/mimixbox/util-linux/ipcrm.atago.yaml

Scenario: fails when nothing is requested #

When #

ipcrm

Then #

  • exit code is not 0

Scenario: fails to remove a non-existent id #

When #

ipcrm -q 2147483647

Then #

  • exit code is not 0

mimixbox ipcs #

Source: test/e2e/tools/mimixbox/util-linux/ipcs.atago.yaml

Scenario: shows the IPC facility sections #

When #

ipcs | grep -c 'Message Queues'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: limits to shared memory with -m #

When #

ipcs -m

Then #

  • exit code is 0
  • stdout contains Shared Memory Segments
  • stdout does not contain Message Queues

mimixbox last #

Source: test/e2e/tools/mimixbox/util-linux/last.atago.yaml

Scenario: treats an empty wtmp as no history and exits 0 #

When #

out=$(last /dev/null); echo "[$out] rc=$?"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: fails on a missing wtmp file #

When #

last /no/such/mimixbox/wtmp

Then #

  • exit code is not 0

mimixbox losetup #

Source: test/e2e/tools/mimixbox/util-linux/losetup.atago.yaml

Scenario: lists active loop devices cleanly #

When #

losetup -a >/dev/null

Then #

  • exit code is 0

Scenario: refuses to associate a loop device #

When #

losetup /dev/loop0 /tmp/img

Then #

  • exit code is not 0

mimixbox lsattr #

Source: test/e2e/tools/mimixbox/util-linux/lsattr.atago.yaml

Scenario: describes itself with –help #

When #

lsattr --help

Then #

  • exit code is 0
  • stdout contains Usage: lsattr, attribute

mimixbox lsblk #

Source: test/e2e/tools/mimixbox/util-linux/lsblk.atago.yaml

Scenario: prints the column header #

When #

lsblk | sed -n '1p'

Then #

  • exit code is 0
  • stdout contains NAME, SIZE, TYPE

Scenario: runs and exits successfully #

When #

lsblk >/dev/null 2>&1

Then #

  • exit code is 0

mimixbox lspci #

Source: test/e2e/tools/mimixbox/util-linux/lspci.atago.yaml

Scenario: lists PCI devices and exits successfully #

When #

lspci

Then #

  • exit code is 0

mimixbox lsusb #

Source: test/e2e/tools/mimixbox/util-linux/lsusb.atago.yaml

Scenario: describes itself with –help #

When #

lsusb --help

Then #

  • exit code is 0
  • stdout contains Usage: lsusb, USB

mimixbox mdev #

Source: test/e2e/tools/mimixbox/util-linux/mdev.atago.yaml

Scenario: requires scan mode #

When #

mdev

Then #

  • exit code is not 0

Scenario: describes itself with –help #

When #

mdev --help

Then #

  • exit code is 0
  • stdout contains Usage: mdev, device

mimixbox mesg #

Source: test/e2e/tools/mimixbox/util-linux/mesg.atago.yaml

Scenario: reports an error when stdin is not a terminal #

When #

mesg

Then #

  • exit code is 2
  • stderr contains cannot get terminal name

mimixbox mke2fs / mkfs.ext2 #

Source: test/e2e/tools/mimixbox/util-linux/mke2fs.atago.yaml

Scenario: writes the ext2 magic #

When #

dd if=/dev/zero of=e.img bs=1024 count=1024 2>/dev/null; mke2fs e.img >/dev/null; dd if=e.img bs=1 skip=1080 count=2 2>/dev/null | od -An -tx1 | tr -d ' \n'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: mkfs.ext2 refuses an oversized image #

When #

dd if=/dev/zero of=b.img bs=1024 count=10000 2>/dev/null
mkfs.ext2 b.img

Then #

  • after mkfs.ext2 b.img:
    • exit code is not 0

mimixbox mkfs.minix #

Source: test/e2e/tools/mimixbox/util-linux/mkfs_minix.atago.yaml

Scenario: writes the Minix v1 magic #

When #

dd if=/dev/zero of=m.img bs=1024 count=2048 2>/dev/null; mkfs.minix m.img >/dev/null; dd if=m.img bs=1 skip=1040 count=2 2>/dev/null | od -An -tx1 | tr -d ' \n'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: refuses a too-small device #

When #

dd if=/dev/zero of=s.img bs=1024 count=4 2>/dev/null
mkfs.minix s.img

Then #

  • after mkfs.minix s.img:
    • exit code is not 0

mimixbox mkfs.reiser #

Source: test/e2e/tools/mimixbox/util-linux/mkfs_reiser.atago.yaml

Scenario: refuses deterministically #

When #

mkfs.reiser /tmp/x.img

Then #

  • exit code is not 0

Scenario: explains that ReiserFS is deprecated #

When #

mkfs.reiser /tmp/x.img

Then #

  • exit code is not 0
  • stderr contains deprecated

mimixbox mkfs.vfat / mkdosfs #

Source: test/e2e/tools/mimixbox/util-linux/mkfs_vfat.atago.yaml

Scenario: writes the FAT16 type label #

When #

dd if=/dev/zero of=v.img bs=1024 count=8192 2>/dev/null; mkfs.vfat v.img >/dev/null; dd if=v.img bs=1 skip=54 count=5 2>/dev/null

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: mkdosfs refuses a too-small image #

When #

dd if=/dev/zero of=s.img bs=1024 count=512 2>/dev/null
mkdosfs s.img

Then #

  • after mkdosfs s.img:
    • exit code is not 0

mimixbox mkswap #

Source: test/e2e/tools/mimixbox/util-linux/mkswap.atago.yaml

Scenario: formats an image as swap #

When #

dd if=/dev/zero of=swap.img bs=1024 count=64 2>/dev/null; chmod 0600 swap.img; mkswap swap.img

Then #

  • exit code is 0
  • stdout contains version 1

Scenario: writes the swap signature #

When #

dd if=/dev/zero of=swap2.img bs=1024 count=64 2>/dev/null; chmod 0600 swap2.img; mkswap swap2.img >/dev/null; od -c swap2.img | grep -c 'S   W   A   P   S   P   A   C   E   2'

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox mount #

Source: test/e2e/tools/mimixbox/util-linux/mount.atago.yaml

Scenario: lists the root filesystem #

When #

mount | grep -cE ' on / type '

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: refuses to perform a mount #

When #

mount /dev/sda1 /mnt

Then #

  • exit code is not 0

mimixbox nsenter #

Source: test/e2e/tools/mimixbox/util-linux/nsenter.atago.yaml

Scenario: requires a target PID #

When #

nsenter -n echo x

Then #

  • exit code is not 0

Scenario: requires a namespace flag #

When #

nsenter -t 1 echo x

Then #

  • exit code is not 0

mimixbox pivot_root #

Source: test/e2e/tools/mimixbox/util-linux/pivot_root.atago.yaml

Scenario: requires two directories #

When #

pivot_root /onlyone

Then #

  • exit code is not 0

Scenario: describes itself with –help #

When #

pivot_root --help

Then #

  • exit code is 0
  • stdout contains Usage: pivot_root, root

mimixbox rdate #

Source: test/e2e/tools/mimixbox/util-linux/rdate.atago.yaml

Scenario: fails when no host is given #

When #

rdate

Then #

  • exit code is not 0

Scenario: fails when the host has no time service #

When #

rdate 127.0.0.1

Then #

  • exit code is not 0

mimixbox rdev #

Source: test/e2e/tools/mimixbox/util-linux/rdev.atago.yaml

Scenario: prints the root device with the / mountpoint #

When #

rdev

Then #

  • exit code is 0
  • stdout contains /

mimixbox readprofile #

Source: test/e2e/tools/mimixbox/util-linux/readprofile.atago.yaml

Scenario: describes itself with –help #

When #

readprofile --help

Then #

  • exit code is 0
  • stdout contains Usage: readprofile, profiling

mimixbox renice #

Source: test/e2e/tools/mimixbox/util-linux/renice.atago.yaml

Scenario: reports the priority change #

When #

renice -n 0 -p $$ | grep -c 'process ID'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: rejects a non-numeric PID #

When #

renice 5 notapid

Then #

  • exit code is not 0

mimixbox rtcwake #

Source: test/e2e/tools/mimixbox/util-linux/rtcwake.atago.yaml

Scenario: rejects a suspend mode #

When #

rtcwake -m mem -s 10

Then #

  • exit code is not 0

Scenario: requires a wake time #

When #

rtcwake -m no

Then #

  • exit code is not 0

mimixbox script / scriptreplay #

Source: test/e2e/tools/mimixbox/util-linux/script.atago.yaml

Scenario: records command output to a typescript #

When #

script -c 'printf recorded' -T timing out.txt >/dev/null 2>&1; grep -c 'Script started' out.txt

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: replays a recorded typescript #

When #

script -c 'printf replayed' -T timing out.txt >/dev/null 2>&1; scriptreplay timing out.txt

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox script / scriptreplay round-trip #

Source: test/e2e/tools/mimixbox/util-linux/script_roundtrip.atago.yaml

Scenario: records the transcript framing #

When #

script -c 'printf "hello\nworld\n"' -T timing transcript >/dev/null 2>&1; cat transcript

Then #

  • exit code is 0
  • stdout contains Script started, Script done

Scenario: records the command payload in the transcript #

When #

script -c 'printf "hello\nworld\n"' -T timing transcript >/dev/null 2>&1; cat transcript

Then #

  • exit code is 0
  • stdout contains hello, world

Scenario: writes a timing file of “delay bytes” records #

When #

script -c 'printf "hello\nworld\n"' -T timing transcript >/dev/null 2>&1; awk 'NF && $1 ~ /^[0-9]+\.[0-9]+$/ && $2 ~ /^[0-9]+$/ { ok++ } END { exit !(NR>0 && ok==NR) }' timing

Then #

  • exit code is 0

Scenario: replays the captured payload from the timing + transcript #

When #

script -c 'printf "hello\nworld\n"' -T timing transcript >/dev/null 2>&1; scriptreplay timing transcript

Then #

  • exit code is 0
  • stdout contains hello, world

mimixbox scriptreplay #

Source: test/e2e/tools/mimixbox/util-linux/scriptreplay.atago.yaml

Scenario: describes itself with –help #

When #

scriptreplay --help

Then #

  • exit code is 0
  • stdout contains Usage: scriptreplay
  • stderr is empty

mimixbox setarch / linux32 / linux64 #

Source: test/e2e/tools/mimixbox/util-linux/setarch.atago.yaml

Scenario: linux32 makes uname report a 32-bit machine #

When #

linux32 uname -m

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: linux64 reports the native machine #

When #

linux64 uname -m

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: linux32 passes the command output through #

When #

linux32 echo passed

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: setarch selects the personality from ARCH #

When #

setarch i686 uname -m

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox setpriv #

Source: test/e2e/tools/mimixbox/util-linux/setpriv.atago.yaml

Scenario: dumps the current privileges #

When #

setpriv --dump | grep -cE 'uid:|no_new_privs:'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: runs a command with –no-new-privs #

When #

setpriv --no-new-privs -- echo ran

Then #

  • exit code is 0
  • stdout equals an exact value

mimixbox setsid #

Source: test/e2e/tools/mimixbox/util-linux/setsid.atago.yaml

Scenario: describes itself with –help #

When #

setsid --help

Then #

  • exit code is 0
  • stdout contains Usage: setsid
  • stderr is empty

mimixbox setsid / fallocate #

Source: test/e2e/tools/mimixbox/util-linux/setsid_fallocate.atago.yaml

Scenario: setsid runs a program in a new session #

When #

setsid echo "session ok"

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: fallocate sizes a file to the requested length #

When #

fallocate -l 4096 f
wc -c < f

Then #

  • after fallocate -l 4096 f:
    • exit code is 0
  • after wc -c < f:
    • stdout contains 4096

Scenario: fallocate without -l fails #

When #

fallocate x

Then #

  • exit code is not 0

mimixbox swapon / swapoff #

Source: test/e2e/tools/mimixbox/util-linux/swap.atago.yaml

Scenario: swapon -s prints the swaps header #

When #

swapon -s | sed -n '1p' | grep -c 'Filename'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: swapoff requires a target #

When #

swapoff

Then #

  • exit code is not 0

mimixbox swapoff #

Source: test/e2e/tools/mimixbox/util-linux/swapoff.atago.yaml

Scenario: describes itself with –help #

When #

swapoff --help

Then #

  • exit code is 0
  • stdout contains Usage: swapoff
  • stderr is empty

mimixbox swapon #

Source: test/e2e/tools/mimixbox/util-linux/swapon.atago.yaml

Scenario: describes itself with –help #

When #

swapon --help

Then #

  • exit code is 0
  • stdout contains Usage: swapon
  • stderr is empty

mimixbox switch_root #

Source: test/e2e/tools/mimixbox/util-linux/switch_root.atago.yaml

Scenario: requires NEW_ROOT and INIT #

When #

switch_root /tmp

Then #

  • exit code is not 0

Scenario: rejects a non-directory NEW_ROOT #

When #

switch_root /no/such/dir /init

Then #

  • exit code is not 0

mimixbox taskset #

Source: test/e2e/tools/mimixbox/util-linux/taskset.atago.yaml

Scenario: prints a process affinity mask #

When #

taskset -p $$ | grep -c 'affinity mask'

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: runs a command bound to a CPU #

When #

taskset -c 0 echo affined

Then #

  • exit code is 0
  • stdout equals an exact value

Scenario: rejects an invalid mask #

When #

taskset zzz echo x

Then #

  • exit code is not 0

mimixbox tune2fs #

Source: test/e2e/tools/mimixbox/util-linux/tune2fs.atago.yaml

Scenario: rejects a non-ext image #

Given #

  • Fixture file bad.img is created.

Inputs #

Fixture bad.img:

not a filesystem

When #

tune2fs -l bad.img

Then #

  • exit code is not 0

Scenario: describes itself with –help #

When #

tune2fs --help

Then #

  • exit code is 0
  • stdout contains Usage: tune2fs, filesystem

mimixbox uevent #

Source: test/e2e/tools/mimixbox/util-linux/uevent.atago.yaml

Scenario: describes itself with –help #

When #

uevent --help

Then #

  • exit code is 0
  • stdout contains Usage: uevent, uevent

mimixbox umount #

Source: test/e2e/tools/mimixbox/util-linux/umount.atago.yaml

Scenario: fails for a target that is not mounted #

When #

umount /not/a/real/mountpoint

Then #

  • exit code is not 0

Scenario: requires a target #

When #

umount

Then #

  • exit code is not 0

mimixbox unshare #

Source: test/e2e/tools/mimixbox/util-linux/unshare.atago.yaml

Scenario: requires a namespace flag #

When #

unshare echo x

Then #

  • exit code is not 0

Scenario: describes itself with –help #

When #

unshare --help

Then #

  • exit code is 0
  • stdout contains Usage: unshare, namespace

mimixbox wall #

Source: test/e2e/tools/mimixbox/util-linux/wall.atago.yaml

Scenario: runs and exits successfully #

When #

echo "broadcast" | wall

Then #

  • exit code is 0