File: smoke

package info (click to toggle)
bmap-tools 3.9.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 760 kB
  • sloc: python: 5,822; sh: 105; makefile: 2
file content (29 lines) | stat: -rwxr-xr-x 689 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh

set -eu

here="$(dirname "$0")"
here="$(readlink -f "$here")"

cd "${AUTOPKGTEST_TMP}"

mkdir webroot
rm -f httpd-pipe
mkfifo httpd-pipe
"$here/web-server.py" webroot 3> httpd-pipe &
httpd_pid="$!"
read ignored < httpd-pipe

truncate -s10M webroot/filesystem.img
/sbin/mkfs.vfat webroot/filesystem.img
bmaptool create webroot/filesystem.img > webroot/filesystem.img.bmap
cat webroot/filesystem.img.bmap

bmaptool copy webroot/filesystem.img filesystem.out
diff -s webroot/filesystem.img filesystem.out

gzip -9n webroot/filesystem.img
bmaptool copy "http://127.0.0.1:$(cat httpd-port)/filesystem.img.gz" filesystem.out2
diff -s filesystem.out filesystem.out2

kill "$httpd_pid"