From: "Nagaraju Goruganti" <ngorugan@in.ibm.com>
To: openbmc@lists.ozlabs.org
Subject: How to mock journal related methods
Date: Wed, 27 Jun 2018 19:56:36 +0530 [thread overview]
Message-ID: <OFEE0820A1.272DC24E-ON002582B9.004EC9E2-652582B9.004F578B@notes.na.collabserv.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 918 bytes --]
Hi Team,
I am writing unit test-cases to phospher-logging server.
As it gets information form the journal log for event and logging
creation,it needs to make calls to
below given journal related methods:
sd_journal_open(sd_journal**,int)(
https://github.com/openbmc/phosphor-logging/blob/master/log_manager.cpp#L86
)
sd_journal_get_data(sd_journal*,const char *,const void **,size_t) (
https://github.com/openbmc/phosphor-logging/blob/master/log_manager.cpp#L115
)
sd_journal_close(sd_journal *) (
https://github.com/openbmc/phosphor-logging/blob/master/log_manager.cpp#L175
)
I am able make calls to these methods, without any issue, on host
machine(inside x86 sandbox) where we don't have journal service is
running.
Is it the correct way(don't we need to mock these methods) ?
If not, Please someone let me know how to mock these methods?
Thanks and Regards,
Nagaraju G
[-- Attachment #2: Type: text/html, Size: 1936 bytes --]
next reply other threads:[~2018-06-27 14:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-27 14:26 Nagaraju Goruganti [this message]
2018-06-27 15:24 ` How to mock journal related methods Patrick Venture
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=OFEE0820A1.272DC24E-ON002582B9.004EC9E2-652582B9.004F578B@notes.na.collabserv.com \
--to=ngorugan@in.ibm.com \
--cc=openbmc@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).