initialize capabilities unit test

This commit is contained in:
Antonio Ojea 2021-03-13 01:16:58 +01:00
parent fcee7a0105
commit e37519151b

View File

@ -18,10 +18,17 @@ package capabilities
import ( import (
"reflect" "reflect"
"sync"
"testing" "testing"
) )
func TestGet(t *testing.T) { func TestGet(t *testing.T) {
defer func() {
capInstance.lock.Lock()
defer capInstance.lock.Unlock()
capInstance.capabilities = nil
capInstance.once = sync.Once{}
}()
defaultCap := Capabilities{ defaultCap := Capabilities{
AllowPrivileged: false, AllowPrivileged: false,
PrivilegedSources: PrivilegedSources{ PrivilegedSources: PrivilegedSources{