mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
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:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user