Example #1
0
 private static void VerifyPublicIP(string publicIpName, PersistentVM vm1)
 {
     Utilities.ExecuteAndLog(() =>
     {
         var publicIpContext = vmPowershellCmdlets.GetAzurePublicIpName(publicIpName, vm1);
         Console.WriteLine("Public IP Context Properties:");
         Utilities.PrintContext(publicIpContext);
         Console.WriteLine("\n Verifing recquired properties");
         Utilities.LogAssert(() => Assert.AreEqual(publicIpName, publicIpContext.Name), "Public IP Name");
     }, "Verify Public ip of the VM");
 }
Example #2
0
 /// <summary>
 /// Verifies that the properties of the result of Get-azureInternalLoadBalancer is same as expected.
 /// </summary>
 /// <param name="ilbName"></param>
 private void VerifyInternalLoadBalancer(string verificationMessage, InternalLoadBalancerConfig expectedIlbConfig)
 {
     Utilities.ExecuteAndLog(() =>
     {
         var ilbConfig = vmPowershellCmdlets.GetAzureInternalLoadBalancer(serviceName);
         Console.WriteLine("ILB Context Properties:");
         Utilities.PrintContext(ilbConfig);
         Console.WriteLine("\n Verifing recquired properties");
         Utilities.LogAssert(() => Assert.AreEqual(expectedIlbConfig.InternalLoadBalancerName, ilbConfig.InternalLoadBalancerName), "InternalLoadBalancerName");
         Utilities.LogAssert(() => Assert.AreEqual(serviceName, ilbConfig.ServiceName), "ServiceName");
         Utilities.LogAssert(() => Assert.AreEqual(serviceName, ilbConfig.DeploymentName), "DeploymentName");
         Utilities.LogAssert(() => Assert.AreEqual(expectedIlbConfig.IPAddress, ilbConfig.IPAddress), "IPAddress");
         Utilities.LogAssert(() => Assert.AreEqual(expectedIlbConfig.SubnetName, ilbConfig.SubnetName), "SubnetName");
     }, verificationMessage);
 }
Example #3
0
        private void VerifyEndpoint(string verificationMessage, string vmName, AzureEndPointConfigInfo endpointConfig)
        {
            Utilities.ExecuteAndLog(() =>
            {
                var vmRole             = vmPowershellCmdlets.GetAzureVM(vmName, serviceName);
                var endpointCollection = vmPowershellCmdlets.GetAzureEndPoint(vmRole.VM);

                var inputEndpointCollection = from c in endpointCollection where c.Name.Equals(endpointConfig.EndpointName) select c;
                var endpointConfigInfo      = inputEndpointCollection.First();
                Console.WriteLine("Endpoint Configuraion Properties:");
                Utilities.PrintContext(endpointConfigInfo);
                ipAddress = endpointConfigInfo.Vip;
                Console.WriteLine("\n Verifing recquired properties");
                Utilities.LogAssert(() => Assert.AreEqual(string.IsNullOrEmpty(endpointConfig.LBSetName) ? null : endpointConfig.LBSetName, endpointConfigInfo.LBSetName), "LBSetName");
                Utilities.LogAssert(() => Assert.AreEqual(endpointConfig.EndpointLocalPort, endpointConfig.EndpointLocalPort), "EndpointLocalPort");
                Utilities.LogAssert(() => Assert.AreEqual(endpointConfig.EndpointName, endpointConfig.EndpointName), "EndpointName");
                Utilities.LogAssert(() => Assert.AreEqual(endpointConfig.EndpointProtocol, endpointConfig.EndpointProtocol), "EndpointProtocol");
                Utilities.LogAssert(() => Assert.AreEqual(endpointConfig.InternalLoadBalancerName, endpointConfig.InternalLoadBalancerName), "InternalLoadBalancerName");
            }, verificationMessage);
        }
Example #4
0
        /// <summary>
        /// Verify the properties of the reserved ip
        /// </summary>
        /// <param name="input">ReservedIpContext object containing expected values</param>
        private void VerifyReservedIp(ReservedIPContext input)
        {
            var reservedIps = vmPowershellCmdlets.GetAzureReservedIP(input.ReservedIPName);

            if (reservedIps.Count > 0)
            {
                var reservedIpContext = reservedIps[0];
                Utilities.PrintContext(reservedIpContext);
                Utilities.LogAssert(() => Assert.IsFalse(string.IsNullOrEmpty(reservedIpContext.Address)), "Address");
                Utilities.LogAssert(() => Assert.AreEqual(input.Location, reservedIpContext.Location), "Location");
                Utilities.LogAssert(() => Assert.AreEqual(input.ReservedIPName, reservedIpContext.ReservedIPName), "ReservedIPName");
                Utilities.LogAssert(() => Assert.AreEqual(input.State, reservedIpContext.State), "State");
                Utilities.LogAssert(() => Assert.AreEqual(input.DeploymentName, reservedIpContext.DeploymentName), "DeploymentName");
                Utilities.LogAssert(() => Assert.AreEqual(input.InUse, reservedIpContext.InUse), "InUse");
                Utilities.LogAssert(() => Assert.AreEqual(input.ServiceName, reservedIpContext.ServiceName), "ServiceName");
            }
            else
            {
                Assert.Fail("Didnt find reserved ip with name {0}", input.ReservedIPName);
            }
        }
Example #5
0
 private void VerifyDeployment(string verificationMessage, string internalLoadBalancerName = null, string vnet = null)
 {
     Utilities.ExecuteAndLog(() =>
     {
         var deploymentContext = vmPowershellCmdlets.GetAzureDeployment(serviceName);
         Console.WriteLine("Deployment Context Properties:");
         Utilities.PrintContext(deploymentContext);
         Console.WriteLine("\n Verifing recquired properties");
         Utilities.LogAssert(() => Assert.AreEqual(internalLoadBalancerName, deploymentContext.InternalLoadBalancerName), "InternalLoadBalancerName");
         Utilities.LogAssert(() =>
         {
             if (internalLoadBalancerName == null)
             {
                 Assert.AreEqual(deploymentContext.LoadBalancers.Count, 0);
             }
             else
             {
                 Assert.AreEqual(internalLoadBalancerName, deploymentContext.LoadBalancers[0].Name);
             }
         }, "LoadBalancers");
         Utilities.LogAssert(() => Assert.AreEqual(vnet, deploymentContext.VNetName), "VNetName");
     }, verificationMessage);
 }