You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR #328 introduced a small package internal/testenv which is small enough to
be embedded in production code and exports a single function IsTestBinary in
order to prevent access to unit-test only features in production code. The package
requires explicit linker flags to make the function to return true, else it always
returns false.
There may be other places in secboot which would benefit from its use, eg, internal/bootscope exports a function that should only be used in unit tests,
and currently requires a hack to enable it - it requires the unit test code to set
an exported variable which is named in a way to make it clear that it's not for
use in production code.
There are probably other places where it's use is appropriate, but I haven't done
a full audit of the code yet.
The text was updated successfully, but these errors were encountered:
PR #328 introduced a small package
internal/testenv
which is small enough tobe embedded in production code and exports a single function
IsTestBinary
inorder to prevent access to unit-test only features in production code. The package
requires explicit linker flags to make the function to return true, else it always
returns false.
There may be other places in secboot which would benefit from its use, eg,
internal/bootscope
exports a function that should only be used in unit tests,and currently requires a hack to enable it - it requires the unit test code to set
an exported variable which is named in a way to make it clear that it's not for
use in production code.
There are probably other places where it's use is appropriate, but I haven't done
a full audit of the code yet.
The text was updated successfully, but these errors were encountered: