コード例 #1
0
        public void CreateClusterWithoutOrchestatorProperties()
        {
            using (var context = MockContext.Start(this.GetType().Name))
                using (var testBase = new MachineLearningComputeTestBase(context, testNamePrefix + "-no-orch-prop"))
                {
                    testBase.CreateResourceGroup();
                    var createdCluster = testBase.CreateClusterWithoutOrchestratorProperties();

                    Assert.NotNull(createdCluster);
                    Assert.Equal(OperationStatus.Succeeded, createdCluster.ProvisioningState);
                }
        }
コード例 #2
0
        public void ListClustersInResourceGroup()
        {
            using (var context = MockContext.Start(this.GetType().Name))
                using (var testBase = new MachineLearningComputeTestBase(context, testNamePrefix + "-list-rg"))
                {
                    var resourceGroup  = testBase.CreateResourceGroup();
                    var createdCluster = testBase.CreateCluster();

                    var clusterNames = testBase.Client.OperationalizationClusters.ListByResourceGroup(resourceGroup.Name).Select(cluster => cluster.Name);

                    Assert.Contains(createdCluster.Name, clusterNames);
                }
        }
コード例 #3
0
        public void DeleteAllResources()
        {
            using (var context = MockContext.Start(this.GetType().Name))
                using (var testBase = new MachineLearningComputeTestBase(context, testNamePrefix + "-deleteall"))
                {
                    var resourceGroup  = testBase.CreateResourceGroup();
                    var createdCluster = testBase.CreateCluster(clusterType: "Local");

                    var deleteResponse = testBase.Client.OperationalizationClusters.Delete(resourceGroup.Name, createdCluster.Name, deleteAll: true);

                    Assert.False(testBase.ResourcesClient.ResourceGroups.CheckExistence(testBase.ManagedByResourceGroupName));
                }
        }
コード例 #4
0
        public void CheckSystemServicesUpdatesAvailable()
        {
            using (var context = MockContext.Start(this.GetType().Name))
                using (var testBase = new MachineLearningComputeTestBase(context, testNamePrefix + "-checkupdate"))
                {
                    var resourceGroup  = testBase.CreateResourceGroup();
                    var createdCluster = testBase.CreateCluster();

                    var updateAvailables = testBase.Client.OperationalizationClusters.CheckSystemServicesUpdatesAvailable(resourceGroup.Name, createdCluster.Name);

                    Assert.NotNull(updateAvailables);
                }
        }
コード例 #5
0
        public void UpdateSystemServices()
        {
            using (var context = MockContext.Start(this.GetType().Name))
                using (var testBase = new MachineLearningComputeTestBase(context, testNamePrefix + "-update"))
                {
                    var resourceGroup  = testBase.CreateResourceGroup();
                    var createdCluster = testBase.CreateCluster();

                    var updateResponse = testBase.Client.OperationalizationClusters.UpdateSystemServices(resourceGroup.Name, createdCluster.Name);

                    Assert.Equal(OperationStatus.Succeeded, updateResponse.UpdateStatus);
                    Assert.NotNull(updateResponse.UpdateStartedOn);
                    Assert.NotNull(updateResponse.UpdateCompletedOn);
                }
        }
コード例 #6
0
        public void DeleteCluster()
        {
            using (var context = MockContext.Start(this.GetType().Name))
                using (var testBase = new MachineLearningComputeTestBase(context, testNamePrefix + "-delete"))
                {
                    var resourceGroup  = testBase.CreateResourceGroup();
                    var createdCluster = testBase.CreateCluster();

                    testBase.Client.OperationalizationClusters.Delete(resourceGroup.Name, createdCluster.Name);

                    var exception = Assert.Throws <ErrorResponseWrapperException>(() => testBase.Client.OperationalizationClusters.Get(resourceGroup.Name, createdCluster.Name));

                    Assert.Contains("NotFound", exception.Message);
                }
        }
コード例 #7
0
        public void GetCluster()
        {
            using (var context = MockContext.Start(this.GetType().Name))
                using (var testBase = new MachineLearningComputeTestBase(context, testNamePrefix + "-get"))
                {
                    var resourceGroup  = testBase.CreateResourceGroup();
                    var createdCluster = testBase.CreateCluster();
                    var fetchedCluster = testBase.Client.OperationalizationClusters.Get(resourceGroup.Name, createdCluster.Name);

                    Assert.NotNull(createdCluster);
                    Assert.NotNull(fetchedCluster);

                    Assert.Equal(createdCluster.Name, fetchedCluster.Name);
                    Assert.Equal(createdCluster.Location, fetchedCluster.Location);
                    Assert.Equal(createdCluster.ClusterType, fetchedCluster.ClusterType);
                    Assert.Equal(createdCluster.Description, fetchedCluster.Description);
                    Assert.Equal(createdCluster.ContainerService.OrchestratorType, fetchedCluster.ContainerService.OrchestratorType);
                }
        }
コード例 #8
0
        public void ListKeys()
        {
            using (var context = MockContext.Start(this.GetType().Name))
                using (var testBase = new MachineLearningComputeTestBase(context, testNamePrefix + "-keys"))
                {
                    var resourceGroup  = testBase.CreateResourceGroup();
                    var createdCluster = testBase.CreateCluster();

                    var keys = testBase.Client.OperationalizationClusters.ListKeys(resourceGroup.Name, createdCluster.Name);

                    Assert.NotNull(keys.StorageAccount.ResourceId);
                    Assert.NotNull(keys.StorageAccount.PrimaryKey);
                    Assert.NotNull(keys.StorageAccount.SecondaryKey);
                    Assert.NotNull(keys.ContainerRegistry.LoginServer);
                    Assert.NotNull(keys.ContainerRegistry.Password);
                    Assert.NotNull(keys.ContainerRegistry.Password2);
                    Assert.NotNull(keys.ContainerRegistry.Username);
                    Assert.NotNull(keys.ContainerService.AcsKubeConfig);
                    Assert.NotNull(keys.ContainerService.ImagePullSecretName);
                }
        }