コード例 #1
0
        public void TestAddCommentAfter()
        {
            String           rule1  = "-A INPUT -p tcp ! -f -j DROP -m tcp --sport 53";
            String           rule2  = "-A INPUT -p tcp ! -f -j DROP -m tcp --sport 53 -m comment --comment 'this is a test rule'";
            IpTablesChainSet chains = new IpTablesChainSet(4);

            IpTablesRule irule1 = IpTablesRule.Parse(rule1, null, chains);

            irule1.SetComment("this is a test rule");

            Assert.AreEqual(rule2, irule1.GetActionCommand());
        }