예제 #1
0
        public void WriteBackRootHintDatafileTest()
        {
            var    target = GetRootHints().FirstOrDefault();
            Server server = ServerTest.GetServer();

            target.WriteBackRootHintDatafile(server);
        }
예제 #2
0
        public static Domain[] GetDomain()
        {
            var server  = ServerTest.GetServer();
            var domains = server.GetDomains();

            return(domains);
        }
예제 #3
0
        public static RootHints[] GetRootHints()
        {
            var server    = ServerTest.GetServer();
            var roothints = server.GetRootHints();

            return(roothints);
        }
예제 #4
0
        public void GetObjectByTextRepresentationTest()
        {
            var aa     = GetRR();
            var server = ServerTest.GetServer();
            var zone   = ZoneTest.GetZone();
            var actual = ResourceRecord.GetObjectByTextRepresentation(server, server.Name, zone.Name, "aa A 192.168.0.1");

            Assert.IsNotNull(actual);
        }
예제 #5
0
        public void ForceRefreshTest()
        {
            //need to test on secondary zones, otherwise it will fail
            var server        = ServerTest.GetServer();
            var secondaryzone = server.GetZones().FirstOrDefault(i => i.ZoneType == Zone.ZoneTypeEnum.Secondary);

            Assert.IsNotNull(secondaryzone, "Need a secondary zone to run this test, please create one and rerun");
            secondaryzone.ForceRefresh();
        }
예제 #6
0
        public static SOAType GetSOARR()
        {
            var server = ServerTest.GetServer();
            var zone   = ZoneTest.GetZone();

            var record = zone.GetRecords().FirstOrDefault(i => i.ResourceRecordType == ResourceRecord.ResourceRecordEnum.SOA);

            return((SOAType)record.UnderlyingRecord);
        }
예제 #7
0
        public void CreateInstanceFromTextRepresentationTest()
        {
            var target = GetRR();

            target.Delete();
            var server = ServerTest.GetServer();
            var zone   = ZoneTest.GetZone();
            var actual = ResourceRecord.CreateInstanceFromTextRepresentation(server, server.Name, zone.Name, "aa A 192.168.0.1");

            Assert.IsNotNull(actual);
        }
예제 #8
0
        public void UpdateFromDSTest()
        {
            var server = ServerTest.GetServer();
            var target = server.GetZones().FirstOrDefault(i => i.DsIntegrated == true);

            if (target == null)
            {
                Assert.Inconclusive("No DsIntegrated zones were found for this test");
            }
            target.UpdateFromDS();
        }
예제 #9
0
        public static Zone ZoneGetReverseZone()
        {
            var server = ServerTest.GetServer();
            var zone   = server.GetZones().FirstOrDefault(i => i.Name == "34.33.167.in-addr.arpa");

            if (zone == null)
            {
                zone = Zone.CreateZone(server, "34.33.167.in-addr.arpa", Zone.ZoneTypeCreate.Primary, false, "", new string[] { "192.168.0.1" }, "*****@*****.**");
            }
            return(zone);
        }
예제 #10
0
        public void CreateDeleteZoneTest()
        {
            var server = ServerTest.GetServer();

            var zonename = Guid.NewGuid().ToString();

            var zone = Zone.CreateZone(server, zonename, Zone.ZoneTypeCreate.Primary, false, string.Empty, new string[] { "192.168.0.1" }, "*****@*****.**");

            Assert.IsNotNull(zone, "Unable to create zone");
            //cleanup
            zone.Delete();
        }
예제 #11
0
        public static TXTType GetTXTRR()
        {
            var server = ServerTest.GetServer();
            var zone   = ZoneTest.GetZone();

            var record = zone.GetRecords().FirstOrDefault(i => i.OwnerName == "txt." + zone.Name);

            if (record == null)
            {
                record = TXTType.CreateInstanceFromPropertyData(server, server.Name, zone.Name, "txt." + zone.Name, DNSManagement.RR.ResourceRecord.RecordClassEnum.IN, null, "descriptivetext1");
            }
            return((TXTType)record.UnderlyingRecord);
        }
예제 #12
0
        public static AAAAType GetAAAARR()
        {
            var server = ServerTest.GetServer();
            var zone   = ZoneTest.GetZone();

            var record = zone.GetRecords().FirstOrDefault(i => i.OwnerName == "aaaa." + zone.Name);

            if (record == null)
            {
                record = AAAAType.CreateInstanceFromPropertyData(server, server.Name, zone.Name, "aaaa." + zone.Name, DNSManagement.RR.ResourceRecord.RecordClassEnum.IN, null, "2002:2ed2:2e40::2ed2:2e40");
            }
            return((AAAAType)record.UnderlyingRecord);
        }
예제 #13
0
        public static AFSDBType GetAFSDBRR()
        {
            var server = ServerTest.GetServer();
            var zone   = ZoneTest.GetZone();

            var record = zone.GetRecords().FirstOrDefault(i => i.OwnerName == "afsdb." + zone.Name);

            if (record == null)
            {
                record = AFSDBType.CreateInstanceFromPropertyData(server, server.Name, zone.Name, "afsdb." + zone.Name, DNSManagement.RR.ResourceRecord.RecordClassEnum.IN, null, AFSDBType.SubtypeEnum.AuthNS, "hello");
            }
            return((AFSDBType)record.UnderlyingRecord);
        }
예제 #14
0
        public static CNAMEType GetCNAMERR()
        {
            var server = ServerTest.GetServer();
            var zone   = ZoneTest.GetZone();

            var record = zone.GetRecords().FirstOrDefault(i => i.OwnerName == "cname." + zone.Name);

            if (record == null)
            {
                record = CNAMEType.CreateInstanceFromPropertyData(server, server.Name, zone.Name, "cname." + zone.Name, DNSManagement.RR.ResourceRecord.RecordClassEnum.IN, null, "primaryname1");
            }
            return((CNAMEType)record.UnderlyingRecord);
        }
예제 #15
0
        public static ISDNType GetISDNRR()
        {
            var server = ServerTest.GetServer();
            var zone   = ZoneTest.GetZone();

            var record = zone.GetRecords().FirstOrDefault(i => i.OwnerName == "isdn." + zone.Name);

            if (record == null)
            {
                record = ISDNType.CreateInstanceFromPropertyData(server, server.Name, zone.Name, "isdn." + zone.Name, DNSManagement.RR.ResourceRecord.RecordClassEnum.IN, null, "123456", "subaddr1");
            }
            return((ISDNType)record.UnderlyingRecord);
        }
예제 #16
0
        public static RPType GetRPRR()
        {
            var server = ServerTest.GetServer();
            var zone   = ZoneTest.GetZone();

            var record = zone.GetRecords().FirstOrDefault(i => i.OwnerName == "rp." + zone.Name);

            if (record == null)
            {
                record = RPType.CreateInstanceFromPropertyData(server, server.Name, zone.Name, "rp." + zone.Name, DNSManagement.RR.ResourceRecord.RecordClassEnum.IN, null, "rpmb", "domain1");
            }
            return((RPType)record.UnderlyingRecord);
        }
예제 #17
0
        public static WINSType GetWINSRR()
        {
            var server = ServerTest.GetServer();
            var zone   = ZoneTest.GetZone();

            var record = zone.GetRecords().FirstOrDefault(i => i.ResourceRecordType == ResourceRecord.ResourceRecordEnum.WINS);

            if (record == null)
            {
                record = WINSType.CreateInstanceFromPropertyData(server, server.Name, zone.Name, zone.Name, DNSManagement.RR.ResourceRecord.RecordClassEnum.IN, null, WINSType.MappingFlagEnum.NonReplication, TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(10), "1.1.1.1");
            }
            return((WINSType)record.UnderlyingRecord);
        }
예제 #18
0
        public static WKSType GetWKSRR()
        {
            var server = ServerTest.GetServer();
            var zone   = ZoneTest.GetZone();

            var record = zone.GetRecords().FirstOrDefault(i => i.OwnerName == "wks." + zone.Name);

            if (record == null)
            {
                record = WKSType.CreateInstanceFromPropertyData(server, server.Name, zone.Name, "wks." + zone.Name, DNSManagement.RR.ResourceRecord.RecordClassEnum.IN, null, "192.168.0.1", "tcp", "finger");
            }
            return((WKSType)record.UnderlyingRecord);
        }
예제 #19
0
        public static MINFOType GetMINFORR()
        {
            var server = ServerTest.GetServer();
            var zone   = ZoneTest.GetZone();

            var record = zone.GetRecords().FirstOrDefault(i => i.OwnerName == "minfo." + zone.Name);

            if (record == null)
            {
                record = MINFOType.CreateInstanceFromPropertyData(server, server.Name, zone.Name, "minfo." + zone.Name, DNSManagement.RR.ResourceRecord.RecordClassEnum.IN, null, "respMailbox", "errMailbox");
                zone.WriteBackZone();
                record = zone.GetRecords().FirstOrDefault(i => i.OwnerName == "minfo." + zone.Name);
            }
            return((MINFOType)record.UnderlyingRecord);
        }
예제 #20
0
        public static MXType GetMXRR()
        {
            var server = ServerTest.GetServer();
            var zone   = ZoneTest.GetZone();

            var record = zone.GetRecords().FirstOrDefault(i => i.OwnerName == "mx." + zone.Name);

            if (record == null)
            {
                record = MXType.CreateInstanceFromPropertyData(server, server.Name, zone.Name, "mx." + zone.Name, DNSManagement.RR.ResourceRecord.RecordClassEnum.IN, null, 1, "mxrec1");
                //workaround for non-standard implementation
                zone.WriteBackZone();
                record = zone.GetRecords().FirstOrDefault(i => i.OwnerName == "mx." + zone.Name);
            }
            return((MXType)record.UnderlyingRecord);
        }
예제 #21
0
        public void ClearCacheTest()
        {
            Server server = ServerTest.GetServer();

            Cache.ClearCache(server);
        }
예제 #22
0
        public static Statistic[] GetStatistic()
        {
            var server = ServerTest.GetServer();

            return(server.GetStatistics());
        }
예제 #23
0
        public static Cache[] GetCache()
        {
            var server = ServerTest.GetServer();

            return(server.GetCache());
        }