mirror of
https://github.com/containers/skopeo.git
synced 2025-08-08 01:53:52 +00:00
Fix storage.conf setup in test-system
- Don't do it at all for the CI VM: We can use the VM's global Podman configuration, and use faster overlay instead of vfs, so let's do that. - For the developer-run (make test-system): - Add graphroot and runroot paths to make the configuration minimally valid - Explicitly point CONTAINERS_STORAGE_CONF at the configutation to be certain it will get used. Then drop the (podman pull ...) in runner.sh:_podman_reset that seemed to previously workaround the invalid /etc/containers/storage.conf . Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
parent
198155027d
commit
a98c137243
@ -115,15 +115,6 @@ _run_unit() {
|
|||||||
_podman_reset() {
|
_podman_reset() {
|
||||||
# Ensure we start with a clean-slate
|
# Ensure we start with a clean-slate
|
||||||
showrun podman system reset --force
|
showrun podman system reset --force
|
||||||
# WARNING WARNING WARNING WARNING
|
|
||||||
# Without running a container, the system tests will inexplicably
|
|
||||||
# fail with obscure errors/warning messages. I have no idea why
|
|
||||||
# running a container after a `system reset` fixes/prevents the
|
|
||||||
# problem. The failures do not reproduce when tests are run manually.
|
|
||||||
# So unless or until /until somebody develops a better understanding,
|
|
||||||
# this fix is JFM - just fakking magic.
|
|
||||||
# WARNING WARNING WARNING WARNING
|
|
||||||
showrun podman run -it --rm --entrypoint /bin/true quay.io/libpod/alpine:latest
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_run_integration() {
|
_run_integration() {
|
||||||
|
@ -5,17 +5,37 @@ set -e
|
|||||||
# not all storage drivers are supported in a container
|
# not all storage drivers are supported in a container
|
||||||
# environment. Detect this and setup storage when
|
# environment. Detect this and setup storage when
|
||||||
# running in a container.
|
# running in a container.
|
||||||
if ((SKOPEO_CONTAINER_TESTS)) && [[ -r /etc/containers/storage.conf ]]; then
|
#
|
||||||
|
# Paradoxically (FIXME: clean this up), SKOPEO_CONTAINER_TESTS is set
|
||||||
|
# both inside a container and without a container (in a CI VM); it actually means
|
||||||
|
# "it is safe to desctructively modify the system for tests".
|
||||||
|
#
|
||||||
|
# On a CI VM, we can just use Podman as it is already configured; the changes below,
|
||||||
|
# to use VFS, are necessary only inside a container, because overlay-inside-overlay
|
||||||
|
# does not work. So, make these changes conditional on both
|
||||||
|
# SKOPEO_CONTAINER_TESTS (for acceptability to do destructive modification) and !CI
|
||||||
|
# (for necessity to adjust for in-container operation)
|
||||||
|
if ((SKOPEO_CONTAINER_TESTS)) && [[ "$CI" != true ]]; then
|
||||||
|
if [[ -r /etc/containers/storage.conf ]]; then
|
||||||
|
echo "MODIFYING existing storage.conf"
|
||||||
sed -i \
|
sed -i \
|
||||||
-e 's/^driver\s*=.*/driver = "vfs"/' \
|
-e 's/^driver\s*=.*/driver = "vfs"/' \
|
||||||
-e 's/^mountopt/#mountopt/' \
|
-e 's/^mountopt/#mountopt/' \
|
||||||
/etc/containers/storage.conf
|
/etc/containers/storage.conf
|
||||||
elif ((SKOPEO_CONTAINER_TESTS)); then
|
else
|
||||||
|
echo "CREATING NEW storage.conf"
|
||||||
cat >> /etc/containers/storage.conf << EOF
|
cat >> /etc/containers/storage.conf << EOF
|
||||||
[storage]
|
[storage]
|
||||||
driver = "vfs"
|
driver = "vfs"
|
||||||
|
runroot = "/run/containers/storage"
|
||||||
|
graphroot = "/var/lib/containers/storage"
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
# The logic of finding the relevant storage.conf file is convoluted
|
||||||
|
# and in effect differs between Skopeo and Podman, at least in some versions;
|
||||||
|
# explicitly point at the file we want to use to hopefully avoid that.
|
||||||
|
export CONTAINERS_STORAGE_CONF=/etc/containers/storage.conf
|
||||||
|
fi
|
||||||
|
|
||||||
# Build skopeo, install into /usr/bin
|
# Build skopeo, install into /usr/bin
|
||||||
make PREFIX=/usr install
|
make PREFIX=/usr install
|
||||||
|
Loading…
Reference in New Issue
Block a user