From patchwork Thu Oct 11 09:20:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Yang X-Patchwork-Id: 982360 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=cn.fujitsu.com Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42W50X664bz9sj6 for ; Thu, 11 Oct 2018 20:15:24 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 170CD3E6DCB for ; Thu, 11 Oct 2018 11:15:19 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [IPv6:2001:4b78:1:20::4]) by picard.linux.it (Postfix) with ESMTP id EB47B3E6DC1 for ; Thu, 11 Oct 2018 11:15:16 +0200 (CEST) Received: from heian.cn.fujitsu.com (mail.cn.fujitsu.com [183.91.158.132]) by in-4.smtp.seeweb.it (Postfix) with ESMTP id 733551000D44 for ; Thu, 11 Oct 2018 11:15:14 +0200 (CEST) X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="45944806" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 11 Oct 2018 17:15:09 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id C31B64B71EDC; Thu, 11 Oct 2018 17:15:09 +0800 (CST) Received: from RHEL7U5GA_Intel64.g08.fujitsu.local (10.167.220.156) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 11 Oct 2018 17:15:08 +0800 From: Xiao Yang To: Date: Thu, 11 Oct 2018 17:20:54 +0800 Message-ID: <1539249654-24401-1-git-send-email-yangx.jy@cn.fujitsu.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.167.220.156] X-yoursite-MailScanner-ID: C31B64B71EDC.AC50B X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: yangx.jy@cn.fujitsu.com X-Spam-Status: No, score=0.0 required=7.0 tests=none autolearn=disabled version=3.4.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-4.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-4.smtp.seeweb.it Subject: [LTP] [PATCH] syslog/syslog-lib.sh: Match rsyslog config written by RainerScript X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Since rsyslog commit 3b55048094d759adf8162f0829f239e115ebf2c0, rsyslog by default deletes log socket during restart, unless socket is provided by systemd. If default rsyslog config written by RainerScript uses imjournal module (e.g. module(load="imjournal"...) and doesn't specify $SystemLogSocketName, syslog-lib.sh cannot match imjournal module and just write imuxsock module into the rsyslog.conf constructed by test. In this case, "/dev/log" is owned by journald but rsyslog deletes it as its default log socket after testing. Signed-off-by: Xiao Yang --- testcases/kernel/syscalls/syslog/syslog-lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testcases/kernel/syscalls/syslog/syslog-lib.sh b/testcases/kernel/syscalls/syslog/syslog-lib.sh index 35c13da..30c797a 100755 --- a/testcases/kernel/syscalls/syslog/syslog-lib.sh +++ b/testcases/kernel/syscalls/syslog/syslog-lib.sh @@ -71,7 +71,7 @@ setup() CONFIG_FILE="/etc/syslog-ng/syslog-ng.conf" elif [ "$SYSLOG_DAEMON" = "rsyslog" ]; then CONFIG_FILE="/etc/rsyslog.conf" - if grep -q -r '^\$ModLoad[[:space:]]*imjournal' /etc/rsyslog.conf /etc/rsyslog.d/ ; then + if grep -qri '^[^#].*load.*imjournal' /etc/rsyslog.conf /etc/rsyslog.d/ ; then systemd_journal=$(grep -Ehoi "^[^#].*(imjournal|workdirectory).*" -r /etc/rsyslog.conf /etc/rsyslog.d/) RSYSLOG_CONFIG=$(cat <