mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-11 00:56:14 +00:00
Merge pull request #110931 from claudiubelu/adds-unittests-3
tests: Ports volume unit tests to Windows
This commit is contained in:
@@ -20,6 +20,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
goruntime "runtime"
|
||||
"strings"
|
||||
"sync"
|
||||
"testing"
|
||||
@@ -1269,6 +1270,11 @@ func (fv *FakeVolumePathHandler) GetLoopDevice(path string) (string, error) {
|
||||
// FindEmptyDirectoryUsageOnTmpfs finds the expected usage of an empty directory existing on
|
||||
// a tmpfs filesystem on this system.
|
||||
func FindEmptyDirectoryUsageOnTmpfs() (*resource.Quantity, error) {
|
||||
// The command below does not exist on Windows. Additionally, empty folders have size 0 on Windows.
|
||||
if goruntime.GOOS == "windows" {
|
||||
used, err := resource.ParseQuantity("0")
|
||||
return &used, err
|
||||
}
|
||||
tmpDir, err := utiltesting.MkTmpdir("metrics_du_test")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user