github.com/jlmeeker/kismatic@v1.10.1-0.20180612190640-57f9005a1f1a/pkg/inspector/check/free_space_test.go (about) 1 package check 2 3 import ( 4 "math" 5 "testing" 6 ) 7 8 func TestFreeSpaceSmallValue(t *testing.T) { 9 c := FreeSpaceCheck{ 10 MinimumBytes: 1, 11 Path: "/", 12 } 13 ok, _ := c.Check() 14 if !ok { 15 t.Errorf("check returned true for a very small amount of free space") 16 } 17 } 18 19 func TestFreeSpaceEntirelyTooLargeValue(t *testing.T) { 20 c := FreeSpaceCheck{ 21 //note if you are running this test on AWS and they upgrade to zettabyte scale block stores, it will fail. sry my bad. 22 MinimumBytes: uint64(math.Pow(1000, 7)), 23 Path: "/", 24 } 25 ok, _ := c.Check() 26 if ok { 27 t.Errorf("check returned true for a ludicrous amount of free space") 28 } 29 }