26
26
collect_system_data "$p"
28
p2="$TMPDIR/collect_mysql_info2"
28
p2="$PT_TMPDIR/collect_mysql_info2"
30
30
touch "$p2/some_empty_file"
31
31
collect_system_data "$p2"
33
33
cmd_ok "test ! -e \"$p2/some_empty_file\"" "collect_system_data removes empty files before exiting"
35
cat <<EOF > "$TMPDIR/expected"
35
cat <<EOF > "$PT_TMPDIR/expected"
38
find_raid_controller_lspci "$samples/lspci-001.txt" > "$TMPDIR/got"
39
no_diff "$TMPDIR/got" "$TMPDIR/expected" "lspci-001.txt"
38
find_raid_controller_lspci "$samples/lspci-001.txt" > "$PT_TMPDIR/got"
39
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "lspci-001.txt"
41
cat <<EOF > "$TMPDIR/expected"
41
cat <<EOF > "$PT_TMPDIR/expected"
44
find_raid_controller_lspci "$samples/lspci-002.txt" > "$TMPDIR/got"
45
no_diff "$TMPDIR/got" "$TMPDIR/expected" "lspci-002.txt"
44
find_raid_controller_lspci "$samples/lspci-002.txt" > "$PT_TMPDIR/got"
45
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "lspci-002.txt"
47
cat <<EOF > "$TMPDIR/expected"
47
cat <<EOF > "$PT_TMPDIR/expected"
50
find_raid_controller_lspci "$samples/lspci-003.txt" > "$TMPDIR/got"
51
no_diff "$TMPDIR/got" "$TMPDIR/expected" "lspci-003.txt"
50
find_raid_controller_lspci "$samples/lspci-003.txt" > "$PT_TMPDIR/got"
51
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "lspci-003.txt"
53
cat <<EOF > "$TMPDIR/expected"
53
cat <<EOF > "$PT_TMPDIR/expected"
54
54
LSI Logic MegaRAID SAS
56
find_raid_controller_lspci "$samples/lspci-004.txt" > "$TMPDIR/got"
57
no_diff "$TMPDIR/got" "$TMPDIR/expected" "lspci-004.txt"
56
find_raid_controller_lspci "$samples/lspci-004.txt" > "$PT_TMPDIR/got"
57
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "lspci-004.txt"
59
cat <<EOF > "$TMPDIR/expected"
59
cat <<EOF > "$PT_TMPDIR/expected"
62
find_raid_controller_lspci "$samples/lspci-005.txt" > "$TMPDIR/got"
63
no_diff "$TMPDIR/got" "$TMPDIR/expected" "lspci-005.txt"
62
find_raid_controller_lspci "$samples/lspci-005.txt" > "$PT_TMPDIR/got"
63
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "lspci-005.txt"
65
cat <<EOF > "$TMPDIR/expected"
65
cat <<EOF > "$PT_TMPDIR/expected"
68
find_raid_controller_lspci "$samples/lspci-006.txt" > "$TMPDIR/got"
69
no_diff "$TMPDIR/got" "$TMPDIR/expected" "lspci-006.txt"
68
find_raid_controller_lspci "$samples/lspci-006.txt" > "$PT_TMPDIR/got"
69
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "lspci-006.txt"
71
71
# find_raid_controller_dmesg
73
cat <<EOF > "$TMPDIR/expected"
73
cat <<EOF > "$PT_TMPDIR/expected"
76
find_raid_controller_dmesg "$samples/dmesg-001.txt" > "$TMPDIR/got"
77
no_diff "$TMPDIR/got" "$TMPDIR/expected" "dmesg-001.txt"
76
find_raid_controller_dmesg "$samples/dmesg-001.txt" > "$PT_TMPDIR/got"
77
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "dmesg-001.txt"
79
cat <<EOF > "$TMPDIR/expected"
79
cat <<EOF > "$PT_TMPDIR/expected"
82
find_raid_controller_dmesg "$samples/dmesg-002.txt" > "$TMPDIR/got"
83
no_diff "$TMPDIR/got" "$TMPDIR/expected" "dmesg-002.txt"
82
find_raid_controller_dmesg "$samples/dmesg-002.txt" > "$PT_TMPDIR/got"
83
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "dmesg-002.txt"
85
cat <<EOF > "$TMPDIR/expected"
85
cat <<EOF > "$PT_TMPDIR/expected"
86
86
LSI Logic MegaRAID SAS
88
find_raid_controller_dmesg "$samples/dmesg-003.txt" > "$TMPDIR/got"
89
no_diff "$TMPDIR/got" "$TMPDIR/expected" "dmesg-003.txt"
88
find_raid_controller_dmesg "$samples/dmesg-003.txt" > "$PT_TMPDIR/got"
89
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "dmesg-003.txt"
91
cat <<EOF > "$TMPDIR/expected"
91
cat <<EOF > "$PT_TMPDIR/expected"
94
find_raid_controller_dmesg "$samples/dmesg-004.txt" > "$TMPDIR/got"
95
no_diff "$TMPDIR/got" "$TMPDIR/expected" "dmesg-004.txt"
94
find_raid_controller_dmesg "$samples/dmesg-004.txt" > "$PT_TMPDIR/got"
95
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "dmesg-004.txt"
97
cat <<EOF > "$TMPDIR/expected"
97
cat <<EOF > "$PT_TMPDIR/expected"
100
find_raid_controller_dmesg "$samples/dmesg-005.txt" > "$TMPDIR/got"
101
no_diff "$TMPDIR/got" "$TMPDIR/expected" "dmesg-005.txt"
103
# TODO is this right?
104
cat <<EOF > "$TMPDIR/expected"
106
find_raid_controller_dmesg "$samples/dmesg-006.txt" > "$TMPDIR/got"
108
no_diff "$TMPDIR/got" "$TMPDIR/expected" "dmesg-006.txt"
110
# TODO is this right?
111
cat <<EOF > "$TMPDIR/expected"
113
find_raid_controller_dmesg "$samples/dmesg-007.txt" > "$TMPDIR/got"
115
no_diff "$TMPDIR/got" "$TMPDIR/expected" "dmesg-007.txt"
100
find_raid_controller_dmesg "$samples/dmesg-005.txt" > "$PT_TMPDIR/got"
101
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "dmesg-005.txt"
103
# TODO is this right?
104
cat <<EOF > "$PT_TMPDIR/expected"
106
find_raid_controller_dmesg "$samples/dmesg-006.txt" > "$PT_TMPDIR/got"
108
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "dmesg-006.txt"
110
# TODO is this right?
111
cat <<EOF > "$PT_TMPDIR/expected"
113
find_raid_controller_dmesg "$samples/dmesg-007.txt" > "$PT_TMPDIR/got"
115
no_diff "$PT_TMPDIR/got" "$PT_TMPDIR/expected" "dmesg-007.txt"
117
117
# raid_controller
119
rm "$TMPDIR/raid_controller_outfile.tmp" 2>/dev/null
120
raid_controller "" "" > "$TMPDIR/raid_controller_outfile.tmp"
119
rm "$PT_TMPDIR/raid_controller_outfile.tmp" 2>/dev/null
120
raid_controller "" "" > "$PT_TMPDIR/raid_controller_outfile.tmp"
123
"$(get_var raid_controller "$TMPDIR/raid_controller_outfile.tmp")" \
123
"$(get_var raid_controller "$PT_TMPDIR/raid_controller_outfile.tmp")" \
124
124
"No RAID controller detected" \
125
125
"raid_controller has a sane default"
127
rm "$TMPDIR/raid_controller_outfile.tmp" 2>/dev/null
128
raid_controller "" "$samples/lspci-001.txt" > "$TMPDIR/raid_controller_outfile.tmp"
127
rm "$PT_TMPDIR/raid_controller_outfile.tmp" 2>/dev/null
128
raid_controller "" "$samples/lspci-001.txt" > "$PT_TMPDIR/raid_controller_outfile.tmp"
130
"$(get_var raid_controller "$TMPDIR/raid_controller_outfile.tmp")" \
130
"$(get_var raid_controller "$PT_TMPDIR/raid_controller_outfile.tmp")" \
131
131
"Fusion-MPT SAS" \
132
132
"raid_controller gets the correct result from an lspci file"
134
rm "$TMPDIR/raid_controller_outfile.tmp" 2>/dev/null
135
raid_controller "$samples/dmesg-004.txt" "" > "$TMPDIR/raid_controller_outfile.tmp"
134
rm "$PT_TMPDIR/raid_controller_outfile.tmp" 2>/dev/null
135
raid_controller "$samples/dmesg-004.txt" "" > "$PT_TMPDIR/raid_controller_outfile.tmp"
137
"$(get_var raid_controller "$TMPDIR/raid_controller_outfile.tmp")" \
137
"$(get_var raid_controller "$PT_TMPDIR/raid_controller_outfile.tmp")" \
139
139
"...Or from a dmseg file"