mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-06-09 00:34:10 -04:00
util: add test case for WSL kernel version parsing
This commit is contained in:
parent
4bb434501d
commit
7fcaaa5585
1 changed files with 7 additions and 0 deletions
|
|
@ -46,6 +46,13 @@ func TestGetVersion(t *testing.T) {
|
|||
},
|
||||
expected: version.MajorMinor(5, 4),
|
||||
},
|
||||
{
|
||||
name: "valid microsoft WSL2 kernel version",
|
||||
readFileFunc: func(_ string) ([]byte, error) {
|
||||
return []byte("5.15.146.1-microsoft-standard-WSL2"), nil
|
||||
},
|
||||
expected: version.MajorMinor(5, 15).WithPatch(146),
|
||||
},
|
||||
{
|
||||
name: "failed to read os-release file",
|
||||
readFileFunc: func(_ string) ([]byte, error) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue