Ejemplo n.º 1
0
        public static void CheckForAzureStorage()
        {
            if ((UseAadAuthentication && (TableEndpoint == null)) ||
                (!UseAadAuthentication && string.IsNullOrWhiteSpace(DataConnectionString)))
            {
                throw new SkipException("No connection string found. Skipping");
            }

            bool usingLocalWAS = string.Equals(DataConnectionString, "UseDevelopmentStorage=true", StringComparison.OrdinalIgnoreCase);

            if (!usingLocalWAS)
            {
                // Tests are using Azure Cloud Storage, not local WAS emulator.
                ForceTlsVersion();
                return;
            }

            //Starts the storage emulator if not started already and it exists (i.e. is installed).
            if (!StorageEmulator.TryStart())
            {
                string errorMsg = "Azure Storage Emulator could not be started.";
                Console.WriteLine(errorMsg);
                throw new SkipException(errorMsg);
            }
        }
Ejemplo n.º 2
0
 public static void ClassInitialize(TestContext testContext)
 {
     //Starts the storage emulator if not started already and it exists (i.e. is installed).
     if (!StorageEmulator.TryStart())
     {
         Console.WriteLine("Azure Storage Emulator could not be started.");
     }
 }
Ejemplo n.º 3
0
        public override TestCluster CreateTestCluster()
        {
            Assert.True(StorageEmulator.TryStart());
            var options = new TestClusterOptions(NumberOfSilos);

            options.ClusterConfiguration.AddAzureBlobStorageProvider("MemoryStore", "UseDevelopmentStorage=true");
            options.ClusterConfiguration.Globals.DefaultPlacementStrategy    = "ActivationCountBasedPlacement";
            options.ClusterConfiguration.Globals.NumMissedProbesLimit        = 1;
            options.ClusterConfiguration.Globals.NumVotesForDeathDeclaration = 1;
            return(new TestCluster(options));
        }
Ejemplo n.º 4
0
 protected override void ConfigureTestCluster(TestClusterBuilder builder)
 {
     Assert.True(StorageEmulator.TryStart());
     builder.Options.InitialSilosCount = NumberOfSilos;
     builder.ConfigureLegacyConfiguration(legacy =>
     {
         legacy.ClusterConfiguration.Globals.DefaultPlacementStrategy    = "ActivationCountBasedPlacement";
         legacy.ClusterConfiguration.Globals.NumMissedProbesLimit        = 1;
         legacy.ClusterConfiguration.Globals.NumVotesForDeathDeclaration = 1;
     });
 }
Ejemplo n.º 5
0
        public static void ClassInitialize(TestContext testContext)
        {
            TraceLogger.Initialize(new NodeConfiguration());
            TraceLogger.AddTraceLevelOverride("SQLMembershipTableTests", Logger.Severity.Verbose3);

            // Set shorter init timeout for these tests
            OrleansSiloInstanceManager.initTimeout = TimeSpan.FromSeconds(20);

            //Starts the storage emulator if not started already and it exists (i.e. is installed).
            if (!StorageEmulator.TryStart())
            {
                Console.WriteLine("Azure Storage Emulator could not be started.");
            }
        }
Ejemplo n.º 6
0
        public static void CheckForAzureStorage()
        {
            bool usingLocalWAS = string.Equals(TestDefaultConfiguration.DataConnectionString, "UseDevelopmentStorage=true", StringComparison.OrdinalIgnoreCase);

            if (!usingLocalWAS)
            {
                // Tests are using Azure Cloud Storage, not local WAS emulator.
                return;
            }

            //Starts the storage emulator if not started already and it exists (i.e. is installed).
            if (!StorageEmulator.TryStart())
            {
                string errorMsg = "Azure Storage Emulator could not be started.";
                Console.WriteLine(errorMsg);
                throw new SkipException(errorMsg);
            }
        }
Ejemplo n.º 7
0
        public static void CheckForAzureStorage()
        {
            bool usingLocalWAS = StorageTestConstants.UsingAzureLocalStorageEmulator;

            if (!usingLocalWAS)
            {
                // Tests are using Azure Cloud Storage, not local WAS emulator.
                return;
            }

            //Starts the storage emulator if not started already and it exists (i.e. is installed).
            if (!StorageEmulator.TryStart())
            {
                string errorMsg = "Azure Storage Emulator could not be started.";
                Console.WriteLine(errorMsg);
                throw new SkipException(errorMsg);
            }
        }
Ejemplo n.º 8
0
        public async Task ValidateConfiguration_Startup()
        {
            Skip.IfNot(StorageEmulator.TryStart(), "This test explicitly requires the Azure Storage emulator to run");

            var serviceRuntime = new TestServiceRuntimeWrapper();

            serviceRuntime.DeploymentId = "foo";
            serviceRuntime.Settings["DataConnectionString"] = "UseDevelopmentStorage=true";
            serviceRuntime.InstanceName = "name";

            var config = AzureSilo.DefaultConfiguration(serviceRuntime);

            config.AddMemoryStorageProvider();

            AzureSilo orleansAzureSilo = new AzureSilo(serviceRuntime, this.loggerFactory);
            bool      ok = await orleansAzureSilo.ValidateConfiguration(config);

            Assert.True(ok);
        }
Ejemplo n.º 9
0
        public static void CheckForAzureStorage(string dataConnectionString)
        {
            if (string.IsNullOrWhiteSpace(dataConnectionString))
            {
                throw new SkipException("No connection string found. Skipping");
            }

            bool usingLocalWAS = string.Equals(dataConnectionString, "UseDevelopmentStorage=true", StringComparison.OrdinalIgnoreCase);

            if (!usingLocalWAS)
            {
                // Tests are using Azure Cloud Storage, not local WAS emulator.
                return;
            }

            //Starts the storage emulator if not started already and it exists (i.e. is installed).
            if (!StorageEmulator.TryStart())
            {
                throw new SkipException("Azure Storage Emulator could not be started.");
            }
        }
Ejemplo n.º 10
0
 /// <summary>
 /// Tries to ensure the storage emulator is running before the tests start.
 /// </summary>
 /// <remarks>This could perhaps have more functionality.</remarks>
 public bool EnsureEmulatorStorageForTesting()
 {
     return(StorageEmulator.TryStart());
 }
Ejemplo n.º 11
0
        public async Task ValidateConfiguration_Startup_Emulator()
        {
            Skip.IfNot(StorageEmulator.TryStart(), "This test explicitly requires the Azure Storage emulator to run");

            await ValidateConfigurationAtStartup("UseDevelopmentStorage=true");
        }