Exemple #1
0
        private void AssertDrivesAreSame(Drive expected, Drive found)
        {
            if (expected == null)
            {
                Assert.Null(found);
            }
            else
            {
                Assert.True(FabricCommon.ResourceAreSame(expected, found));

                Assert.Equal(expected.StorageNode, found.StorageNode);
                Assert.Equal(expected.SerialNumber, found.SerialNumber);
                Assert.Equal(expected.HealthStatus, found.HealthStatus);
                Assert.Equal(expected.OperationalStatus, found.OperationalStatus);
                Assert.Equal(expected.Usage, found.Usage);
                Assert.Equal(expected.PhysicalLocation, found.PhysicalLocation);
                Assert.Equal(expected.Model, found.Model);
                Assert.Equal(expected.FirmwareVersion, found.FirmwareVersion);
                Assert.Equal(expected.IsIndicationEnabled, found.IsIndicationEnabled);
                Assert.Equal(expected.Manufacturer, found.Manufacturer);
                Assert.Equal(expected.StoragePool, found.StoragePool);
                Assert.Equal(expected.MediaType, found.MediaType);
                Assert.Equal(expected.CapacityGB, found.CapacityGB);
                Assert.Equal(expected.Description, found.Description);
                Assert.Equal(expected.Action, found.Action);
            }
        }
        private void AssertScaleUnitNodesAreSame(ScaleUnitNode expected, ScaleUnitNode found)
        {
            if (expected == null)
            {
                Assert.Null(found);
            }
            else
            {
                Assert.True(FabricCommon.ResourceAreSame(expected, found));

                Assert.Equal(expected.BiosVersion, found.BiosVersion);
                Assert.Equal(expected.BmcAddress, found.BmcAddress);
                Assert.Equal(expected.CanPowerOff, found.CanPowerOff);
                if (expected.Capacity == null)
                {
                    Assert.Null(found.Capacity);
                }
                else
                {
                    Assert.Equal(expected.Capacity.Cores, found.Capacity.Cores);
                    Assert.Equal(expected.Capacity.MemoryGB, found.Capacity.MemoryGB);
                }
                Assert.Equal(expected.Model, found.Model);
                Assert.Equal(expected.PowerState, found.PowerState);
                Assert.Equal(expected.ScaleUnitName, found.ScaleUnitName);
                Assert.Equal(expected.ScaleUnitNodeStatus, found.ScaleUnitNodeStatus);
                Assert.Equal(expected.ScaleUnitUri, found.ScaleUnitUri);
                Assert.Equal(expected.SerialNumber, found.SerialNumber);
                Assert.Equal(expected.Vendor, found.Vendor);
            }
        }
Exemple #3
0
        private void AssertMacAddressPoolsAreSame(MacAddressPool expected, MacAddressPool found)
        {
            if (expected == null)
            {
                Assert.Null(found);
            }
            else
            {
                Assert.True(FabricCommon.ResourceAreSame(expected, found));

                Assert.Equal(expected.NumberOfAllocatedMacAddresses, found.NumberOfAllocatedMacAddresses);
                Assert.Equal(expected.NumberOfAvailableMacAddresses, found.NumberOfAvailableMacAddresses);
                Assert.Equal(expected.StartMacAddress, found.StartMacAddress);
                Assert.Equal(expected.EndMacAddress, found.EndMacAddress);

                if (expected.Metadata != null)
                {
                    Assert.Equal(expected.Metadata.Count, found.Metadata.Count);
                }
                else
                {
                    Assert.Null(found.Metadata);
                }
            }
        }
        private void AssertLogicalSubnetsAreSame(LogicalSubnet expected, LogicalSubnet found)
        {
            if (expected == null)
            {
                Assert.Null(found);
            }
            else
            {
                Assert.True(FabricCommon.ResourceAreSame(expected, found));

                Assert.Equal(expected.IsPublic, found.IsPublic);
                if (expected.IpPools != null)
                {
                    Assert.Equal(expected.IpPools.Count, found.IpPools.Count);
                }
                else
                {
                    Assert.Null(found.IpPools);
                }

                if (expected.Metadata != null)
                {
                    Assert.Equal(expected.Metadata.Count, found.Metadata.Count);
                }
                else
                {
                    Assert.Null(found.Metadata);
                }
            }
        }
        private void AssertLogicalNetworksAreSame(LogicalNetwork expected, LogicalNetwork found)
        {
            if (expected == null)
            {
                Assert.Null(found);
            }
            else
            {
                Assert.True(FabricCommon.ResourceAreSame(expected, found));

                Assert.Equal(expected.NetworkVirtualizationEnabled, found.NetworkVirtualizationEnabled);
                if (expected.Subnets != null)
                {
                    Assert.Equal(expected.Subnets.Count, found.Subnets.Count);
                }
                else
                {
                    Assert.Null(found.Subnets);
                }

                if (expected.Metadata != null)
                {
                    Assert.Equal(expected.Metadata.Count, found.Metadata.Count);
                }
                else
                {
                    Assert.Null(found.Metadata);
                }
            }
        }
Exemple #6
0
 private void AssertStoragePoolsAreSame(StoragePool expected, StoragePool found)
 {
     if (expected == null)
     {
         Assert.Null(found);
     }
     else
     {
         Assert.True(FabricCommon.ResourceAreSame(expected, found));
         Assert.Equal(expected.SizeGB, found.SizeGB);
     }
 }
 private void AssertStorageSystemsAreSame(StorageSystem expected, StorageSystem found)
 {
     if (expected == null)
     {
         Assert.Null(found);
     }
     else
     {
         Assert.True(FabricCommon.ResourceAreSame(expected, found));
         Assert.Equal(expected.TotalCapacityGB, found.TotalCapacityGB);
     }
 }
Exemple #8
0
        private void AssertFileSharesEqual(FileShare expected, FileShare found)
        {
            if (expected == null)
            {
                Assert.Null(found);
            }
            else
            {
                Assert.True(FabricCommon.ResourceAreSame(expected, found));

                Assert.Equal(expected.AssociatedVolume, found.AssociatedVolume);
                Assert.Equal(expected.UncPath, found.UncPath);
            }
        }
Exemple #9
0
 private void AssertStorageSubSystemsAreSame(StorageSubSystem expected, StorageSubSystem found)
 {
     if (expected == null)
     {
         Assert.Null(found);
     }
     else
     {
         Assert.True(FabricCommon.ResourceAreSame(expected, found));
         Assert.Equal(expected.TotalCapacityGB, found.TotalCapacityGB);
         Assert.Equal(expected.RemainingCapacityGB, found.RemainingCapacityGB);
         Assert.Equal(expected.HealthStatus, found.HealthStatus);
         Assert.Equal(expected.OperationalStatus, found.OperationalStatus);
         Assert.Equal(expected.RebalanceStatus, found.RebalanceStatus);
     }
 }
        private void AssertSameEdgeGateway(EdgeGateway expected, EdgeGateway found)
        {
            if (expected == null)
            {
                Assert.Null(found);
            }
            else
            {
                Assert.True(FabricCommon.ResourceAreSame(expected, found));

                Assert.Equal(expected.AvailableCapacity, found.AvailableCapacity);
                Assert.Equal(expected.NumberOfConnections, found.NumberOfConnections);
                Assert.Equal(expected.State, found.State);
                Assert.Equal(expected.TotalCapacity, found.TotalCapacity);
            }
        }
Exemple #11
0
        private void AssertFabricLocationEqual(FabricLocation expected, FabricLocation found)
        {
            if (expected == null)
            {
                Assert.Null(found);
            }
            else
            {
                Assert.True(FabricCommon.ResourceAreSame(expected, found));

                Assert.Equal(expected.Id, found.Id);
                Assert.Equal(expected.Location, found.Location);
                Assert.Equal(expected.Name, found.Name);
                Assert.Equal(expected.Type, found.Type);
            }
        }
        private void AssertInfraRolesAreSame(InfraRole expected, InfraRole found)
        {
            if (expected == null)
            {
                Assert.Null(found);
            }
            else
            {
                Assert.True(FabricCommon.ResourceAreSame(expected, found));

                Assert.Equal(expected.Name, found.Name);
                Assert.Equal(expected.Id, found.Id);
                Assert.Equal(expected.Location, found.Location);
                Assert.Equal(expected.Type, found.Type);
                Assert.Equal(expected.Instances.Count, found.Instances.Count);
            }
        }
        private void AssertIpPoolsAreSame(IpPool expected, IpPool found)
        {
            if (expected == null)
            {
                Assert.Null(found);
            }
            else
            {
                Assert.True(FabricCommon.ResourceAreSame(expected, found));

                Assert.Equal(expected.AddressPrefix, found.AddressPrefix);
                Assert.Equal(expected.EndIpAddress, found.EndIpAddress);
                Assert.Equal(expected.NumberOfAllocatedIpAddresses, found.NumberOfAllocatedIpAddresses);
                Assert.Equal(expected.NumberOfIpAddresses, found.NumberOfIpAddresses);
                Assert.Equal(expected.NumberOfIpAddressesInTransition, found.NumberOfIpAddressesInTransition);
                Assert.Equal(expected.StartIpAddress, found.StartIpAddress);
            }
        }
Exemple #14
0
        private void AssertEdgeGatewayPoolAreSame(EdgeGatewayPool expected, EdgeGatewayPool found)
        {
            if (expected == null)
            {
                Assert.Null(found);
            }
            else
            {
                Assert.True(FabricCommon.ResourceAreSame(expected, found));

                Assert.Equal(expected.Name, found.Name);
                Assert.Equal(expected.Id, found.Id);
                Assert.Equal(expected.Location, found.Location);
                Assert.Equal(expected.GatewayType, found.GatewayType);
                Assert.Equal(expected.PublicIpAddress, found.PublicIpAddress);
                Assert.Equal(expected.NumberOfGateways, found.NumberOfGateways);
            }
        }
Exemple #15
0
        private void AssertVolumesAreSame(Volume expected, Volume found)
        {
            if (expected == null)
            {
                Assert.Null(found);
            }
            else
            {
                Assert.True(FabricCommon.ResourceAreSame(expected, found));

                Assert.Equal(expected.TotalCapacityGB, found.TotalCapacityGB);
                Assert.Equal(expected.RemainingCapacityGB, found.RemainingCapacityGB);
                Assert.Equal(expected.HealthStatus, found.HealthStatus);
                Assert.Equal(expected.OperationalStatus, found.OperationalStatus);
                Assert.Equal(expected.RepairStatus, found.RepairStatus);
                Assert.Equal(expected.Description, found.Description);
                Assert.Equal(expected.Action, found.Action);
                Assert.Equal(expected.VolumeLabel, found.VolumeLabel);
            }
        }
Exemple #16
0
        private void AssertSlbMuxInstancesAreSame(SlbMuxInstance expected, SlbMuxInstance found)
        {
            if (expected == null)
            {
                Assert.Null(found);
            }
            else
            {
                Assert.True(FabricCommon.ResourceAreSame(expected, found));

                if (expected.BgpPeers == null)
                {
                    Assert.Null(found.BgpPeers);
                }
                else
                {
                    Assert.Equal(expected.BgpPeers.Count, found.BgpPeers.Count);
                }
                Assert.Equal(expected.ConfigurationState, found.ConfigurationState);
                Assert.Equal(expected.VirtualServer, found.VirtualServer);
            }
        }
        private void AssertInfraRoleInstancesEqual(InfraRoleInstance expected, InfraRoleInstance found)
        {
            if (expected == null)
            {
                Assert.Null(found);
            }
            else
            {
                Assert.True(FabricCommon.ResourceAreSame(expected, found));

                Assert.Equal(expected.Name, found.Name);
                Assert.Equal(expected.Id, found.Id);
                Assert.Equal(expected.Location, found.Location);

                // Infra Role Instance
                Assert.Equal(expected.ScaleUnit, found.ScaleUnit);
                Assert.Equal(expected.ScaleUnitNode, found.ScaleUnitNode);
                Assert.Equal(expected.Size.Cores, found.Size.Cores);
                Assert.Equal(expected.Size.MemoryGb, found.Size.MemoryGb);
                Assert.Equal(expected.State, found.State);
                Assert.Equal(expected.Type, found.Type);
            }
        }
        private void AssertScaleUnitsAreSame(ScaleUnit expected, ScaleUnit found)
        {
            if (expected == null)
            {
                Assert.Null(found);
            }
            else
            {
                Assert.True(FabricCommon.ResourceAreSame(expected, found));

                Assert.Equal(expected.LogicalFaultDomain, found.LogicalFaultDomain);
                Assert.Equal(expected.Model, found.Model);

                if (expected.Nodes == null)
                {
                    Assert.Null(found.Nodes);
                }
                else
                {
                    Assert.Equal(expected.Nodes.Count, found.Nodes.Count);
                }

                Assert.Equal(expected.ScaleUnitType, found.ScaleUnitType);
                Assert.Equal(expected.State, found.State);

                if (expected.TotalCapacity == null)
                {
                    Assert.Null(found.TotalCapacity);
                }
                else
                {
                    Assert.Equal(expected.TotalCapacity.Cores, found.TotalCapacity.Cores);
                    Assert.Equal(expected.TotalCapacity.MemoryGB, found.TotalCapacity.MemoryGB);
                }
            }
        }