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); } }
public void TestListChainsSimple() { if (IsLinux) { IptcInterface iptc = new IptcInterface("filter"); var chains = iptc.GetChains(); Assert.AreNotEqual(0, chains.Count, "Expected atleast one chain"); } }
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); } }
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); } }