File: bootcd-run.lib.tst3

package info (click to toggle)
bootcd 5.14
  • links: PTS
  • area: main
  • in suites: buster
  • size: 560 kB
  • sloc: sh: 4,928; makefile: 88
file content (55 lines) | stat: -rwxr-xr-x 2,287 bytes parent folder | download | duplicates (2)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/sh

# reported error
cat << 'END' >/dev/null
--- OUTPUT from <wget --no-check-certificate --dns-timeout=30 --connect-timeout=30 -O /tmp/swapfs/cdimage.iso 193.159.206.34/slawheezy-cd.20141016.iso> ---^M
--2014-10-20 16:07:21--  http://193.159.206.34/slawheezy-cd.20141016.iso^M
--- (e)xit (r)edo (i)gnore (s)witch interactive --- i^M
mount: block device /tmp/swapfs/cdimage.iso is write-protected, mounting read-only^M
--- OUTPUT from <mount -o loop /tmp/swapfs/cdimage.iso /tmp/isoloopback> ---^M
mount: block device /tmp/swapfs/cdimage.iso is write-protected, mounting read-only^M
--- (e)xit (r)edo (i)gnore (s)witch interactive --- s^M
END

# Code in bootcd2disk
cat << 'END' >/dev/null
in_stdout $mm "^--....-..-.. ..:..:..--  $IMAGEURL$"
TODO="$TODO \"wget --no-check-certificate --dns-timeout=$timeout --connect-timeout=$timeout -O /tmp/swapfs/cdimage.iso $IMAGEURL\""
in_stdout $mm "^mount: warning: /tmp/isoloopback seems to be mounted read-only\.$"
TODO="$TODO \"mount -o loop /tmp/swapfs/cdimage.iso $ISOLOOPBACK\""
END

# replay error
RUNLIB=../bootcd/bootcd-run.lib
ERRLOG=/tmp/interactive.tst.log
. $RUNLIB
TODOY="-y"
TODO="" mm=0
IAHEAD="$(basename $0)"
IMAGEURL="193.159.206.34/slawheezy-cd.20141016.iso"

copyfromserver_before()
{
  # timeout for dns-query and connection timeout (seconds)
  local IAHEAD="$IAHEAD/copyfromserver_before"
  local TODO="" mm=0
  local url

  mm=$(($mm+1)); eval local IGNORE${mm}=\"\"; eval local STDOUT${mm}=\"\"
  # rule before this fix:
  # in_stdout $mm "^--....-..-.. ..:..:..--  $IMAGEURL"
  in_stdout $mm "^--....-..-.. ..:..:..-- .*$IMAGEURL$" # IMAGEURL without http:// can be prefixed with http://
  TODO="$TODO \"echo '--2014-10-20 16:07:21--  http://193.159.206.34/slawheezy-cd.20141016.iso'\""

  mm=$(($mm+1)); eval local IGNORE${mm}=\"\"; eval local STDOUT${mm}=\"\"
  # no rule before this fix
  in_stdout $mm "^mount: block device .* is write-protected, mounting read-only$"
  TODO="$TODO \"echo 'mount: block device /tmp/swapfs/cdimage.iso is write-protected, mounting read-only'\""

  eval "interactive $TODOY -r -h \"=== \$IAHEAD ===\" $TODO"
}
mm=$(($mm+1)); eval IGNORE${mm}=\"\"; eval STDOUT${mm}=\"\"
in_norun $mm
TODO="$TODO copyfromserver_before"

eval "interactive $TODOY -r -h \"=== \$IAHEAD ===\" $TODO"