#!/usr/bin/env bash set -euo pipefail [[ $# -eq 1 ]] || { echo "usage: test-jd-final-candidate-replacement-contract.sh " >&2 exit 64 } source_root=$(cd "$1" && pwd -P) script="${source_root}/scripts/replace-jd-native-final-resident-candidate.sh" grep -Fq 'guanghu-jd-native-once)' "${script}" grep -Fq 'gnulinux-simple-9e4550a0-452b-4f28-b5a5-d5364aa450f6)' "${script}" grep -Fq 'unsupported GRUB_DEFAULT for bounded native candidate replacement' "${script}" grep -Fq 'grub_default_unchanged: ${grub_default}' "${script}" ! grep -Fq 'grub_default_native: true' "${script}" echo "JD_FINAL_CANDIDATE_REPLACEMENT_CONTRACT_OK"