mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-12-05 07:26:56 +00:00
unittests: Fixes hostutil.GetFileType for Windows
GetFileType is meant to return the type of the given file by using os.Stat. However, os.Stat doesn't work on Windows for Unix Sockets, causing an error to occur: [2-Socket Test] unexpected error : CreateFile C:\Users\Administrator\AppData\Local\Temp\test-get-filetype-2776877299\mt.sock: The file cannot be accessed by the system. This is a known issue and we're already using a workaround for this in pkg/kubelet/util/util_windows.go. This commit fixes this issue for GetFileType on Windows.
This commit is contained in:
@@ -119,11 +119,6 @@ func createSocketFile(socketDir string) (string, error) {
|
||||
}
|
||||
|
||||
func TestGetFileType(t *testing.T) {
|
||||
// Skip tests that fail on Windows, as discussed during the SIG Testing meeting from January 10, 2023
|
||||
if goruntime.GOOS == "windows" {
|
||||
t.Skip("Skipping test that fails on Windows")
|
||||
}
|
||||
|
||||
hu := NewHostUtil()
|
||||
|
||||
testCase := []struct {
|
||||
|
||||
Reference in New Issue
Block a user