internal/tests/FailoverStorage.tests.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Describe "[$($Lab.Name)] FailoverStorage" -Tag FailoverStorage {
    Context "Role deployment successful" {
        It "[FailoverStorage] Should return the correct amount of machines" {
            (Get-LabVM -Role FailoverStorage).Count | Should -Be $(Get-Lab).Machines.Where( { $_.Roles.Name -contains 'FailoverStorage' }).Count
        } 

        foreach ($vm in (Get-LabVM -Role FailoverStorage))
        {
            It "[$vm] should have FS-iSCSITarget-Server feature installed" -TestCases @{
                vm = $vm
            } {
                (Get-LabWindowsFeature -ComputerName $vm -FeatureName FS-iSCSITarget-Server -NoDisplay).Installed | Should -Not -Contain $false
            }
        }
    }
}