コード例 #1
0
        public void TestListChainsMangle()
        {
            if (IsLinux)
            {
                Assert.AreEqual(0, IptcInterface.RefCount);
                using (IptcInterface iptc = new IptcInterface("mangle", _ipVersion))
                {
                    var chains = iptc.GetChains();
                    Assert.AreNotEqual(0, chains.Count, "Expected atleast one chain");

                    List <String> expectedChains = new List <string>
                    {
                        "PREROUTING",
                        "INPUT",
                        "FORWARD",
                        "OUTPUT",
                        "POSTROUTING"
                    };
                    CollectionAssert.AreEqual(expectedChains, iptc.GetChains(), "first table chain test");

                    //Test repeatable
                    CollectionAssert.AreEqual(expectedChains, iptc.GetChains(), "second table chain test");
                }
                Assert.AreEqual(0, IptcInterface.RefCount);
            }
        }
コード例 #2
0
        public void TestListChainsSimple()
        {
            if (IsLinux)
            {
                IptcInterface iptc = new IptcInterface("filter");

                var chains = iptc.GetChains();
                Assert.AreNotEqual(0, chains.Count, "Expected atleast one chain");
            }
        }
コード例 #3
0
 public void TestListChainsSimple()
 {
     if (IsLinux)
     {
         Assert.AreEqual(0, IptcInterface.RefCount);
         using (IptcInterface iptc = new IptcInterface("filter", _ipVersion))
         {
             var chains = iptc.GetChains();
             Assert.AreNotEqual(0, chains.Count, "Expected atleast one chain");
         }
         Assert.AreEqual(0, IptcInterface.RefCount);
     }
 }
コード例 #4
0
        public void TestListChainsMangle()
        {
            if (IsLinux)
            {
                Assert.AreEqual(0, IptcInterface.RefCount);
                using (IptcInterface iptc = new IptcInterface("mangle", _ipVersion))
                {

                    var chains = iptc.GetChains();
                    Assert.AreNotEqual(0, chains.Count, "Expected atleast one chain");

                    List<String> expectedChains = new List<string>
                    {
                        "PREROUTING",
                        "INPUT",
                        "FORWARD",
                        "OUTPUT",
                        "POSTROUTING"
                    };
                    CollectionAssert.AreEqual(expectedChains, iptc.GetChains(), "first table chain test");

                    //Test repeatable
                    CollectionAssert.AreEqual(expectedChains, iptc.GetChains(), "second table chain test");
                }
                Assert.AreEqual(0, IptcInterface.RefCount);
            }
        }
コード例 #5
0
        public void TestListChainsSimple()
        {
            if (IsLinux)
            {
                Assert.AreEqual(0, IptcInterface.RefCount);
                using (IptcInterface iptc = new IptcInterface("filter", _ipVersion))
                {

                    var chains = iptc.GetChains();
                    Assert.AreNotEqual(0, chains.Count, "Expected atleast one chain");
                }
                Assert.AreEqual(0, IptcInterface.RefCount);
            }
        }
コード例 #6
0
        public void TestListChainsSimple()
        {
            if (IsLinux)
            {
                IptcInterface iptc = new IptcInterface("filter");

                var chains = iptc.GetChains();
                Assert.AreNotEqual(0, chains.Count, "Expected atleast one chain");
            }
        }