From patchwork Thu Oct 11 22:05:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 982748 X-Patchwork-Delegate: petr.vorel@gmail.com 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=suse.cz 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 42WQ5Q0Kg4z9s89 for ; Fri, 12 Oct 2018 09:05:40 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 268193E6DEC for ; Fri, 12 Oct 2018 00:05:37 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [217.194.8.2]) by picard.linux.it (Postfix) with ESMTP id 63E883E6DCC for ; Fri, 12 Oct 2018 00:05:35 +0200 (CEST) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by in-2.smtp.seeweb.it (Postfix) with ESMTPS id 22113600330 for ; Fri, 12 Oct 2018 00:05:34 +0200 (CEST) Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id C42E2AE04; Thu, 11 Oct 2018 22:05:33 +0000 (UTC) From: Petr Vorel To: ltp@lists.linux.it Date: Fri, 12 Oct 2018 00:05:22 +0200 Message-Id: <20181011220525.24628-2-pvorel@suse.cz> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181011220525.24628-1-pvorel@suse.cz> References: <20181011220525.24628-1-pvorel@suse.cz> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-2.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=-0.0 required=7.0 tests=SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-2.smtp.seeweb.it Subject: [LTP] [PATCH 1/4] net/dhcp: Use paths allowed by AppArmor for dnsmasq 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" Fixes for --log-facility and --dhcp-leasefile. Path for log file expects AppArmor commit 025c7dc6 ("dnsmasq: Add permission to open log files"). NOTE: AppArmor optimization isn't needed for dhcpd. Signed-off-by: Petr Vorel --- Changing path to /var/log require root, but we run most of network tests under root anyway, at least for network namespaces. I didn't add TST_NEEDS_ROOT=1, maybe I should. Kind regards, Petr --- testcases/network/dhcp/dnsmasq_tests.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/testcases/network/dhcp/dnsmasq_tests.sh b/testcases/network/dhcp/dnsmasq_tests.sh index ad5885c84..43961f85f 100755 --- a/testcases/network/dhcp/dnsmasq_tests.sh +++ b/testcases/network/dhcp/dnsmasq_tests.sh @@ -9,9 +9,11 @@ dhcp_name="dnsmasq" . dhcp_lib.sh +log="/var/log/tst_dnsmasq.log" + common_opt="--no-hosts --no-resolv --dhcp-authoritative \ - --log-facility=./tst_dnsmasq.log --interface=$iface0 \ - --dhcp-leasefile=tst_dnsmasq.lease --port=0 --conf-file= " + --log-facility=$log --interface=$iface0 \ + --dhcp-leasefile=/var/lib/misc/dnsmasq.tst.leases --port=0 --conf-file= " start_dhcp() { @@ -33,12 +35,12 @@ start_dhcp6() cleanup_dhcp() { - rm -f tst_dnsmasq.log + rm -f $log } print_dhcp_log() { - cat tst_dnsmasq.log + cat $log } print_dhcp_version()