-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdebug-blktap.sh
executable file
·66 lines (41 loc) · 1.03 KB
/
debug-blktap.sh
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
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
set -e
function usage() {
cat >&2 << EOF
$0
Debug a test binary
Usage:
$0 WORKSPACE TEST_BASENAME
Where:
WORKSPACE A workspace to be used.
TEST_BASENAME The basename of the test file you whish to debug.
Example:
To debug the test represented by `test_td-ctx.c`, do the following:
sm-ci/debug-blktap.sh workspace/ test_td-ctx
EOF
exit 1
}
[ -z "$1" ] && usage
[ -z "$2" ] && usage
set -eux
WORKDIR="$1"
TEST_BASENAME="$2"
THISFILE=$(readlink -f $0)
THISDIR=$(dirname $THISFILE)
. "$THISDIR/ci_lib.sh"
set_path
# check dependencies
assert_installed fakeroot
assert_installed fakechroot
function debug_blktap() {
local chroot_dir
local test_basename
chroot_dir="$1"
test_basename="$2"
chroot_dir="$(readlink -f $chroot_dir)"
local chroot_path
chroot_path="$chroot_dir/$CHROOT_SUBDIR"
[ -d "$chroot_path" ]
TEST_BASENAME=$test_basename chroot_run "$chroot_dir" "$THISDIR/blktap_debug.sh"
}
debug_blktap "$WORKDIR/chroot" "$TEST_BASENAME"