Merge pull request #100203 from aojea/countcap
initialise capabilities unit test
This commit is contained in:
		@@ -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{
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user