Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
openMMC
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
openMMC
Commits
eb11e747
Commit
eb11e747
authored
Oct 22, 2015
by
Henrique Silva
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Python script to send a burst of IPMI messages
parent
cb830547
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
run_cmd.py
test/run_cmd.py
+32
-0
No files found.
test/run_cmd.py
0 → 100644
View file @
eb11e747
import
subprocess
import
argparse
from
time
import
sleep
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
'-t'
,
'--target'
,
help
=
'I2C slave address of AFC Board'
)
parser
.
add_argument
(
'-i'
,
'--ip'
,
help
=
'MCH IP address'
,
default
=
'10.0.18.192'
)
parser
.
add_argument
(
'-n'
,
'--netfn'
,
help
=
'Net Function'
,
required
=
True
)
parser
.
add_argument
(
'-c'
,
'--cmd'
,
help
=
'Command'
,
required
=
True
)
parser
.
add_argument
(
'-d'
,
'--data'
,
nargs
=
'+'
,
help
=
'Data'
)
args
=
parser
.
parse_args
()
ipmi_cmd
=
[
'ipmitool'
]
ipmi_cmd
.
extend
([
'-I'
,
'lan'
])
ipmi_cmd
.
extend
([
'-H'
,
args
.
ip
])
ipmi_cmd
.
extend
([
'-P'
,
''
])
ipmi_cmd
.
extend
([
'-T'
,
'0x82'
])
ipmi_cmd
.
extend
([
'-m'
,
'0x20'
])
ipmi_cmd
.
extend
([
'-t'
,
args
.
target
])
ipmi_cmd
.
extend
([
'raw'
,
args
.
netfn
,
args
.
cmd
])
if
(
args
.
data
):
ipmi_cmd
.
extend
(
args
.
data
)
while
1
:
p
=
subprocess
.
Popen
(
ipmi_cmd
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
out
,
err
=
p
.
communicate
()
model
=
' 0a 02 05 50 02 1f 5a 31 00 01 01
\n
'
if
(
out
==
model
)
:
print
'Get_Device_ID has run successfully!'
else
:
print
'Error!!'
sleep
(
0.2
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment