mock gramine's pseudo filesystem for tests? #1492
-
So I want to test some parts of my application that relies on gramines pseudo filesystem, like the quote file or the key pair for opening encrypted files. Currently my program are written in RUST, but it could be something else. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @nmwael! Thanks for the questions.
Does your parts of application to test rely on the exact behaviors of Gramine file systems (e.g., some Gramine-specific peculiarities/limitations)? If so, I think there is no simple way but to use the real Gramine FS. However, if your targeting tests rely only on some (contents of) Gramine-SGX specific files (
What about in your test module, defining a mock type that implements the related traits (e.g., |
Beta Was this translation helpful? Give feedback.
Hi @nmwael! Thanks for the questions.
Does your parts of application to test rely on the exact behaviors of Gramine file systems (e.g., some Gramine-specific peculiarities/limitations)? If so, I think there is no simple way but to use the real Gramine FS.
However, if your targeting tests rely only on some (contents of) Gramine-SGX specific files (
/dev/attestation/quote
or/dev/attestation/keys/xxx
as you mentioned), I think you can simply mock them (pls see below).What about in your test mod…