File: test_make_random_iso.sh

package info (click to toggle)
afflib 3.7.22-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,584 kB
  • sloc: cpp: 20,911; ansic: 15,912; makefile: 520; sh: 436; python: 192
file content (32 lines) | stat: -rwxr-xr-x 762 bytes parent folder | download | duplicates (4)
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
30
31
32
#!/bin/sh
# 
# Make a random ISO, used by all of the test programs
# Make sure that it is more than 3 pages in length (at least 48MB)

# This file is a work of a US government employee and as such is in the Public domain.
# Simson L. Garfinkel, March 12, 2012
unset AFFLIB_PASSPHRASE

SCRIPT=`realpath "$0"`
SCRIPTPATH=`dirname "$SCRIPT"`
MANPATH="$SCRIPTPATH/../man"

if test "x" = "x$1" ;
  then echo usage: $0 filename
  exit 1
fi

echo Making the random ISO $1
/bin/rm -f "$1"
touch "$1"
dd if=/dev/urandom of="$1" bs=65536 count=24   2>/dev/null
dd if=/dev/zero    bs=16777216 count=2 >> "$1" 2>/dev/null
for i in 1 2 3 4 5 6 7 8 9 0 ; do \
    for fn in "$MANPATH"/* ; do \
        cat "$fn" >> "$1" ;
    done ; \
done
ls -l "$1"
openssl md5 "$1"
exit 0