Make DevicesGroup's "TestingSkipFinalCheck" attribute public

Users would like to have the possibility to skip checks for their
tests the same way they are skipped within the tests in runc.

Not exposing this variable makes it very hard to test components
that use this library. To avoid copying-and-pasting the code
into outside projects this variable sould be exposed to the users.

Signed-off-by: Itamar Holder <iholder@redhat.com>
This commit is contained in:
Itamar Holder
2021-06-07 10:49:01 +03:00
parent 8e7ab26104
commit f9667e633b
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -13,7 +13,7 @@ import (
)
type DevicesGroup struct {
testingSkipFinalCheck bool
TestingSkipFinalCheck bool
}
func (s *DevicesGroup) Name() string {
@@ -90,7 +90,7 @@ func (s *DevicesGroup) Set(path string, r *configs.Resources) error {
//
// This safety-check is skipped for the unit tests because we cannot
// currently mock devices.list correctly.
if !s.testingSkipFinalCheck {
if !s.TestingSkipFinalCheck {
currentAfter, err := loadEmulator(path)
if err != nil {
return err
+1 -1
View File
@@ -29,7 +29,7 @@ func TestDevicesSetAllow(t *testing.T) {
},
}
d := &DevicesGroup{testingSkipFinalCheck: true}
d := &DevicesGroup{TestingSkipFinalCheck: true}
if err := d.Set(path, r); err != nil {
t.Fatal(err)
}