From e666a5b35004a0122033258b17c70a6c5c7fb18b Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 23 Mar 2017 13:57:56 -0400 Subject: [PATCH] vmcheck: Support VMCHECK_INSTTREE I need to build ostree from git too. So now my workflow is: ``` export insttree=/srv/walters/tmp/rootfs cd ostree make && make install DESTDIR=${insttree} cd rpm-ostree make && make install DESTDIR=${insttree} env VMCHECK_INSTTREE=${insttree} make vmoverlay ``` Closes: #705 Approved by: jlebon --- tests/common/libvm.sh | 4 ++++ tests/vmcheck/overlay.sh | 17 +++++++---------- tests/vmcheck/sync.sh | 4 ++-- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/tests/common/libvm.sh b/tests/common/libvm.sh index 268e50f1..2ad64280 100644 --- a/tests/common/libvm.sh +++ b/tests/common/libvm.sh @@ -45,6 +45,10 @@ vm_rsync() { fi rsync -az --no-owner --no-group -e "$rsyncopts" \ --exclude .git/ . $VM:/var/roothome/sync + if test -n "${VMCHECK_INSTTREE:-}"; then + rsync -az --no-owner --no-group -e "$rsyncopts" \ + ${VMCHECK_INSTTREE}/ $VM:/var/roothome/sync/insttree/ + fi popd fi } diff --git a/tests/vmcheck/overlay.sh b/tests/vmcheck/overlay.sh index 3af15526..1344e95f 100755 --- a/tests/vmcheck/overlay.sh +++ b/tests/vmcheck/overlay.sh @@ -15,21 +15,18 @@ if test -z "${INSIDE_VM:-}"; then cd ${topsrcdir} + # Support local development with e.g. an ostree built from git too, + # or libasan. + export VMCHECK_INSTTREE=${VMCHECK_INSTTREE:-$(pwd)/insttree} + # Use a lock in case we're called in parallel (make install might fail). # Plus, we can just share the same install tree, and sharing is caring! flock insttree.lock sh -ec \ - '[ ! -d insttree ] || exit 0 - DESTDIR=$(pwd)/insttree + '[ ! -d ${VMCHECK_INSTTREE} ] || exit 0 + DESTDIR=${VMCHECK_INSTTREE} make install DESTDIR=${DESTDIR} - for san in a t ub; do - if eu-readelf -d ${DESTDIR}/usr/bin/rpm-ostree | \ - grep -q \"NEEDED.*lib${san}san\"; then - echo \"Installing extra sanitizier: lib${san}san\" - cp /usr/lib64/lib${san}san*.so.* ${DESTDIR}/usr/lib64 - fi - done touch ${DESTDIR}/.completed' - [ -f insttree/.completed ] + [ -f ${VMCHECK_INSTTREE}/.completed ] vm_rsync diff --git a/tests/vmcheck/sync.sh b/tests/vmcheck/sync.sh index 7bafd0a4..beb4f4cd 100755 --- a/tests/vmcheck/sync.sh +++ b/tests/vmcheck/sync.sh @@ -15,8 +15,8 @@ if test -z "${INSIDE_VM:-}"; then set -x cd ${topsrcdir} - rm insttree -rf - make install DESTDIR=$(pwd)/insttree + export VMCHECK_INSTTREE=${VMCHECK_INSTTREE:-$(pwd)/insttree} + make install DESTDIR=${VMCHECK_INSTTREE} vm_rsync $SSH "env INSIDE_VM=1 /var/roothome/sync/tests/vmcheck/sync.sh"