From c7fe6f40824d5aa3d66c6671c420356ee3b79e2e Mon Sep 17 00:00:00 2001 From: Jared Tobin Date: Fri, 15 Nov 2019 19:42:55 +0800 Subject: [PATCH] sh: add OTA test helper script [ci skip] Adds a script for helping to verify that an OTA update (i.e. from arvo at one revision to another) applies cleanly. This only performs the upgrade on a single fake ship, so it's limited in what kind of problems it can identify. It *can* catch particularly nasty errors, however, so serves as a useful sanity check. --- sh/test-arvo-upgrade-path | 73 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100755 sh/test-arvo-upgrade-path diff --git a/sh/test-arvo-upgrade-path b/sh/test-arvo-upgrade-path new file mode 100755 index 000000000..a389565e7 --- /dev/null +++ b/sh/test-arvo-upgrade-path @@ -0,0 +1,73 @@ +#!/usr/bin/env bash + +usage() { + local error="$1" + + cat >&2 < $error +EOF + + exit 1 +} + +args="$@" + +if [[ -z "$args" ]]; then + usage "No arguments specified." +fi + +FROM=$1 +TO=$2 + +SHIP="zod" +START=$(git rev-parse HEAD) + +cleanup () { + if [ -e ./$PIER/.vere.lock ] + then kill $(< ./$PIER/.vere.lock) || true; + fi +} + +trap cleanup EXIT + +boot_ship() { + ship=$1 + rev=$2 + + git checkout $rev + make install + urbit -d -F $ship -B bin/brass.pill +} + +mount_home() { + pier=$1 + + herb ./$pier -p hood -d "+hood/mount /=home=" +} + +update_arvo() { + pier=$1 + rev=$2 + + git checkout $rev + rsync -zr --delete ./pkg/arvo/ ./$pier/home + herb ./$pier -p hood -d "+hood/commit %home" +} + +boot_ship $SHIP $FROM +mount_home $SHIP +update_arvo $SHIP $TO + +cleanup + +git checkout $START