test: mutations for the docker script channel
One pipes get.docker.com straight into a root shell; one reports the plugin rows as covered after a failed install. Both are killed by the unit suite.
This commit is contained in:
1 parent
a538ab75dd
commit
9b81bfb616
2 files changed
+31
No files matched your search
@@ -0,0 +1,18 @@
|
||||
# what: get.docker.com piped straight into a root sh instead of downloaded and checked
|
||||
# why: no pipefail in sh: a 404 or truncated body runs as root AND reports success
|
||||
# kills: a failed download is reported, not swallowed
|
||||
# run: unit
|
||||
<<<OLD
|
||||
run_sh "curl -fsSL https://get.docker.com -o '$WORKDIR/get-docker.sh' && [ -s '$WORKDIR/get-docker.sh' ]" \
|
||||
|| { note_fail "$key" "the Docker install script download failed or arrived empty"
|
||||
DOCKER_SCRIPTED=fail; continue; }
|
||||
# get.docker.com escalates on its own when it is not run as root,
|
||||
# but this box may have no sudo at all and dotup already knows
|
||||
# which -- so pass it explicitly and keep the command that is
|
||||
# printed identical to the one that runs.
|
||||
run_sh "${SUDO:+$SUDO }sh '$WORKDIR/get-docker.sh'" \
|
||||
|| { note_fail "$key" "the official Docker install script failed"
|
||||
<<<NEW
|
||||
run_sh "curl -fsSL https://get.docker.com | ${SUDO:+$SUDO }sh" \
|
||||
|| { note_fail "$key" "the official Docker install script failed"
|
||||
<<<END
|
||||
@@ -0,0 +1,13 @@
|
||||
# what: buildx and compose rows say "covered" even when the docker install failed
|
||||
# why: one honest failure would be reported as two invented successes
|
||||
# kills: …and the other two rows say they were not attempted
|
||||
# run: unit
|
||||
<<<OLD
|
||||
if [ "$DOCKER_SCRIPTED" = ok ]; then
|
||||
say " $key: covered by the docker group's single install"
|
||||
else
|
||||
note_fail "$key" "not attempted — the docker install failed"
|
||||
fi
|
||||
<<<NEW
|
||||
say " $key: covered by the docker group's single install"
|
||||
<<<END
|
||||
Reference in new issue
Block a user