rpm-ostree/tests/vmcheck/sync.sh
Jonathan Lebon 7fbf9f32d4 hacking: make it easier to use a custom tree
Let's make using a custom install tree easier and document the process.
We split out the insttree step into `build.sh` so that we no longer have
to `flock(1)` around it, and also share between `overlay.sh` and
`sync.sh`.

Closes: #968
Approved by: cgwalters
2017-09-01 19:58:55 +00:00

45 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
set -euo pipefail
if test -z "${INSIDE_VM:-}"; then
# do this in the host
. ${commondir}/libvm.sh
vm_setup
if ! vm_ssh_wait 30; then
echo "ERROR: A running VM is required for 'make vmcheck'."
exit 1
fi
vm_rsync
vm_cmd env INSIDE_VM=1 /var/roothome/sync/tests/vmcheck/sync.sh
exit 0
fi
set -x
# And then this code path in the VM
ostree admin unlock || :
# Now, overlay our built binaries & config files
INSTTREE=/var/roothome/sync/insttree
rsync -rlv $INSTTREE/usr/ /usr/
if [ -d $INSTTREE/etc ]; then # on CentOS, the dbus service file is in /usr
rsync -rlv $INSTTREE/etc/ /etc/
fi
restorecon -v /usr/bin/{rpm-,}ostree /usr/libexec/rpm-ostreed
# For our test suite at least, to catch things like
# https://github.com/projectatomic/rpm-ostree/issues/826
mkdir -p /etc/systemd/system/rpm-ostreed.service.d
cat > /etc/systemd/system/rpm-ostreed.service.d/fatal-warnings.conf << EOF
[Service]
Environment=G_DEBUG=fatal-warnings
EOF
systemctl daemon-reload
systemctl restart rpm-ostreed