Esempio n. 1
0
 public static void WaitForACLTakeEffect()
 {
     if (DMLibTestHelper.GetTestAgainst() != TestAgainst.DevFabric)
     {
         Test.Info("Waiting for 30s to ensure the ACL take effect on server side...");
         Thread.Sleep(30 * 1000);
     }
 }
Esempio n. 2
0
        public static bool DisableHttps()
        {
            if (DMLibTestHelper.GetTestAgainst() == TestAgainst.TestTenant)
            {
                return(true);
            }

            return(false);
        }
Esempio n. 3
0
        public string GetEndpointBaseUri(EndpointType endpoint, string protocol, bool secondary = false)
        {
            string url     = string.Empty;
            bool   isHttps = (string.Compare(protocol, "https", StringComparison.OrdinalIgnoreCase) == 0);

            if (DMLibTestHelper.GetTestAgainst() == TestAgainst.DevFabric)
            {
                int    port;
                string host;
                if (endpoint == EndpointType.Blob)
                {
                    port = isHttps ? 10100 : 10000;
                    host = this.Account.BlobEndpoint.Host;
                }
                else if (endpoint == EndpointType.Queue)
                {
                    port = isHttps ? 10101 : 10001;
                    host = this.Account.QueueEndpoint.Host;
                }
                else if (endpoint == EndpointType.Table)
                {
                    port = isHttps ? 10102 : 10002;
                    host = this.Account.TableEndpoint.Host;
                }
                else
                {
                    port = isHttps ? 10104 : 10004;
                    host = this.Account.FileEndpoint.Host;
                }

                url = string.Format(@"{0}://{1}:{2}/{3}", protocol, host, port, this.AccountName);
                if (secondary)
                {
                    Test.Error("DevFabric doesn't have secondary endpoint.");
                }
            }
            else
            {
                Uri endpointUri;
                if (endpoint == EndpointType.Blob)
                {
                    endpointUri = secondary ? this.Account.BlobStorageUri.SecondaryUri : this.Account.BlobStorageUri.PrimaryUri;
                }
                else if (endpoint == EndpointType.Queue)
                {
                    endpointUri = secondary ? this.Account.QueueStorageUri.SecondaryUri : this.Account.QueueStorageUri.PrimaryUri;
                }
                else if (endpoint == EndpointType.Table)
                {
                    endpointUri = secondary ? this.Account.TableStorageUri.SecondaryUri : this.Account.TableStorageUri.PrimaryUri;
                }
                else
                {
                    endpointUri = secondary ? this.Account.FileStorageUri.SecondaryUri : this.Account.FileStorageUri.PrimaryUri;
                }

                url = endpointUri.AbsoluteUri.Replace(endpointUri.Scheme, protocol);
            }

            if (url.EndsWith("/"))
            {
                url = url.Remove(url.Length - 1);
            }

            return(url);
        }