| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
set -eu |
| 4 |
|
| 5 |
here="$(dirname "$0")" |
| 6 |
here="$(readlink -f "$here")" |
| 7 |
|
| 8 |
cd "${AUTOPKGTEST_TMP}" |
| 9 |
|
| 10 |
mkdir webroot |
| 11 |
rm -f httpd-pipe |
| 12 |
mkfifo httpd-pipe |
| 13 |
"$here/web-server.py" webroot 3> httpd-pipe & |
| 14 |
httpd_pid="$!" |
| 15 |
read ignored < httpd-pipe |
| 16 |
|
| 17 |
truncate -s10M webroot/filesystem.img |
| 18 |
/sbin/mkfs.vfat webroot/filesystem.img |
| 19 |
bmaptool create webroot/filesystem.img > webroot/filesystem.img.bmap |
| 20 |
cat webroot/filesystem.img.bmap |
| 21 |
|
| 22 |
bmaptool copy webroot/filesystem.img filesystem.out |
| 23 |
diff -s webroot/filesystem.img filesystem.out |
| 24 |
|
| 25 |
gzip -9n webroot/filesystem.img |
| 26 |
bmaptool copy "http://127.0.0.1:$(cat httpd-port)/filesystem.img.gz" filesystem.out2 |
| 27 |
diff -s filesystem.out filesystem.out2 |
| 28 |
|
| 29 |
kill "$httpd_pid" |