From a43ae627eeb4f99bb15ed737fd58f0ec15d55dea Mon Sep 17 00:00:00 2001
From: yanghua <yanghua21@huawei.com>
Date: Mon, 6 May 2019 16:28:01 +0800
Subject: [PATCH] Repair test cases gh366 rhbz1514043 rhbz1601610

---
 src/tests/functions.at              | 2 +-
 src/tests/regression/gh366.at       | 1 +
 src/tests/regression/rhbz1514043.at | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/tests/functions.at b/src/tests/functions.at
index d1f3429..243724f 100644
--- a/src/tests/functions.at
+++ b/src/tests/functions.at
@@ -244,7 +244,7 @@ m4_define([NFT_LIST_RULES], [
 m4_define([IPSET_LIST_SET], [
     NS_CHECK([ipset list $1 | TRIM_WHITESPACE |dnl
               grep -v "^\(Revision\|Header\|Size\|References\|Number\)" |dnl
-              awk 'NR <= 4; NR > 4 {print | "sort"}'],
+              awk 'NR <= 3; NR > 3 {print | "sort"}'],
              [$2], [$3], [$4], [$5], [$6])
 ])
 
diff --git a/src/tests/regression/gh366.at b/src/tests/regression/gh366.at
index dd6963f..46307cf 100644
--- a/src/tests/regression/gh366.at
+++ b/src/tests/regression/gh366.at
@@ -22,6 +22,7 @@ ACCEPT udp ::/0 fe80::/64 udp dpt:546 ctstate NEW,UNTRACKED
 ACCEPT udp ::/0 ff02::fb udp dpt:5353 ctstate NEW,UNTRACKED
 ])])])
 
+FWD_CHECK([-q --zone=public --remove-service=mdns])
 FWD_CHECK([-q --zone=public --add-service=mdns])
 check_firewall_backend_output
 FWD_CHECK([-q --zone=public --remove-service=mdns])
diff --git a/src/tests/regression/rhbz1514043.at b/src/tests/regression/rhbz1514043.at
index 4831460..077c007 100644
--- a/src/tests/regression/rhbz1514043.at
+++ b/src/tests/regression/rhbz1514043.at
@@ -3,7 +3,7 @@ FWD_CHECK([-q --set-log-denied=all])
 FWD_CHECK([-q --permanent --zone=public --add-service=samba])
 FWD_RELOAD
 FWD_CHECK([--zone=public --list-all | TRIM | grep ^services], 0, [dnl
-services: ssh dhcpv6-client samba
+services: ssh mdns dhcpv6-client samba
 ])
 dnl check that log denied actually took effect
 m4_if(iptables, FIREWALL_BACKEND, [
-- 
2.19.1

