#!/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 "the update in ~/.local/bin is the new one" \ 'cmp ~/.local/bin/update ~/.local/share/coredesktop/update' }