author | Melynda Hunter <melynda.hunter@oracle.com> |
Tue, 28 Aug 2012 15:45:52 -0700 | |
branch | s11-sru |
changeset 2335 | e578e0325a89 |
parent 268 | 6518166b581c |
permissions | -rwxr-xr-x |
268
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
1 |
#!/bin/sh |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
2 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
3 |
# CDDL HEADER START |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
4 |
# |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
5 |
# The contents of this file are subject to the terms of the |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
6 |
# Common Development and Distribution License (the "License"). |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
7 |
# You may not use this file except in compliance with the License. |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
8 |
# |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
9 |
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
10 |
# or http://www.opensolaris.org/os/licensing. |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
11 |
# See the License for the specific language governing permissions |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
12 |
# and limitations under the License. |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
13 |
# |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
14 |
# When distributing Covered Code, include this CDDL HEADER in each |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
15 |
# file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
16 |
# If applicable, add the following below this CDDL HEADER, with the |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
17 |
# fields enclosed by brackets "[]" replaced with your own identifying |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
18 |
# information: Portions Copyright [yyyy] [name of copyright owner] |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
19 |
# |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
20 |
# CDDL HEADER END |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
21 |
# |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
22 |
# Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
23 |
# |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
24 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
25 |
# ---------------------------------------------------------------------------- |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
26 |
# test_ipmitool confirm basic ipmitool functionality works |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
27 |
# |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
28 |
# exercise a commonly used subset of all ipmitool commands, |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
29 |
# for each such command: |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
30 |
# save its output to a *.out file |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
31 |
# confirm ipmitool exit status is 0 (good) |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
32 |
# confirm *.out contains some piece of expected data |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
33 |
# ---------------------------------------------------------------------------- |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
34 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
35 |
cmd_name="`basename $0`" # the name of this command |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
36 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
37 |
cmd_err="${cmd_name}: error:" # the (fatal) error header |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
38 |
cmd_warn="${cmd_name}: warning:" # the warning header |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
39 |
cmd_info="${cmd_name}: info:" # the informational header |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
40 |
cmd_query="${cmd_name}: query:" # the interrogative header |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
41 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
42 |
bin_path="/usr/sbin" # path(s) to ipmitool binary executable(s) |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
43 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
44 |
# ---------------------------------------------------------------------------- |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
45 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
46 |
usage() |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
47 |
{ |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
48 |
echo "usage: $cmd_name [-p <bin_path>]" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
49 |
echo " -p path to ipmitool binary" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
50 |
echo "purpose: confirm basic ipmitool functionality works;" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
51 |
echo " this is NOT a comprehensive test" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
52 |
echo "examples:" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
53 |
echo " $cmd_name -p \$CODEMGR_WS/proto/root_\`uname -p\`/usr/sbin" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
54 |
} # usage() |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
55 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
56 |
# ---------------------------------------------------------------------------- |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
57 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
58 |
show_env() |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
59 |
{ |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
60 |
echo "$cmd_info general environment:" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
61 |
date ; id ; uname -a ; pwd ; echo "$PATH" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
62 |
[ -r /etc/release ] && cat /etc/release |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
63 |
[ -r /etc/motd ] && grep bfu /etc/motd |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
64 |
ipmitool -V |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
65 |
} # show_env() |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
66 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
67 |
# ---------------------------------------------------------------------------- |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
68 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
69 |
enforce_i386() |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
70 |
{ |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
71 |
proctype=`uname -p` |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
72 |
[ "$proctype" != "i386" ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
73 |
echo "$cmd_err processor type $proctype != i386" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
74 |
echo "$cmd_info future versions of this test tool may use" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
75 |
echo " ipmitool -I lan -H <i386_host>" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
76 |
echo "when run on $proctype but that is a future enhancement (TBD)" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
77 |
exit 1 |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
78 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
79 |
} # enforce_i386() |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
80 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
81 |
# ---------------------------------------------------------------------------- |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
82 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
83 |
test_opt_version() |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
84 |
{ |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
85 |
tnm="version option" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
86 |
ipmitool -V > ipmitool_V.out |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
87 |
rc=$? |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
88 |
[ $rc -ne 0 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
89 |
echo "$cmd_err $tnm failed with exit code $rc" ; exit $rc |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
90 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
91 |
cnt=`grep -i -c 'version.*[0-9][0-9]*\.[0-9]' ipmitool_V.out` |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
92 |
[ $cnt -le 0 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
93 |
echo "$cmd_err $tnm output missing version" ; exit 1 |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
94 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
95 |
echo "$cmd_info $tnm passed" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
96 |
} # test_opt_version() |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
97 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
98 |
# ---------------------------------------------------------------------------- |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
99 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
100 |
test_cmd_help() |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
101 |
{ |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
102 |
tnm="help command" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
103 |
ipmitool help > ipmitool_help.out 2>&1 |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
104 |
rc=$? |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
105 |
[ $rc -ne 0 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
106 |
echo "$cmd_err $tnm failed with exit code $rc" ; exit $rc |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
107 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
108 |
cnt=`grep -i -c 'chassis.*status' ipmitool_help.out` |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
109 |
[ $cnt -le 0 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
110 |
echo "$cmd_err $tnm output missing chassis" ; exit 1 |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
111 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
112 |
echo "$cmd_info $tnm passed" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
113 |
} # test_cmd_help() |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
114 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
115 |
# ---------------------------------------------------------------------------- |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
116 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
117 |
test_cmd_bmc() |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
118 |
{ |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
119 |
tnm="bmc info command" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
120 |
ipmitool bmc info > ipmitool_bmc_info.out |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
121 |
rc=$? |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
122 |
[ $rc -ne 0 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
123 |
echo "$cmd_err $tnm failed with exit code $rc" ; exit $rc |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
124 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
125 |
cnt=`grep -c 'IPMI Version' ipmitool_bmc_info.out` |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
126 |
[ $cnt -lt 1 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
127 |
echo "$cmd_err $tnm output missing IPMI Version" ; exit 1 |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
128 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
129 |
echo "$cmd_info $tnm passed" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
130 |
tnm="bmc getenables command" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
131 |
ipmitool bmc getenables > ipmitool_bmc_getenables.out |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
132 |
rc=$? |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
133 |
[ $rc -ne 0 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
134 |
echo "$cmd_err $tnm failed with exit code $rc" ; exit $rc |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
135 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
136 |
cnt=`grep -c 'OEM' ipmitool_bmc_getenables.out` |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
137 |
[ $cnt -lt 3 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
138 |
echo "$cmd_err $tnm output too few OEM" ; exit 1 |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
139 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
140 |
echo "$cmd_info $tnm passed" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
141 |
} # test_cmd_bmc() |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
142 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
143 |
# ---------------------------------------------------------------------------- |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
144 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
145 |
test_cmd_sel() |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
146 |
{ |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
147 |
tnm="sel info command" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
148 |
ipmitool sel info > ipmitool_sel_info.out |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
149 |
rc=$? |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
150 |
[ $rc -ne 0 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
151 |
echo "$cmd_err $tnm failed with exit code $rc" ; exit $rc |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
152 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
153 |
cnt=`egrep -c 'Version|Entries' ipmitool_sel_info.out` |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
154 |
[ $cnt -lt 2 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
155 |
echo "$cmd_err $tnm output missing Version or Entries" ; exit 1 |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
156 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
157 |
echo "$cmd_info $tnm passed" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
158 |
tnm="sel time get command" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
159 |
ipmitool sel time get > ipmitool_sel_time_get.out |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
160 |
rc=$? |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
161 |
[ $rc -ne 0 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
162 |
echo "$cmd_err $tnm failed with exit code $rc" ; exit $rc |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
163 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
164 |
nowyr=`date '+%Y'` |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
165 |
cnt=`grep -c "$nowyr" ipmitool_sel_time_get.out` |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
166 |
[ $cnt -lt 1 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
167 |
echo "$cmd_err $tnm missing $nowyr" ; exit 1 |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
168 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
169 |
echo "$cmd_info $tnm passed" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
170 |
tnm="sel list command" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
171 |
cnt=`grep 'Entries' ipmitool_sel_info.out | awk '{print $NF}'` |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
172 |
[ $cnt -eq 0 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
173 |
echo "$cmd_info $tnm passed" ; return 0 |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
174 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
175 |
ipmitool sel list $cnt > ipmitool_sel_list.out |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
176 |
rc=$? |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
177 |
[ $rc -ne 0 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
178 |
echo "$cmd_err $tnm failed with exit code $rc" ; exit $rc |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
179 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
180 |
cnt2=`wc ipmitool_sel_list.out | awk '{print $1}'` |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
181 |
[ $cnt2 -ne $cnt ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
182 |
echo "$cmd_err $tnm output lines $cnt2 != $cnt" ; exit 1 |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
183 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
184 |
echo "$cmd_info $tnm passed" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
185 |
} # test_cmd_sel() |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
186 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
187 |
# ---------------------------------------------------------------------------- |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
188 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
189 |
test_cmd_chassis() |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
190 |
{ |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
191 |
tnm="chassis status command" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
192 |
ipmitool chassis status > ipmitool_chassis_status.out |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
193 |
rc=$? |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
194 |
[ $rc -ne 0 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
195 |
echo "$cmd_err $tnm failed with exit code $rc" ; exit $rc |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
196 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
197 |
cnt=`grep -c 'System Power' ipmitool_chassis_status.out` |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
198 |
[ $cnt -eq 0 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
199 |
echo "$cmd_err $tnm output missing System Power" ; exit 1 |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
200 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
201 |
echo "$cmd_info $tnm passed" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
202 |
} # test_cmd_chassis() |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
203 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
204 |
# ---------------------------------------------------------------------------- |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
205 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
206 |
test_cmd_fru() |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
207 |
{ |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
208 |
tnm="fru print command" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
209 |
ipmitool fru print > ipmitool_fru_print.out |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
210 |
rc=$? |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
211 |
[ $rc -ne 0 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
212 |
echo "$cmd_err $tnm failed with exit code $rc" ; exit $rc |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
213 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
214 |
cnt=`grep -i -c 'Manufacturer.*Sun Microsystems' ipmitool_fru_print.out` |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
215 |
[ $cnt -lt 1 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
216 |
echo "$cmd_err $tnm output too few Sun Microsystems" ; exit 1 |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
217 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
218 |
echo "$cmd_info $tnm passed" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
219 |
} # test_cmd_fru() |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
220 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
221 |
# ---------------------------------------------------------------------------- |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
222 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
223 |
test_cmd_lan() |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
224 |
{ |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
225 |
tnm="lan print command" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
226 |
ipmitool lan print > ipmitool_lan_print.out |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
227 |
rc=$? |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
228 |
[ $rc -ne 0 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
229 |
echo "$cmd_err $tnm failed with exit code $rc" ; exit $rc |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
230 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
231 |
cnt=`egrep -c 'ARP|MAC|IP' ipmitool_lan_print.out` |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
232 |
[ $cnt -lt 3 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
233 |
echo "$cmd_err $tnm output too few ARP|MAC|IP" ; exit 1 |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
234 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
235 |
echo "$cmd_info $tnm passed" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
236 |
tnm="lan alert print command" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
237 |
ipmitool lan alert print > ipmitool_lan_alert_print.out |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
238 |
rc=$? |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
239 |
[ $rc -ne 0 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
240 |
echo "$cmd_err $tnm failed with exit code $rc" ; exit $rc |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
241 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
242 |
cnt=`grep -c 'Destination' ipmitool_lan_alert_print.out` |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
243 |
[ $cnt -lt 1 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
244 |
echo "$cmd_err $tnm output missing Destination" ; exit 1 |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
245 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
246 |
echo "$cmd_info $tnm passed" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
247 |
} # test_cmd_lan() |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
248 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
249 |
# ---------------------------------------------------------------------------- |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
250 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
251 |
test_cmd_channel() |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
252 |
{ |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
253 |
tnm="channel info command" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
254 |
ipmitool channel info > ipmitool_channel_info.out |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
255 |
rc=$? |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
256 |
[ $rc -ne 0 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
257 |
echo "$cmd_err $tnm failed with exit code $rc" ; exit $rc |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
258 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
259 |
cnt=`grep -i -c 'Channel 0x.*info' ipmitool_channel_info.out` |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
260 |
[ $cnt -lt 1 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
261 |
echo "$cmd_err $tnm output missing Channel number" ; exit 1 |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
262 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
263 |
echo "$cmd_info $tnm passed" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
264 |
} # test_cmd_channel() |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
265 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
266 |
# ---------------------------------------------------------------------------- |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
267 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
268 |
test_cmd_sensor() |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
269 |
{ |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
270 |
tnm="sensor list command" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
271 |
ipmitool sensor list > ipmitool_sensor_list.out |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
272 |
rc=$? |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
273 |
[ $rc -ne 0 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
274 |
echo "$cmd_err $tnm failed with exit code $rc" ; exit $rc |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
275 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
276 |
cnt=`egrep -i -c 'degrees|RPM|volts' ipmitool_sensor_list.out` |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
277 |
[ $cnt -lt 10 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
278 |
echo "$cmd_err $tnm output too few degrees|RPM|volts" ; exit 1 |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
279 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
280 |
echo "$cmd_info $tnm passed" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
281 |
tnm="sensor get command" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
282 |
cnt=`expr $cnt % 10` |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
283 |
# note: sensor names might have whitespace in them |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
284 |
snm=`egrep -i 'degrees|RPM|volts' ipmitool_sensor_list.out | \ |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
285 |
head -$cnt | tail -1 | cut -d'|' -f1` |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
286 |
snm=`echo $snm` # drop any leading or trailing whitespace |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
287 |
ipmitool sensor get "$snm" > ipmitool_sensor_get.out |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
288 |
rc=$? |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
289 |
[ $rc -ne 0 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
290 |
echo "$cmd_err $tnm failed with exit code $rc" ; exit $rc |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
291 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
292 |
cnt=`egrep -i 'degrees|RPM|volts' ipmitool_sensor_get.out | \ |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
293 |
grep -c 'Sensor Reading'` |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
294 |
[ $cnt -ne 1 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
295 |
echo "$cmd_err $tnm wrong Sensor Reading for $snm" ; exit 1 |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
296 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
297 |
echo "$cmd_info $tnm passed" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
298 |
} # test_cmd_sensor() |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
299 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
300 |
# ---------------------------------------------------------------------------- |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
301 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
302 |
test_cmd_sdr() |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
303 |
{ |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
304 |
tnm="sdr list command" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
305 |
ipmitool sdr list all > ipmitool_sdr_list_all.out |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
306 |
rc=$? |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
307 |
[ $rc -ne 0 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
308 |
echo "$cmd_err $tnm failed with exit code $rc" ; exit $rc |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
309 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
310 |
cnt=`egrep -i -c 'degrees|RPM|volts' ipmitool_sdr_list_all.out` |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
311 |
[ $cnt -lt 10 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
312 |
echo "$cmd_err $tnm output too few degrees|RPM|volts" ; exit 1 |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
313 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
314 |
echo "$cmd_info $tnm passed" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
315 |
tnm="sdr get command" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
316 |
cnt=`expr $cnt / 2` |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
317 |
# note: sensor names might have whitespace in them |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
318 |
snm=`egrep -i 'degrees|RPM|volts' ipmitool_sdr_list_all.out | \ |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
319 |
head -$cnt | tail -1 | cut -d'|' -f1` |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
320 |
snm=`echo $snm` # drop any leading or trailing whitespace |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
321 |
ipmitool sdr get "$snm" > ipmitool_sdr_get.out |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
322 |
rc=$? |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
323 |
[ $rc -ne 0 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
324 |
echo "$cmd_err $tnm failed with exit code $rc" ; exit $rc |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
325 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
326 |
cnt=`egrep -i 'degrees|RPM|volts' ipmitool_sdr_get.out | \ |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
327 |
grep -c 'Sensor Reading'` |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
328 |
[ $cnt -ne 1 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
329 |
echo "$cmd_err $tnm wrong Sensor Reading for $snm" ; exit 1 |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
330 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
331 |
echo "$cmd_info $tnm passed" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
332 |
} # test_cmd_sdr() |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
333 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
334 |
# ---------------------------------------------------------------------------- |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
335 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
336 |
test_cmd_power() |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
337 |
{ |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
338 |
tnm="power status command" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
339 |
ipmitool power status > ipmitool_power_status.out |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
340 |
rc=$? |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
341 |
[ $rc -ne 0 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
342 |
echo "$cmd_err $tnm failed with exit code $rc" ; exit $rc |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
343 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
344 |
cnt=`grep -i -c 'power.*on' ipmitool_power_status.out` |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
345 |
[ $cnt -lt 1 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
346 |
echo "$cmd_err $tnm output missing power on" ; exit 1 |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
347 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
348 |
echo "$cmd_info $tnm passed" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
349 |
} # test_cmd_power() |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
350 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
351 |
# ---------------------------------------------------------------------------- |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
352 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
353 |
test_cmd_echo() |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
354 |
{ |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
355 |
tnm="echo command" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
356 |
ipmitool echo "hello world from pid $$" > ipmitool_echo.out |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
357 |
rc=$? |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
358 |
[ $rc -ne 0 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
359 |
echo "$cmd_err $tnm failed with exit code $rc" ; exit $rc |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
360 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
361 |
cnt=`grep -c "pid $$" ipmitool_echo.out` |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
362 |
[ $cnt -ne 1 ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
363 |
echo "$cmd_err $tnm output missing my pid" ; exit 1 |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
364 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
365 |
echo "$cmd_info $tnm passed" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
366 |
} # test_cmd_echo() |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
367 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
368 |
# ---------------------------------------------------------------------------- |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
369 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
370 |
# main() |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
371 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
372 |
while getopts p: opt; do # { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
373 |
case $opt in |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
374 |
p) bin_path="$OPTARG";; |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
375 |
-) break;; |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
376 |
\?) echo "$cmd_err bad option(s)" ; usage ; exit 22;; |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
377 |
esac |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
378 |
done # } while grabbing cmd line args |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
379 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
380 |
shift `expr $OPTIND - 1` |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
381 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
382 |
too_much="$1" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
383 |
[ "$too_much" != "" ] && { |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
384 |
echo "$cmd_err too few/many args" ; usage ; exit 7 |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
385 |
} |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
386 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
387 |
PATH="${bin_path}:$PATH" |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
388 |
export PATH |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
389 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
390 |
# ---------------------------------------------------------------------------- |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
391 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
392 |
enforce_i386 |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
393 |
show_env |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
394 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
395 |
# version 1.8.8 and later |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
396 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
397 |
test_opt_version |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
398 |
test_cmd_help |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
399 |
test_cmd_bmc |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
400 |
test_cmd_sel |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
401 |
test_cmd_chassis |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
402 |
test_cmd_fru |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
403 |
test_cmd_lan |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
404 |
test_cmd_channel |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
405 |
test_cmd_sensor |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
406 |
test_cmd_sdr |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
407 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
408 |
# version 1.8.10 and later |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
409 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
410 |
test_cmd_power |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
411 |
test_cmd_echo |
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
412 |
|
6518166b581c
7047461 "temporarily" restore sfw version of ipmitool to userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
diff
changeset
|
413 |
echo "$cmd_info all tests passed" # if reach here then aok |