Esempio n. 1
0
 private void VerifyCluster(Cluster cluster, string name, AzureSku sku, IList <TrustedExternalTenant> trustedExternalTenants, string state)
 {
     Assert.Equal(cluster.Name, name);
     AssetEqualtsSku(cluster.Sku, sku);
     Assert.Equal(state, cluster.State);
     AssetEqualtsExtrnalTenants(cluster.TrustedExternalTenants, trustedExternalTenants);
 }
Esempio n. 2
0
        private void Initialize()
        {
            rgName = TestUtilities.GenerateName("sdktestrg");
            resourcesClient.ResourceGroups.CreateOrUpdate(rgName, new ResourceGroup {
                Location = this.location
            });

            clusterName            = TestUtilities.GenerateName("testcluster");
            databaseName           = TestUtilities.GenerateName("testdatabase");
            eventHubConnectionName = TestUtilities.GenerateName("eventhubConection");

            sku1 = new AzureSku(name: "D13_v2", capacity: 2);
            sku2 = new AzureSku(name: "D14_v2", capacity: 2);

            trustedExternalTenants = new List <TrustedExternalTenant>(1)
            {
                new TrustedExternalTenant(this.tenantId)
            };

            hotCachePeriod1   = TimeSpan.FromDays(2);
            softDeletePeriod1 = TimeSpan.FromDays(4);

            hotCachePeriod2   = TimeSpan.FromDays(3);
            softDeletePeriod2 = TimeSpan.FromDays(6);
            dataFormat        = "CSV";

            cluster            = new Cluster(sku: new AzureSku(name: "D13_v2"), location: this.location, trustedExternalTenants: trustedExternalTenants);
            database           = new Database(location: this.location, softDeletePeriod: softDeletePeriod1, hotCachePeriod: hotCachePeriod1);
            eventhubConnection = new EventHubDataConnection(eventHubResourceId, consumerGroupName, location: this.location);

            databasePrincipal  = GetDatabasePrincipalList(dBprincipalMail, "Admin");
            databasePrincipals = new List <DatabasePrincipal> {
                databasePrincipal
            };
        }
        private void Initialize()
        {
            rgName = TestUtilities.GenerateName("sdktestrg");
            resourcesClient.ResourceGroups.CreateOrUpdate(rgName, new ResourceGroup {
                Location = this.location
            });

            clusterName            = TestUtilities.GenerateName("testcluster");
            databaseName           = TestUtilities.GenerateName("testdatabase");
            eventHubConnectionName = TestUtilities.GenerateName("eventhubConection");

            sku1 = new AzureSku(name: "D13_v2", capacity: 2);
            sku2 = new AzureSku(name: "D14_v2", capacity: 2);

            trustedExternalTenants = new List <TrustedExternalTenant>(1)
            {
                new TrustedExternalTenant(this.tenantId)
            };

            hotCachePeriodInDays1   = 2;
            softDeletePeriodInDays1 = 4;

            hotCachePeriodInDays2   = 3;
            softDeletePeriodInDays2 = 6;

            cluster            = new Cluster(sku: new AzureSku(name: "D13_v2"), location: this.location, trustedExternalTenants: trustedExternalTenants);
            database           = new Database(this.location, softDeletePeriodInDays1, hotCachePeriodInDays: hotCachePeriodInDays1);
            eventhubConnection = new EventHubConnection(eventHubResourceId, consumerGroupName, location: this.location, tableName: tableNameForNestedResources1, mappingRuleName: MappingNameForNestedResources1, dataFormat: dataFormat);
        }
 /// <summary>
 /// Ctor
 /// </summary>
 public CommonTestFixture()
 {
     Location           = "eastus2";
     ResourceGroupName  = TestUtilities.GenerateName("synapsesdkrp");
     StorageAccountName = TestUtilities.GenerateName("synapsesdkstorage");
     SshUsername        = TestUtilities.GenerateName("sshuser");
     SshPassword        = TestUtilities.GenerateName("Password1!");
     DefaultDataLakeStorageFilesystem = TestUtilities.GenerateName("synapsesdkfilesys");
     PerformanceLevel       = "DW200c";
     NodeCount              = 3;
     NodeSize               = "Small";
     SparkVersion           = "2.4";
     AutoScaleMinNodeCount  = 3;
     AutoScaleMaxNodeCount  = 6;
     AutoPauseDelayInMinute = 15;
     StartIpAddress         = "0.0.0.0";
     EndIpAddress           = "255.255.255.255";
     UpdatedStartIpAddress  = "10.0.0.0";
     UpdatedEndIpAddress    = "255.0.0.0";
     KustoSku               = new AzureSku
     {
         Name = "Storage optimized",
         Size = "Medium"
     };
     UpdatedKustoSku = new AzureSku
     {
         Name = "Storage optimized",
         Size = "Large"
     };
     SoftDeletePeriod        = TimeSpan.FromDays(4);
     HotCachePeriod          = TimeSpan.FromDays(2);
     UpdatedSoftDeletePeriod = TimeSpan.FromDays(6);
     UpdatedHotCachePeriod   = TimeSpan.FromDays(3);
 }
        private void VerifyKustoPool(KustoPool kustoPool, string name, AzureSku sku, string state, string workspaceName)
        {
            var poolFullName = GetFullKustoPoolName(workspaceName, name);

            Assert.Equal(kustoPool.Name, poolFullName);
            AssetEqualtsSku(kustoPool.Sku, sku);
            Assert.Equal(state, kustoPool.State);
        }
Esempio n. 6
0
        private void Initialize()
        {
            clusterForEventGridTestResourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupForTest}/providers/Microsoft.Kusto/Clusters/{clusterForEventGridTest}";
            eventHubNamespaceResourceId       = $"/subscriptions/{subscriptionId}/resourceGroups/test-clients-rg/providers/Microsoft.EventHub/namespaces/testclientsns22";
            eventHubResourceId = $"/subscriptions/{subscriptionId}/resourceGroups/test-clients-rg/providers/Microsoft.EventHub/namespaces/testclientsns22/eventhubs/testclientseh";
            storageAccountForEventGridResourceId = $"/subscriptions/{subscriptionId}/resourceGroups/test-clients-rg/providers/Microsoft.Storage/storageAccounts/testclients";
            iotHubResourceId       = $"/subscriptions/{subscriptionId}/resourceGroups/test-clients-rg/providers/Microsoft.Devices/IotHubs/test-clients-iot";
            privateNetworkSubnetId = $"/subscriptions/{subscriptionId}/resourceGroups/test-clients-rg/providers/Microsoft.Network/virtualNetworks/test-clients-vnet/subnets/default";

            rgName = TestUtilities.GenerateName("sdktestrg");
            resourcesClient.ResourceGroups.CreateOrUpdate(rgName, new ResourceGroup {
                Location = location
            });

            clusterName         = TestUtilities.GenerateName("testcluster");
            followerClusterName = TestUtilities.GenerateName("testfollower");
            databaseName        = TestUtilities.GenerateName("testdatabase");
            attachedDatabaseConfigurationName = TestUtilities.GenerateName("testattacheddatabaseconfiguration");
            eventHubConnectionName            = TestUtilities.GenerateName("eventhubConnection");
            eventGridConnectinoName           = TestUtilities.GenerateName("eventGridConnection");
            iotHubConnectionName          = TestUtilities.GenerateName("iothubConnection");
            privateEndpointConnectionName = TestUtilities.GenerateName("privateendpointname");
            managedPrivateEndpointName    = TestUtilities.GenerateName("managedprivateendpointname");

            sku1 = new AzureSku(name: "Standard_D13_v2", "Standard", capacity: 2);
            sku2 = new AzureSku(name: "Standard_D14_v2", "Standard", capacity: 2);

            trustedExternalTenants = new List <TrustedExternalTenant>(1)
            {
                new TrustedExternalTenant(this.tenantId)
            };

            hotCachePeriod1   = TimeSpan.FromDays(2);
            softDeletePeriod1 = TimeSpan.FromDays(4);

            hotCachePeriod2   = TimeSpan.FromDays(3);
            softDeletePeriod2 = TimeSpan.FromDays(6);

            cluster                 = new Cluster(sku: new AzureSku(name: "Standard_D13_v2", "Standard", 2), location: location, trustedExternalTenants: trustedExternalTenants, identity: new Identity(IdentityType.SystemAssigned));
            followerCluster         = new Cluster(sku: new AzureSku(name: "Standard_D13_v2", "Standard", 2), location: location, trustedExternalTenants: trustedExternalTenants);
            database                = new ReadWriteDatabase(location: location, softDeletePeriod: softDeletePeriod1, hotCachePeriod: hotCachePeriod1);
            eventhubConnection      = new EventHubDataConnection(eventHubResourceId, consumerGroupName, location: location);
            eventGridDataConnection = new EventGridDataConnection(storageAccountForEventGridResourceId, eventHubResourceId, consumerGroupName, tableName: tableName, dataFormat: dataFormat, location: location);
            iotHubDataConnection    = new IotHubDataConnection(iotHubResourceId, consumerGroupName, sharedAccessPolicyNameForIotHub, location: location);
            script = new Script(scriptUrl: scriptUrl, scriptUrlSasToken: scriptUrlSasToken, forceUpdateTag: forceUpdateTag, continueOnErrors: continueOnErrors);

            databasePrincipal  = GetDatabasePrincipalList(dBprincipalMail, "Admin");
            databasePrincipals = new List <DatabasePrincipal> {
                databasePrincipal
            };

            var leaderClusterResourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{rgName}/providers/Microsoft.Kusto/Clusters/{clusterName}";

            attachedDatabaseConfiguration = new AttachedDatabaseConfiguration(location: this.location, databaseName: databaseName, clusterResourceId: leaderClusterResourceId, defaultPrincipalsModificationKind: defaultPrincipalsModificationKind);
            keyVaultProperties            = new KeyVaultProperties(KeyNameForKeyVaultPropertiesTest, KeyVersionForKeyVaultPropertiesTest, KeyVaultUriForKeyVaultPropertiesTest);
        }
        private void Initialize()
        {
            rgName = TestUtilities.GenerateName("sdktestrg");
            resourcesClient.ResourceGroups.CreateOrUpdate(rgName, new ResourceGroup {
                Location = this.location
            });

            clusterName         = TestUtilities.GenerateName("testcluster");
            followerClusterName = TestUtilities.GenerateName("testfollower");
            databaseName        = TestUtilities.GenerateName("testdatabase");
            attachedDatabaseConfigurationName = TestUtilities.GenerateName("testattacheddatabaseconfiguration");
            eventHubConnectionName            = TestUtilities.GenerateName("eventhubConnection");
            eventGridConnectinoName           = TestUtilities.GenerateName("eventGridConnection");
            iotHubConnectionName = TestUtilities.GenerateName("iothubConnection");
            scriptName           = "dor";


            sku1 = new AzureSku(name: "Standard_D13_v2", "Standard", capacity: 2);
            sku2 = new AzureSku(name: "Standard_D14_v2", "Standard", capacity: 2);

            trustedExternalTenants = new List <TrustedExternalTenant>(1)
            {
                new TrustedExternalTenant(this.tenantId)
            };

            hotCachePeriod1   = TimeSpan.FromDays(2);
            softDeletePeriod1 = TimeSpan.FromDays(4);

            hotCachePeriod2   = TimeSpan.FromDays(3);
            softDeletePeriod2 = TimeSpan.FromDays(6);
            dataFormat        = "CSV";

            defaultPrincipalsModificationKind = "Replace";

            cluster                 = new Cluster(sku: new AzureSku(name: "Standard_D13_v2", "Standard", 2), location: this.location, trustedExternalTenants: trustedExternalTenants);
            followerCluster         = new Cluster(sku: new AzureSku(name: "Standard_D13_v2", "Standard", 2), location: this.location, trustedExternalTenants: trustedExternalTenants);
            database                = new ReadWriteDatabase(location: this.location, softDeletePeriod: softDeletePeriod1, hotCachePeriod: hotCachePeriod1);
            eventhubConnection      = new EventHubDataConnection(eventHubResourceId, consumerGroupName, location: this.location);
            eventGridDataConnection = new EventGridDataConnection(storageAccountForEventGridResourceId, eventHubResourceId, consumerGroupName, tableName: tableName, dataFormat: dataFormat, location: location);
            iotHubDataConnection    = new IotHubDataConnection(iotHubResourceId, consumerGroupName, sharedAccessPolicyNameForIotHub, location: location);
            script = new Script(scriptUrl, scriptUrlSasToken, forceUpdateTag: forceUpdateTag, continueOnErrors: continueOnErrors);

            databasePrincipal  = GetDatabasePrincipalList(dBprincipalMail, "Admin");
            databasePrincipals = new List <DatabasePrincipal> {
                databasePrincipal
            };

            var leaderClusterResourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{rgName}/providers/Microsoft.Kusto/Clusters/{clusterName}";

            attachedDatabaseConfiguration = new AttachedDatabaseConfiguration(location: this.location, databaseName: databaseName, clusterResourceId: leaderClusterResourceId, defaultPrincipalsModificationKind: defaultPrincipalsModificationKind);

            keyVaultProperties = new KeyVaultProperties(KeyNameForKeyVaultPropertiesTest, KeyVaultUriForKeyVaultPropertiesTest, KeyVersionForKeyVaultPropertiesTest);
        }
Esempio n. 8
0
 private void AssetEqualtsSku(AzureSku sku1, AzureSku sku2)
 {
     Assert.Equal(sku1.Capacity, sku2.Capacity);
     Assert.Equal(sku1.Name, sku2.Name);
 }
 private void AssetEqualtsSku(AzureSku sku1, AzureSku sku2)
 {
     Assert.Equal(sku1.Size, sku2.Size);
     Assert.Equal(sku1.Name, sku2.Name);
 }