Ejemplo n.º 1
0
        public void ListContainersTest()
        {
            using (UndoContext context = UndoContext.Current)
            {
                context.Start();

                string resourceNamespace = ConfigurationManager.AppSettings["ResourceNamespace"];

                var client = GetServiceClient<RecoveryServicesBackupManagementClient>(resourceNamespace);

                ProtectionContainerListQueryParams queryParams = new ProtectionContainerListQueryParams();
                queryParams.BackupManagementType = CommonTestHelper.GetSetting(TestConstants.ProviderTypeAzureIaasVM);

                ContainerTestHelper containerTestHelper = new ContainerTestHelper(client);
                ProtectionContainerListResponse response = containerTestHelper.ListContainers(queryParams);

                string containerName = ConfigurationManager.AppSettings["RsVaultIaasV1ContainerUniqueName"]; ;
                Assert.True(
                    response.ItemList.ProtectionContainers.Any(
                        protectionContainer =>
                        {
                            return protectionContainer.Properties.GetType().IsSubclassOf(typeof(AzureIaaSVMProtectionContainer)) &&
                                   protectionContainer.Name.Contains(containerName);
                        }),
                        "Retrieved list of containers doesn't contain AzureIaaSClassicComputeVMProtectionContainer test container");
            }
        }
Ejemplo n.º 2
0
        public void RefreshContainerTest()
        {
            using (UndoContext context = UndoContext.Current)
            {
                context.Start();

                string resourceNamespace = ConfigurationManager.AppSettings["ResourceNamespace"];

                var client = GetServiceClient<RecoveryServicesBackupManagementClient>(resourceNamespace);
                string fabricName = ConfigurationManager.AppSettings["AzureBackupFabricName"];
                ContainerTestHelper containerTestHelper = new ContainerTestHelper(client);
                var response = containerTestHelper.RefreshContainer(fabricName);
            }
        }
Ejemplo n.º 3
0
        public void UnregisterContainersTest()
        {
            using (UndoContext context = UndoContext.Current)
            {
                context.Start();

                string resourceNamespace = ConfigurationManager.AppSettings["ResourceNamespace"];

                var client = GetServiceClient<RecoveryServicesBackupManagementClient>(resourceNamespace);
                ContainerTestHelper containerTestHelper = new ContainerTestHelper(client);
                string mabContainerName = ConfigurationManager.AppSettings["MabContainerName"];
                AzureOperationResponse response = containerTestHelper.UnregisterMABContainer(mabContainerName);
            }               
        }
Ejemplo n.º 4
0
        public void ListContainersTest()
        {
            using (UndoContext context = UndoContext.Current)
            {
                context.Start();

                string resourceNamespace = ConfigurationManager.AppSettings["ResourceNamespace"];

                var client = GetServiceClient<RecoveryServicesBackupManagementClient>(resourceNamespace);
                ProtectionContainerListQueryParams queryParams = new ProtectionContainerListQueryParams();
                queryParams.BackupManagementType = BackupManagementType.MAB.ToString();

                ContainerTestHelper containerTestHelper = new ContainerTestHelper(client);
                ProtectionContainerListResponse response = containerTestHelper.ListMABContainers(queryParams);

                string containerUniqueName = CommonTestHelper.GetSetting(TestConstants.RsVaultMabContainerUniqueName);
                MabProtectionContainer container = response.ItemList.ProtectionContainers[0].Properties as MabProtectionContainer;
                Assert.NotNull(container);
                Assert.Equal(containerUniqueName, container.FriendlyName);
            }
        }