AksHci.Tests.ps1

ipmo ..\TraceProvider\TraceProvider.psm1 -force
ipmo ..\DownloadSdk\DownloadSdk.psm1 -force
ipmo ..\Moc\Moc.psm1 -force
ipmo ..\Kva\Kva.psm1 -force
ipmo .\AksHci.psm1 -force

Describe 'Test-KubernetesVersionUpdate' {
    It 'Should return false if current and target version are on different majors' {
        Test-KubernetesVersionUpdate -currentVersion "1.24.6" -targetVersion "2.24.7" | should -Be $false
    }

    It 'Should return false if current minor version is greater than target minor' {
        Test-KubernetesVersionUpdate -currentVersion "v1.25.7" -targetVersion "v1.24.9" | should -Be $false
    }

    It 'Should return false if current version is 2 or more minor versions behind targer' {
        Test-KubernetesVersionUpdate -currentVersion "1.23.12" -targetVersion "1.25.7" | should -Be $false
    }

    It 'Should return true if current version is one minor version behind target' {
        Test-KubernetesVersionUpdate -currentVersion "v1.23.12" -targetVersion "v1.24.9" | should -Be $true
    }

    It 'Should return true if current version on the same minor version as target' {
        Test-KubernetesVersionUpdate -currentVersion "1.23.12" -targetVersion "1.23.15" | should -Be $true
    }
}