From patchwork Tue Dec 13 06:39:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Rzeszutek Wilk X-Patchwork-Id: 9471751 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E71306021C for ; Tue, 13 Dec 2016 03:33:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D954C2074F for ; Tue, 13 Dec 2016 03:33:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CDE6128156; Tue, 13 Dec 2016 03:33:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.2 required=2.0 tests=BAYES_00, DATE_IN_FUTURE_03_06, RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 828AB2074F for ; Tue, 13 Dec 2016 03:33:10 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGdnT-0004rB-E3; Tue, 13 Dec 2016 03:30:31 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGdnS-0004qm-LC for xen-devel@lists.xenproject.org; Tue, 13 Dec 2016 03:30:30 +0000 Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id C0/E0-19310-55B6F485; Tue, 13 Dec 2016 03:30:29 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmphkeJIrShJLcpLzFFi42LpnVTnqhua7R9 hcGmCnMX3LZOZHBg9Dn+4whLAGMWamZeUX5HAmvHxeXnBIa6K12cmMjYwPmPvYuTiEBLoYJJY tusJlPOFUWL37pfMXYycQM5GRonJD8MhEt2MEksblwElODjYBEwk3qxyBKkREbCVuNc4mxEkz CxQJLHifx1IWFjATGLexxksIDaLgKrEm9v3mUBsXgF3iQf/F4ONlxCQkzh//CeYzSngIfFx+T 0mkDFCQDVzZiZBlBhL9M3qY5nAyLeAkWEVo0ZxalFZapGuoZFeUlFmekZJbmJmjq6hgalebmp xcWJ6ak5iUrFecn7uJkZgiDAAwQ7GvlnOhxglOZiURHnNY/wjhPiS8lMqMxKLM+KLSnNSiw8x ynBwKEnw5mcB5QSLUtNTK9Iyc4DBCpOW4OBREuH9mAGU5i0uSMwtzkyHSJ1i1OWY9mzxUyYhl rz8vFQpcd40kBkCIEUZpXlwI2CRc4lRVkqYlxHoKCGegtSi3MwSVPlXjOIcjErCvBNApvBk5p XAbXoFdAQT0BHP93mDHFGSiJCSamCUflBfZDLhxY9F2kfKAja3PM2zPajMUZWn9sLyR9YCJse /Ii1KXvzRfAWxhoabTR4r997Ml20qvyOZNOv6VeueYAb3mQm3cuVKIlf9T7nStlr1Qd8OuUjH Sn0159dLbq75b9so75xXyfKAgT2DWfNj7BIe7g3RG9VPmWkn1yadr918RuhDnBJLcUaioRZzU XEiADxP7/iXAgAA X-Env-Sender: konrad.wilk@oracle.com X-Msg-Ref: server-3.tower-206.messagelabs.com!1481599826!71467099!1 X-Originating-IP: [141.146.126.69] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjc3MjE4\n X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 23523 invoked from network); 13 Dec 2016 03:30:28 -0000 Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by server-3.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 13 Dec 2016 03:30:28 -0000 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uBD3UPbg016378 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 13 Dec 2016 03:30:26 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.13.8/8.14.4) with ESMTP id uBD3UPrd026212 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 13 Dec 2016 03:30:25 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id uBD3UPvD004433; Tue, 13 Dec 2016 03:30:25 GMT Received: from osstest.dumpdata.com (/209.6.196.81) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 12 Dec 2016 19:30:24 -0800 From: Konrad Rzeszutek Wilk To: xen-devel@lists.xenproject.org, Ian.Jackson@eu.citrix.com Date: Tue, 13 Dec 2016 01:39:49 -0500 Message-Id: <1481611195-105372-4-git-send-email-konrad.wilk@oracle.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1481611195-105372-1-git-send-email-konrad.wilk@oracle.com> References: <1481611195-105372-1-git-send-email-konrad.wilk@oracle.com> X-Source-IP: aserv0021.oracle.com [141.146.126.233] Cc: ross.lagerwall@citrix.com, Marcos.Matsunaga@oracle.com, Konrad Rzeszutek Wilk Subject: [Xen-devel] [PATCH v2 3/9] OssTest: Add target_dir_exists X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP We have target_file_exists but not an equivalant one for directories. This adds it in and is used in the "ts-xen-build: Make {xen|}dist.tar.gz only if $builddir/install/{$xen|}install" patch. Signed-off-by: Konrad Rzeszutek Wilk --- v2: New patch. --- Osstest/TestSupport.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index 2486320..9377af1 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -62,6 +62,7 @@ BEGIN { target_put_guest_image target_editfile target_editfile_cancel target_fetchurl target_editfile_root target_file_exists + target_dir_exists target_editfile_kvp_replace target_run_apt target_install_packages target_install_packages_norec @@ -518,6 +519,14 @@ sub target_file_exists ($$) { die "$rfile $out ?"; } +sub target_dir_exists ($$) { + my ($ho,$rfile) = @_; + my $out= target_cmd_output($ho, "if test -d $rfile; then echo y; fi"); + return 1 if $out =~ m/^y$/; + return 0 if $out !~ m/\S/; + die "$rfile $out ?"; +} + sub next_unique_name ($) { my ($fnref) = @_; my $num = $$fnref =~ s/\+([1-9]\d*)$// ? $1 : 0;