예제 #1
0
        public void TestCreateHumboldtClusterWithSshUsernamePassword()
        {
            var handler = new RecordedDelegatingHandler {
                StatusCodeToReturn = HttpStatusCode.OK
            };

            using (var context = UndoContext.Current)
            {
                context.Start();

                var client = HDInsightManagementTestUtilities.GetHDInsightManagementClient(handler);
                var resourceManagementClient = HDInsightManagementTestUtilities.GetResourceManagementClient(handler);
                var resourceGroup            = HDInsightManagementTestUtilities.CreateResourceGroup(resourceManagementClient);

                var          cluster = GetClusterSpecHelpers.GetCustomCreateParametersIaas();
                const string dnsname = "hdisdk-iaasclusternew";

                var createresponse = client.Clusters.Create(resourceGroup, dnsname, cluster);
                Assert.Equal(dnsname, createresponse.Cluster.Name);

                client.Clusters.Get(resourceGroup, dnsname);

                var result = client.Clusters.Delete(resourceGroup, dnsname);
                Assert.Equal(result.StatusCode, HttpStatusCode.OK);
                Assert.Equal(result.State, AsyncOperationState.Succeeded);
            }
        }
예제 #2
0
        public void TestCreateLinuxClusterWithStandardTier()
        {
            var handler = new RecordedDelegatingHandler {
                StatusCodeToReturn = HttpStatusCode.OK
            };

            using (var context = UndoContext.Current)
            {
                context.Start();

                var client = HDInsightManagementTestUtilities.GetHDInsightManagementClient(handler);
                var resourceManagementClient = HDInsightManagementTestUtilities.GetResourceManagementClient(handler);
                var resourceGroup            = HDInsightManagementTestUtilities.CreateResourceGroup(resourceManagementClient);

                var cluster = GetClusterSpecHelpers.GetCustomCreateParametersIaas();
                cluster.ClusterTier = Tier.Standard;
                const string dnsname = "hdisdk-LinuxClusterStandardTest";

                var createresponse = client.Clusters.Create(resourceGroup, dnsname, cluster);
                Assert.Equal(dnsname, createresponse.Cluster.Name);

                var clusterResponse = client.Clusters.Get(resourceGroup, dnsname);
                Assert.Equal(createresponse.Cluster.Properties.ClusterTier, Tier.Standard);
                HDInsightManagementTestUtilities.WaitForClusterToMoveToRunning(resourceGroup, dnsname, client);
                var result = client.Clusters.Delete(resourceGroup, dnsname);
                Assert.Equal(result.StatusCode, HttpStatusCode.OK);
                Assert.Equal(result.State, AsyncOperationState.Succeeded);
            }
        }
예제 #3
0
        private ClusterCreateParameters CreateClusterToValidateScriptActions(string resourceGroup, string dnsName, HDInsightManagementClient client)
        {
            var clusterCreateParams = GetClusterSpecHelpers.GetCustomCreateParametersIaas();

            client.Clusters.Create(resourceGroup, dnsName, clusterCreateParams);

            HDInsightManagementTestUtilities.WaitForClusterToMoveToRunning(resourceGroup, dnsName, client);

            // upload only in record mode
            if (HDInsightManagementTestUtilities.IsRecordMode())
            {
                //upload failing script to the cluster  default storage account
                var defaultStorageAccount = clusterCreateParams.DefaultStorageInfo as AzureStorageInfo;
                var storageAccountName    = defaultStorageAccount.StorageAccountName.Split('.')[0];
                var creds = new StorageCredentials(storageAccountName, defaultStorageAccount.StorageAccountKey);

                var storageAccount = new CloudStorageAccount(creds, true);
                var blobClient     = storageAccount.CreateCloudBlobClient();
                var container      = blobClient.GetContainerReference(FailingScriptLocationContainer);
                container.CreateIfNotExists();
                var blockBlob = container.GetBlockBlobReference("failingscriptaction.sh");

                using (var fileStream = System.IO.File.OpenRead(@"TestData/FailingScriptAction.sh"))
                {
                    blockBlob.UploadFromStream(fileStream);
                }
            }

            return(clusterCreateParams);
        }
        public void TestCreateLinuxDevSkuCluster()
        {
            string clusterName         = "hdisdk-SandboxLinuxClusterTest";
            var    clusterCreateParams = GetClusterSpecHelpers.GetCustomCreateParametersIaas();

            clusterCreateParams.ClusterType = "Sandbox";
            clusterCreateParams.Version     = "3.5";

            ClusterOperations op = new ClusterOperations(new HDInsightManagementClient());
            var extendedParams   = op.GetExtendedClusterCreateParameters(clusterName, clusterCreateParams);

            Assert.Equal(extendedParams.Properties.ComputeProfile.Roles.Count, 1);
            Assert.Equal(extendedParams.Properties.ComputeProfile.Roles[0].HardwareProfile.VmSize, "Standard_D13_V2");
            Assert.Equal(extendedParams.Properties.ComputeProfile.Roles[0].Name, "headnode");
            Assert.Equal(extendedParams.Properties.ComputeProfile.Roles[0].TargetInstanceCount, 1);
        }
        public void TestCreateRserverEdgeNodeSpecified()
        {
            const string edgeNodeSizeToTest = "Standard_D12_v2";

            var clusterCreateParams = GetClusterSpecHelpers.GetCustomCreateParametersIaas();

            clusterCreateParams.ClusterType  = "RServer";
            clusterCreateParams.EdgeNodeSize = edgeNodeSizeToTest;
            clusterCreateParams.Version      = "3.5";

            ClusterOperations op = new ClusterOperations(new HDInsightManagementClient());
            var extendedParams   = op.GetExtendedClusterCreateParameters("hdisdk-RServerClusterEdgeNodeSpecifiedTest", clusterCreateParams);

            List <Role> roles = new List <Role>(extendedParams.Properties.ComputeProfile.Roles);

            ValidateRole(roles, "edgenode", edgeNodeSizeToTest, 1);
        }
        public void TestCreateRserverDefaultNodeSizesValues()
        {
            var clusterCreateParams = GetClusterSpecHelpers.GetCustomCreateParametersIaas();

            clusterCreateParams.ClusterType    = "RServer";
            clusterCreateParams.Version        = "3.5";
            clusterCreateParams.WorkerNodeSize = null;
            clusterCreateParams.HeadNodeSize   = null;

            ClusterOperations op = new ClusterOperations(new HDInsightManagementClient());
            var extendedParams   = op.GetExtendedClusterCreateParameters("hdisdk-RServerClusterEdgeNodeDefaultTest", clusterCreateParams);

            List <Role> roles = new List <Role>(extendedParams.Properties.ComputeProfile.Roles);

            ValidateRole(roles, "headnode", "Standard_D12_v2");
            ValidateRole(roles, "workernode", "Standard_D4_v2", clusterCreateParams.ClusterSizeInNodes);
            ValidateRole(roles, "edgenode", "Standard_D4_v2", 1);
            ValidateRole(roles, "zookeepernode", "Medium");
        }