Skip to content

Commit c6ce475

Browse files
Merge pull request #25735 from Luap99/cdi-compose
test/compose: use --cdi-spec-dir not /etc/cdi
2 parents e4e3ac0 + f07a95d commit c6ce475

File tree

3 files changed

+10
-19
lines changed

3 files changed

+10
-19
lines changed

test/compose/cdi_device/setup.sh

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1 @@
1-
if is_rootless; then
2-
reason=" - can't write to /etc/cdi"
3-
_show_ok skip "$testname # skip$reason"
4-
exit 0
5-
fi
6-
7-
mkdir -p /etc/cdi
8-
mount -t tmpfs tmpfs /etc/cdi
9-
cp device.json /etc/cdi
1+
cp device.json $WORKDIR/cdi

test/compose/cdi_device/teardown.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

test/compose/test-compose

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,12 @@ function start_service() {
198198

199199
# FIXME: use ${testname} subdir but we can't: 50-char limit in runroot
200200
if ! is_rootless; then
201-
rm -rf $WORKDIR/{root,runroot,cni}
201+
rm -rf $WORKDIR/{root,runroot,networks,cdi}
202202
else
203-
$PODMAN_BIN unshare rm -rf $WORKDIR/{root,runroot,cni}
203+
$PODMAN_BIN unshare rm -rf $WORKDIR/{root,runroot,networks,cdi}
204204
fi
205205
rm -f $DOCKER_SOCK
206-
mkdir --mode 0755 $WORKDIR/{root,runroot,cni}
206+
mkdir --mode 0755 $WORKDIR/{root,runroot,networks,cdi}
207207
chcon --reference=/var/lib/containers $WORKDIR/root
208208

209209
$PODMAN_BIN \
@@ -212,7 +212,8 @@ function start_service() {
212212
--root $WORKDIR/root \
213213
--runroot $WORKDIR/runroot \
214214
--cgroup-manager=systemd \
215-
--network-config-dir $WORKDIR/cni \
215+
--network-config-dir $WORKDIR/networks \
216+
--cdi-spec-dir $WORKDIR/cdi \
216217
system service \
217218
--time 0 unix://$DOCKER_SOCK \
218219
&> $WORKDIR/server.log &
@@ -236,10 +237,11 @@ function start_service() {
236237
function podman() {
237238
echo "\$ podman $*" >>$WORKDIR/output.log
238239
output=$($PODMAN_BIN \
239-
--storage-driver=vfs \
240+
--storage-driver=vfs \
240241
--root $WORKDIR/root \
241242
--runroot $WORKDIR/runroot \
242-
--network-config-dir $WORKDIR/cni \
243+
--network-config-dir $WORKDIR/networks \
244+
--cdi-spec-dir $WORKDIR/cdi \
243245
"$@")
244246
rc=$?
245247

@@ -401,7 +403,7 @@ for t in "${tests_to_run[@]}"; do
401403
fi
402404

403405
# FIXME: run 'podman ps'?
404-
# rm -rf $WORKDIR/${testname}
406+
# rm -rf $WORKDIR/${testname}
405407
done
406408

407409
# END entry handler

0 commit comments

Comments
 (0)