Merge pull request #25564 from poettering/dissect-discover

systemd-dissect: add simple "--discover" command
This commit is contained in:
Yu Watanabe
2022-12-08 12:29:07 +09:00
committed by GitHub
5 changed files with 112 additions and 7 deletions
+9
View File
@@ -409,6 +409,15 @@ systemd-sysext unmerge
rmdir /etc/extensions/app-nodistro
rm /var/lib/extensions/app-nodistro.raw
mkdir -p /run/machines /run/portables /run/extensions
touch /run/machines/a.raw /run/portables/b.raw /run/extensions/c.raw
systemd-dissect --discover --json=short > /tmp/discover.json
grep -q -F '{"name":"a","type":"raw","class":"machine","ro":false,"path":"/run/machines/a.raw"' /tmp/discover.json
grep -q -F '{"name":"b","type":"raw","class":"portable","ro":false,"path":"/run/portables/b.raw"' /tmp/discover.json
grep -q -F '{"name":"c","type":"raw","class":"extension","ro":false,"path":"/run/extensions/c.raw"' /tmp/discover.json
rm /tmp/discover.json /run/machines/a.raw /run/portables/b.raw /run/extensions/c.raw
echo OK >/testok
exit 0