Пример #1
0
 public static void Where(
     AuthenticationRequirement? authentication = null,
     ClusterTypes? clusterTypes = null,
     string minimumVersion = null,
     string modules = null,
     string storageEngines = null,
     string versionLessThan = null
     )
 {
     Any();
     if (minimumVersion != null)
     {
         CheckMinimumVersion(minimumVersion);
     }
     if (versionLessThan != null)
     {
         CheckVersionLessThan(versionLessThan);
     }
     if (clusterTypes != null)
     {
         CheckClusterTypes(clusterTypes.Value);
     }
     if (modules != null)
     {
         CheckModules(modules);
     }
     if (storageEngines != null)
     {
         CheckStorageEngines(storageEngines);
     }
     if (authentication != null)
     {
         CheckAuthentication(authentication.Value);
     }
 }
Пример #2
0
        private static void CheckClusterTypes(ClusterTypes clusterTypes)
        {
            var clusterType = CoreTestConfiguration.Cluster.Description.Type;

            switch (clusterType)
            {
            case ClusterType.ReplicaSet:
                if ((clusterTypes & ClusterTypes.ReplicaSet) != 0)
                {
                    return;
                }
                break;

            case ClusterType.Sharded:
                if ((clusterTypes & ClusterTypes.Sharded) != 0)
                {
                    return;
                }
                break;

            case ClusterType.Standalone:
                if ((clusterTypes & ClusterTypes.Standalone) != 0)
                {
                    return;
                }
                break;
            }
            throw new SkipTestException($"Test skipped because cluster type is {clusterType} and not {clusterTypes}.");
        }
Пример #3
0
        /// <summary>
        /// Process a single small group cluster. If the cluster has child-clusters then
        /// each child cluster is processed as well. If the cluster has small groups then
        /// pass along the small groups to the ProcessGroup method.
        /// </summary>
        /// <param name="cluster">The GroupCluster to be processed.</param>
        /// <returns>True/false status indicating if a fatal error occurred.</returns>
        Boolean ProcessCluster(GroupCluster cluster)
        {
            //
            // If they have limited the cluster types and this cluster type is not in
            // the list of valid cluster types, then skip it.
            //
            if (ClusterTypes.Length > 0 && ClusterTypes.Contains(cluster.ClusterTypeID) == false)
            {
                return(true);
            }

            if (Debug)
            {
                _message.AppendFormat("Processing cluster '{0}'<br />", cluster.Name);
            }

            //
            // Process each cluster level under this cluster.
            //
            foreach (GroupCluster child in cluster.ChildClusters)
            {
                if (ProcessCluster(child) == false)
                {
                    return(false);
                }
            }

            //
            // Process each small group under this cluster.
            //
            foreach (Group group in cluster.SmallGroups)
            {
                if (ProcessGroup(group) == false)
                {
                    return(false);
                }
            }

            return(true);
        }
Пример #4
0
 private static void CheckClusterTypes(ClusterTypes clusterTypes)
 {
     var clusterType = CoreTestConfiguration.Cluster.Description.Type;
     switch (clusterType)
     {
         case ClusterType.ReplicaSet:
             if ((clusterTypes & ClusterTypes.ReplicaSet) != 0)
             {
                 return;
             }
             break;
         case ClusterType.Sharded:
             if ((clusterTypes & ClusterTypes.Sharded) != 0)
             {
                 return;
             }
             break;
         case ClusterType.Standalone:
             if ((clusterTypes & ClusterTypes.Standalone) != 0)
             {
                 return;
             }
             break;
     }
     throw new SkipTestException($"Test skipped because cluster type is {clusterType} and not {clusterTypes}.");
 }