Ejemplo n.º 1
0
        public void TestCreateCustomization()
        {
            var currentMode = HttpMockServer.Mode;

            HttpMockServer.Mode = HttpRecorderMode.None;

            try
            {
                var commonData = new CommonTestFixture();
                TestDelegatingHandler     handler = new TestDelegatingHandler();
                HDInsightManagementClient client  = GetHDInsightUnitTestingClient(handler);

                client.Clusters.BeginCreate(ResourceGroupName, ClusterName, PrepareClusterCreateParamsForWasb(commonData));
                client.Clusters.BeginCreating(ResourceGroupName, ClusterName, PrepareCustomClusterCreateParamsForWasb(commonData));

                Assert.Equal(handler.Requests[0], handler.Requests[1]);
            }
            finally
            {
                HttpMockServer.Mode = currentMode;
            }
        }
Ejemplo n.º 2
0
        private static ClusterCreateParametersExtended PrepareClusterCreateParamsForWasb(CommonTestFixture commonData)
        {
            var createParams = commonData.PrepareClusterCreateParamsForWasb();

            // Tags
            createParams.Tags = new Dictionary <string, string>();

            // Cluster Definition
            createParams.Properties.ClusterDefinition.ComponentVersion = new Dictionary <string, string>();

            // Storage
            var storageAccount = createParams.Properties.StorageProfile.Storageaccounts.First();

            createParams.Properties.StorageProfile = null;

            // Configurations
            var configurations = (Dictionary <string, Dictionary <string, string> >)createParams.Properties.ClusterDefinition.Configurations;

            createParams.Properties.ClusterDefinition.Configurations = new Dictionary <string, Dictionary <string, string> >
            {
                { ConfigurationKey.CoreSite, GetCoreConfigsForWasb(storageAccount) },
                { ConfigurationKey.Gateway, configurations[ConfigurationKey.Gateway] }
            };

            // Roles
            var headNode    = createParams.Properties.ComputeProfile.Roles.First(role => role.Name == "headnode");
            var clusterType = createParams.Properties.ClusterDefinition.Kind;

            headNode.HardwareProfile.VmSize = DefaultVmSizes.HeadNode.GetSize(clusterType);

            return(createParams);
        }
Ejemplo n.º 3
0
        private static ClusterCreateParameters PrepareCustomClusterCreateParamsForWasb(CommonTestFixture commonData)
        {
            ClusterCreateParameters clusterparams = new ClusterCreateParameters
            {
                ClusterSizeInNodes = 3,
                ClusterType        = "Hadoop",
                WorkerNodeSize     = "Large",
                DefaultStorageInfo = new AzureStorageInfo(commonData.StorageAccountName, commonData.StorageAccountKey, commonData.ContainerName),
                UserName           = commonData.ClusterUserName,
                Password           = commonData.ClusterPassword,
                Location           = commonData.Location,
                SshUserName        = commonData.SshUsername,
                SshPassword        = commonData.SshPassword,
                Version            = "3.6",
                ClusterTier        = Tier.Standard
            };

            return(clusterparams);
        }