openbmc.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* UnitTest using the /tmp file system
@ 2021-03-21  4:00 Sunitha Harish
  2021-03-23  5:44 ` Sunitha Harish
  2021-03-27 14:03 ` Patrick Williams
  0 siblings, 2 replies; 7+ messages in thread
From: Sunitha Harish @ 2021-03-21  4:00 UTC (permalink / raw)
  To: openbmc
  Cc: deepak.kodihalli.83, edtanous, bradleyb, gmills, geissonator, ratagupt

Hi,

This is regarding the unit tests in various repos under openbmc like: 
phosphor-bmc-code-management, phosphor-logging, phosphor-networkd, pldm 
etc . I have seen the testcases using the /tmp filesystem to create the 
directories/files when the UT is run.

I followed the similar way of writing the UT in one of my commits 
https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/37352 .  As per 
the review comments in this commit, using the /tmp file system for UT is 
anti-pattern, and this needs to be changed by mocking the same. I agree 
that this is a valid thing to do.

Now this email is to discuss why this was originally done? Can the 
community come-up with a generalized solution for this ?

Thanks & regards,
Sunitha





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-03-29  4:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-21  4:00 UnitTest using the /tmp file system Sunitha Harish
2021-03-23  5:44 ` Sunitha Harish
2021-03-23 15:03   ` Joseph Reynolds
2021-03-24  3:12     ` Lei Yu
2021-03-24  5:07       ` Sunitha Harish
2021-03-27 14:03 ` Patrick Williams
2021-03-29  4:29   ` Sunitha Harish

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).