Skip to content

Commit

Permalink
OpTestOpenBMC: Download dumps to logdir
Browse files Browse the repository at this point in the history
Download the openbmc dumps to logdir to allow for running
--run testcases.testRestAPI.HostOff.test_obmc_download_dumps
(possibly as an additional component of automation).

Additional issue opened on openbmc:

BMC Capture journal ->
openbmc/phosphor-debug-collector#6

Signed-off-by: Deb McLemore <[email protected]>
  • Loading branch information
debmc committed Dec 13, 2018
1 parent 7d10887 commit eaaf510
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion common/OpTestOpenBMC.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import json
import requests
import cgi
import os

from OpTestSSH import OpTestSSH
from OpTestBMC import OpTestBMC
Expand Down Expand Up @@ -662,7 +663,7 @@ def download_dump(self, dump_id, minutes=BMC_CONST.HTTP_RETRY):
uri = "/download/dump/{}".format(dump_id)
r = self.conf.util_bmc_server.get(uri=uri, stream=True, minutes=minutes)
value, params = cgi.parse_header(r.headers.get('Content-Disposition'))
with open(params.get('filename'), 'wb') as f:
with open(os.path.join(self.conf.logdir, params.get('filename')), 'wb') as f:
f.write(r.content)

def delete_dump(self, dump_id, minutes=BMC_CONST.HTTP_RETRY):
Expand Down

0 comments on commit eaaf510

Please sign in to comment.