Merge pull request #25735 from Luap99/cdi-compose

test/compose: use --cdi-spec-dir not /etc/cdi
This commit is contained in:
openshift-merge-bot[bot]
2025-03-31 16:01:40 +00:00
committed by GitHub
3 changed files with 10 additions and 19 deletions

View File

@ -1,9 +1 @@
if is_rootless; then cp device.json $WORKDIR/cdi
reason=" - can't write to /etc/cdi"
_show_ok skip "$testname # skip$reason"
exit 0
fi
mkdir -p /etc/cdi
mount -t tmpfs tmpfs /etc/cdi
cp device.json /etc/cdi

View File

@ -1,3 +0,0 @@
if ! is_rootless; then
umount -l /etc/cdi
fi

View File

@ -198,12 +198,12 @@ function start_service() {
# FIXME: use ${testname} subdir but we can't: 50-char limit in runroot # FIXME: use ${testname} subdir but we can't: 50-char limit in runroot
if ! is_rootless; then if ! is_rootless; then
rm -rf $WORKDIR/{root,runroot,cni} rm -rf $WORKDIR/{root,runroot,networks,cdi}
else else
$PODMAN_BIN unshare rm -rf $WORKDIR/{root,runroot,cni} $PODMAN_BIN unshare rm -rf $WORKDIR/{root,runroot,networks,cdi}
fi fi
rm -f $DOCKER_SOCK rm -f $DOCKER_SOCK
mkdir --mode 0755 $WORKDIR/{root,runroot,cni} mkdir --mode 0755 $WORKDIR/{root,runroot,networks,cdi}
chcon --reference=/var/lib/containers $WORKDIR/root chcon --reference=/var/lib/containers $WORKDIR/root
$PODMAN_BIN \ $PODMAN_BIN \
@ -212,7 +212,8 @@ function start_service() {
--root $WORKDIR/root \ --root $WORKDIR/root \
--runroot $WORKDIR/runroot \ --runroot $WORKDIR/runroot \
--cgroup-manager=systemd \ --cgroup-manager=systemd \
--network-config-dir $WORKDIR/cni \ --network-config-dir $WORKDIR/networks \
--cdi-spec-dir $WORKDIR/cdi \
system service \ system service \
--time 0 unix://$DOCKER_SOCK \ --time 0 unix://$DOCKER_SOCK \
&> $WORKDIR/server.log & &> $WORKDIR/server.log &
@ -239,7 +240,8 @@ function podman() {
--storage-driver=vfs \ --storage-driver=vfs \
--root $WORKDIR/root \ --root $WORKDIR/root \
--runroot $WORKDIR/runroot \ --runroot $WORKDIR/runroot \
--network-config-dir $WORKDIR/cni \ --network-config-dir $WORKDIR/networks \
--cdi-spec-dir $WORKDIR/cdi \
"$@") "$@")
rc=$? rc=$?