From patchwork Fri Jul 8 18:25:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 9221697 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 3312460467 for ; Fri, 8 Jul 2016 18:29:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2643828375 for ; Fri, 8 Jul 2016 18:29:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1ACE92838D; Fri, 8 Jul 2016 18:29:05 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham 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 E814F28375 for ; Fri, 8 Jul 2016 18:29:03 +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 1bLaUC-0003re-0g; Fri, 08 Jul 2016 18:26:48 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bLaU9-0003pV-Q3 for xen-devel@lists.xenproject.org; Fri, 08 Jul 2016 18:26:45 +0000 Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id C0/F6-11823-560FF775; Fri, 08 Jul 2016 18:26:45 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphkeJIrShJLcpLzFFi42JxWrohUjflQ32 4Qc9vdYvvWyYzOTB6HP5whSWAMYo1My8pvyKBNePv7j+MBfMEKs5M3MPcwLiOt4uRk0NCwF/i wf6vjCA2m4CuRNOWv2xdjBwcIgIqErf3GoCYzAKhEjteWIJUCAsESXxZ2c0OYrMAVdy994IVx OYV8JC4drKXCWKinMT54z+ZQWxOAU+JXUtugtULAdU0/2piBBkpJKAmMXd9PESroMTJmU9YQG xmAQmJgy9eMIOUSAhwS/zttp/AyDcLSdUsJFULGJlWMaoXpxaVpRbpmuglFWWmZ5TkJmbm6Bo amOrlphYXJ6an5iQmFesl5+duYgSGEgMQ7GC81ed8iFGSg0lJlHffs/pwIb6k/JTKjMTijPii 0pzU4kOMMhwcShK8zO+BcoJFqempFWmZOcCghklLcPAoifAygqR5iwsSc4sz0yFSpxgVpcR53 7wDSgiAJDJK8+DaYJF0iVFWSpiXEegQIZ6C1KLczBJU+VeM4hyMSsK8Z0Gm8GTmlcBNfwW0mA losUEA2OKSRISUVANjhobpupMLqjVTlJwq5m6KOn6g9YnW4/cXNc5XtrxfypL+qNv9zaYD0cG sPV0mUUuVg47xKZySV0nYZvVg+nYNho1JxTJnlO3i137n+fmOddbKTeEzJcOe3WR5/+x0swir 1o4unWypYxkaPidjPtdPU1/0ur4uX/XHtIxD79mkf730ezJFNzVKiaU4I9FQi7moOBEA0vjst p8CAAA= X-Env-Sender: prvs=9904f56b2=Ian.Jackson@citrix.com X-Msg-Ref: server-4.tower-206.messagelabs.com!1468002401!49240152!3 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 53700 invoked from network); 8 Jul 2016 18:26:44 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-4.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 8 Jul 2016 18:26:44 -0000 X-IronPort-AV: E=Sophos;i="5.28,331,1464652800"; d="scan'208";a="365150945" From: Ian Jackson To: Date: Fri, 8 Jul 2016 19:25:57 +0100 Message-ID: <1468002385-4407-6-git-send-email-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1468002385-4407-1-git-send-email-ian.jackson@eu.citrix.com> References: <1468002385-4407-1-git-send-email-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Ian Jackson Subject: [Xen-devel] [OSSTEST PATCH 05/33] mg-schema-test-database: Make `daemons' be cleverer 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: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Now you can tell it which daemons to run. This is helpful if you want to run them separately. Signed-off-by: Ian Jackson --- mg-schema-test-database | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/mg-schema-test-database b/mg-schema-test-database index 85cc050..e95b6c5 100755 --- a/mg-schema-test-database +++ b/mg-schema-test-database @@ -27,9 +27,14 @@ # deletes your test database and removes the local-config file # # -# ./mg-schema-test-database daemons [_SUFFIX] +# ./mg-schema-test-database daemons [_SUFFIX] [DAEMON...] # -# synchronously runs owner and queue daemons for your test database +# Synchronously runs owner and queue daemons for your test database. +# If any DAEMON is specified, runs only those daemons. DAEMON +# may be `queue' or `owner'; otherwise it is a command which will +# be broken at spaces, and have `./' prepended if it contains no `/'. +# If any DAEMON contains the string `queue', it causes the data-plan.pl +# to be cleared. # # NB that you can't drop a test database with these daemons running, # because Postgres will refuse to drop a database that anyone is @@ -557,26 +562,36 @@ END #========== DAEMONS ========== daemons) + wantdaemons=() + for arg in "$@"; do case "$arg" in _*) suffix="$arg" ;; - *) fail 'bad usage' ;; + owner|queue) wantdaemons+=("./ms-${arg}daemon") ;; + */*) wantdaemons+=("$arg") ;; + *) wantdaemons+=("./$arg") ;; esac done + if [ "${#wantdaemons[*]}" = 0 ]; then + wantdaemons=(./ms-ownerdaemon ./ms-queuedaemon) + fi + dbname - printf "Running daemons for %s....\n" "$dbname" + printf "Running daemons (${wantdaemons[*]}) for %s....\n" "$dbname" - withtest \ - exec_resetting_sigint ./ms-ownerdaemon & + for d in "${wantdaemons[@]}"; do - sleep 1 + case "$d" in + *queuedaemon*) rm -f data-plan.pl ;; + esac - withtest \ - exec_resetting_sigint ./ms-queuedaemon & + withtest \ + exec_resetting_sigint $d & - rm -f data-plan.pl + sleep 1 + done wait