From patchwork Wed Jun 21 14:13:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 9801933 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 7567760329 for ; Wed, 21 Jun 2017 14:16:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 663DF26222 for ; Wed, 21 Jun 2017 14:16:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5ACA428389; Wed, 21 Jun 2017 14:16:28 +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 0FFCC26222 for ; Wed, 21 Jun 2017 14:16:28 +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 1dNgOf-0004pF-Dk; Wed, 21 Jun 2017 14:14:17 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dNgOd-0004oG-N3 for xen-devel@lists.xenproject.org; Wed, 21 Jun 2017 14:14:15 +0000 Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id 53/05-01999-73F7A495; Wed, 21 Jun 2017 14:14:15 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpgkeJIrShJLcpLzFFi42JxWrrBXtes3iv SYFGXjsX3LZOZHBg9Dn+4whLAGMWamZeUX5HAmrHpzUm2gqOcFR0Tr7E3MDazdzFycEgI+Evc 7LfvYuTkYBPQlWja8pcNJCwioCJxe68BSJhZQFti77q5zCC2sICrxIv565hAbBYBVYnnGy6Ax XkFPCUWzfgOFpcQkJM4f/wnM8gYTgEvicWP/EFMIaCS+af8IEw1ibnr4yEaBSVOznzCArFIQu LgixfMExh5ZyFJzUKSWsDItIpRozi1qCy1SNfYQC+pKDM9oyQ3MTNH19DAVC83tbg4MT01JzG pWC85P3cTIzBk6hkYGHcwTljld4hRkoNJSZS33NsrUogvKT+lMiOxOCO+qDQntfgQowwHh5IE 78laoJxgUWp6akVaZg4weGHSEhw8SiK8a0qA0rzFBYm5xZnpEKlTjIpS4rwnQPoEQBIZpXlwb bCIucQoKyXMy8jAwCDEU5BalJtZgir/ilGcg1FJmPdgDdAUnsy8Erjpr4AWMwEtfnHEA2RxSS JCSqqBkX93CZ/Nch3vwxUnDE3f7q5WeH17wps+yVkX1opZ5K/eFHDXbPsss+zc5cbrVgs9ff9 LbQ2HU0tY3PEpwtdfhL7doXQg6VXj7GWWbL+SnwV43WtWVmuNPhVwvGSL7a1/l7s4FrjF7Yvm YzL6Y7PiVnFpperFMM2Xwi/55kaLl4rsUHXt3mDgpsRSnJFoqMVcVJwIAL19UGGTAgAA X-Env-Sender: prvs=33896ecda=Ian.Jackson@citrix.com X-Msg-Ref: server-12.tower-206.messagelabs.com!1498054452!68161974!2 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.4.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 27326 invoked from network); 21 Jun 2017 14:14:14 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-12.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 21 Jun 2017 14:14:14 -0000 X-IronPort-AV: E=Sophos;i="5.39,369,1493683200"; d="scan'208";a="437315048" From: Ian Jackson To: Date: Wed, 21 Jun 2017 15:13:54 +0100 Message-ID: <1498054447-11281-3-git-send-email-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1498054447-11281-1-git-send-email-ian.jackson@eu.citrix.com> References: <1498054447-11281-1-git-send-email-ian.jackson@eu.citrix.com> MIME-Version: 1.0 Cc: Ian Jackson Subject: [Xen-devel] [OSSTEST PATCH 02/15] TestSupport: Provide controller_ipaddr 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 Signed-off-by: Ian Jackson --- Osstest/TestSupport.pm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index ce9ffaa..8f8013e 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -92,7 +92,7 @@ BEGIN { git_massage_url sshopts authorized_keys - cfg_tftp_di_version + cfg_tftp_di_version controller_ipaddr remote_perl_script_open remote_perl_script_done host_reboot target_reboot target_reboot_hard target_choose_vg target_umount_lv target_await_down @@ -2401,6 +2401,15 @@ sub cfg_tftp_di_version ($) { return $c{"TftpDiVersion_$suite"} // $c{TftpDiVersion}; } +sub controller_ipaddr () { + my $addr = $c{ControllerIpAddress}; + return $addr if defined $addr; + $?=$!=0; my $hn = `hostname -f` // die "$? $!"; + chomp $hn; + my $ip = gethostbyname($hn) // die "$hn ?"; + return inet_ntoa($ip); +} + #---------- webspace for installer ---------- sub await_webspace_fetch_byleaf ($$$$$) {