Files
coredesktop/smoketest/scenarios/31-update-replaces-itself.sh
T
david 2b85af286f
shellcheck / shellcheck (push) Failing after 17s
testing harness, coredesktop-dev
2026-11-04 09:39:46 -07:00

20 lines
740 B
Bash

#!/bin/bash
# shellcheck disable=SC2034
DESCRIPTION="a release that changes update and adds a hook: the new update and hook run in the same update"
IMAGE=installed
TIER=pr
scenario() {
upstream_commit "Change update and add a hook" '
sed -i "s/^FAILED=()\$/echo \"smoketest: the new update ran\"\nFAILED=()/" update
grep -q "smoketest: the new update ran" update
printf "%s\n" "#!/bin/bash" "run_update() { touch ~/smoketest-hook-ran; }" > updates.d/50-smoketest.sh'
cd_update
assert_status 0
assert_output "smoketest: the new update ran"
assert_vm "the new hook ran" 'test -f ~/smoketest-hook-ran'
assert_vm "~/.local/bin/update is the new one" \
'cmp ~/.local/bin/update ~/.local/share/coredesktop/update'
}