| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
set -e |
| 4 |
|
| 5 |
ISO_IMG='/tmp/t e s t.iso' |
| 6 |
MNT_PNT='/tmp/t e s t_iso' |
| 7 |
|
| 8 |
echo '~~~ Create an iso image from the source tree' |
| 9 |
# Add a symlink to test fix of https://bugs.debian.org/1083039 |
| 10 |
ln -snf debian/rules symlink_to_rules |
| 11 |
xorriso -outdev "$ISO_IMG" -charset ascii \ |
| 12 |
-map . / \ |
| 13 |
-chown_r 0 / -- \ |
| 14 |
-chgrp_r 0 / -- \ |
| 15 |
-compliance always_gmt_off \ |
| 16 |
2>&1 |
| 17 |
|
| 18 |
echo '~~~ Mount the iso image' |
| 19 |
fuseiso -p "$ISO_IMG" "$MNT_PNT" |
| 20 |
|
| 21 |
echo '~~~ Showcase the content of the iso image' |
| 22 |
tree -DFugs "$MNT_PNT" |
| 23 |
|
| 24 |
echo '~~~ Check the iso image against the source tree' |
| 25 |
# Compare output of 'tree' calls ignoring directories, |
| 26 |
# their sizes differs no matter what |
| 27 |
tree -DFs . | grep -v '/$' >/tmp/source_tree.tree |
| 28 |
cd "$MNT_PNT" |
| 29 |
tree -DFs . | grep -v '/$' >/tmp/mounted_iso.tree |
| 30 |
cd "$OLDPWD" |
| 31 |
diff /tmp/source_tree.tree /tmp/mounted_iso.tree |
| 32 |
# Compare files as to content |
| 33 |
find . -type f -exec cmp {} "$MNT_PNT"/{} \; |
| 34 |
|
| 35 |
echo '~~~ Compare "stat *" results of fuseiso mount against what is expected' |
| 36 |
stat --printf='%s %b %B %n\n' "$MNT_PNT"/* >/tmp/stat-MNT_PNT.out |
| 37 |
diff debian/tests/stat-MNT_PNT.expected /tmp/stat-MNT_PNT.out |
| 38 |
|
| 39 |
fusermount -u "$MNT_PNT" |
| 40 |
|
| 41 |
echo '~~~ Check mounting with fuse options after the positional parameters' |
| 42 |
fuseiso -p "$ISO_IMG" "$MNT_PNT" -o uid=$(id -u),gid=$(id -g) |
| 43 |
ls -ld "$MNT_PNT" |
| 44 |
fusermount -u "$MNT_PNT" |
| 45 |
|
| 46 |
echo '~~~ Check mounting with fuse options ahead of the positional parameters' |
| 47 |
fuseiso -o uid=$(id -u),gid=$(id -g) -p "$ISO_IMG" "$MNT_PNT" |
| 48 |
ls -ld "$MNT_PNT" |
| 49 |
fusermount -u "$MNT_PNT" |
| 50 |
|
| 51 |
echo '~~~ Check mounting single-threaded with fuse options in mixed positions' |
| 52 |
fuseiso -o uid=$(id -u) -s -p "$ISO_IMG" "$MNT_PNT" -o gid=$(id -g) |
| 53 |
ls -ld "$MNT_PNT" |
| 54 |
fusermount -u "$MNT_PNT" |
| 55 |
|
| 56 |
echo '~~~ Check mounting in debug mode' |
| 57 |
fuseiso -dp "$ISO_IMG" "$MNT_PNT" >debug.out 2>&1 & |
| 58 |
sleep 1 |
| 59 |
ls -ld "$MNT_PNT" |
| 60 |
fusermount -u "$MNT_PNT" |
| 61 |
cat debug.out |
| 62 |
grep -E '^Data Preparer Identifier +: XORRISO' debug.out |
| 63 |
|
| 64 |
echo '~~~ Call the alternative binary name with option -V' |
| 65 |
fuseiso9660 -V | tee version.out |
| 66 |
grep -i fuse version.out >/dev/null |
| 67 |
|
| 68 |
echo '~~~ Remove the iso image' |
| 69 |
rm "$ISO_IMG" |