Exemplo n.º 1
0
        public void DRSR_DRSQuerySitesByCost_cToSites_1_And_rgszToSites_NULL()
        {
            DrsrTestChecker.Check();
            DsSite[] dest = new DsSite[1];
            dest[0] = ((DsServer)EnvironmentConfig.MachineStore[EnvironmentConfig.Machine.WritableDC2]).Site;
            uint ret = drsTestClient.DrsBind(EnvironmentConfig.Machine.WritableDC1, EnvironmentConfig.User.ParentDomainAdmin, DRS_EXTENSIONS_IN_FLAGS.DRS_EXT_BASE);

            BaseTestSite.Assert.AreEqual <uint>(0, ret, null);

            DRS_MSG_QUERYSITESREQ request = drsTestClient.CreateDRS_MSG_QUERYSITESREQ(
                ((DsServer)EnvironmentConfig.MachineStore[EnvironmentConfig.Machine.WritableDC1]).Site.CN,
                1,       //cToSites: Invalid value
                null     //rgszToSites: Invalid value
                );

            uint?outVer;
            DRS_MSG_QUERYSITESREPLY?reply = null;

            BaseTestSite.Log.Add(LogEntryKind.Checkpoint, "Begin to call IDL_DRSQuerySitesByCost");

            ret = drsTestClient.DRSClient.DrsQuerySitesByCost(
                EnvironmentConfig.DrsContextStore[EnvironmentConfig.Machine.WritableDC1],
                (uint)DRS_MSG_QUERYSITESREQ_Versions.V1,
                request,
                out outVer,
                out reply);

            BaseTestSite.Log.Add(LogEntryKind.Checkpoint, "End call IDL_DRSQuerySitesByCost with return value " + ret);
            BaseTestSite.Assert.AreEqual <uint>((uint)Win32ErrorCode_32.ERROR_INVALID_PARAMETER, ret, "IDL_DRSQuerySitesByCost should return ERROR_INVALID_PARAMETER for a request with cToSites = 1, rgszToSites = null");
        }
Exemplo n.º 2
0
        public void DRSR_DRSQuerySitesByCost_fromSite_Invalid()
        {
            DrsrTestChecker.Check();
            DsSite[] dest = new DsSite[1];
            dest[0] = ((DsServer)EnvironmentConfig.MachineStore[EnvironmentConfig.Machine.WritableDC2]).Site;
            uint ret = drsTestClient.DrsBind(EnvironmentConfig.Machine.WritableDC1, EnvironmentConfig.User.ParentDomainAdmin, DRS_EXTENSIONS_IN_FLAGS.DRS_EXT_BASE);

            BaseTestSite.Assert.AreEqual <uint>(0, ret, null);

            string[] sites = new string[dest.Length];
            for (int i = 0; i < dest.Length; i++)
            {
                sites[i] = dest[i].CN;
            }
            DRS_MSG_QUERYSITESREQ request = drsTestClient.CreateDRS_MSG_QUERYSITESREQ(
                "InvalidFromSite",   //fromSite: Invalid value
                (uint)dest.Length,
                sites
                );

            uint?outVer;
            DRS_MSG_QUERYSITESREPLY?reply = null;

            BaseTestSite.Log.Add(LogEntryKind.Checkpoint, "Begin to call IDL_DRSQuerySitesByCost");

            ret = drsTestClient.DRSClient.DrsQuerySitesByCost(
                EnvironmentConfig.DrsContextStore[EnvironmentConfig.Machine.WritableDC1],
                (uint)DRS_MSG_QUERYSITESREQ_Versions.V1,
                request,
                out outVer,
                out reply);

            BaseTestSite.Log.Add(LogEntryKind.Checkpoint, "End call IDL_DRSQuerySitesByCost with return value " + ret);
            BaseTestSite.Assert.AreEqual <uint>((uint)Win32ErrorCode_32.ERROR_DS_OBJ_NOT_FOUND, ret, "IDL_DRSQuerySitesByCost should return ERROR_DS_OBJ_NOT_FOUND for a request with fromSite invalid");
        }
Exemplo n.º 3
0
        public DRS_MSG_QUERYSITESREQ CreateDRS_MSG_QUERYSITESREQ(string pwszFromSite, uint cToSites, string[] rgszToSites)
        {
            DRS_MSG_QUERYSITESREQ_V1 message = new DRS_MSG_QUERYSITESREQ_V1();

            message.pwszFromSite = pwszFromSite;
            message.cToSites     = cToSites;
            message.rgszToSites  = rgszToSites;
            message.dwFlags      = dwFlags_Values.V1;
            DRS_MSG_QUERYSITESREQ request = new DRS_MSG_QUERYSITESREQ();

            request.V1 = message;
            return(request);
        }
Exemplo n.º 4
0
        public void DRSR_DRSQuerySitesByCost_toSite_Invalid()
        {
            DrsrTestChecker.Check();

            uint ret = drsTestClient.DrsBind(EnvironmentConfig.Machine.WritableDC1, EnvironmentConfig.User.ParentDomainAdmin, DRS_EXTENSIONS_IN_FLAGS.DRS_EXT_BASE);

            BaseTestSite.Assert.AreEqual <uint>(0, ret, null);
            string[] destStr = { "abc", "ddd" }; //toSite: Invalid Site
            DRS_MSG_QUERYSITESREQ request = drsTestClient.CreateDRS_MSG_QUERYSITESREQ(
                ((DsServer)EnvironmentConfig.MachineStore[EnvironmentConfig.Machine.WritableDC1]).Site.CN,
                (uint)destStr.Length,
                destStr
                );

            uint?outVer;
            DRS_MSG_QUERYSITESREPLY?reply = null;

            BaseTestSite.Log.Add(LogEntryKind.Checkpoint, "Begin to call IDL_DRSQuerySitesByCost");

            ret = drsTestClient.DRSClient.DrsQuerySitesByCost(
                EnvironmentConfig.DrsContextStore[EnvironmentConfig.Machine.WritableDC1],
                (uint)DRS_MSG_QUERYSITESREQ_Versions.V1,
                request,
                out outVer,
                out reply);

            BaseTestSite.Log.Add(LogEntryKind.Checkpoint, "End call IDL_DRSQuerySitesByCost with return value " + ret);

            BaseTestSite.Assert.AreEqual <uint>(0, ret, null);
            if (ret == 0)
            {
                if (reply.Value.V1.rgCostInfo != null)
                {
                    foreach (DRS_MSG_QUERYSITESREPLYELEMENT_V1 ele in reply.Value.V1.rgCostInfo)
                    {   // chech whether there are error in a success response
                        BaseTestSite.Assert.AreEqual <uint>((uint)Win32ErrorCode_32.ERROR_DS_OBJ_NOT_FOUND, ele.dwErrorCode, "IDL_DRSQuerySitesByCost should return ERROR_DS_OBJ_NOT_FOUND for a request with toSite invalid and dwErrorCode in DRS_MSG_QUERYSITESREPLYELEMENT_V1 should be set 0");
                    }
                }
            }
        }