From patchwork Fri Jul 28 15:26:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 9869069 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 6D6076038F for ; Fri, 28 Jul 2017 15:30:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5678B288B2 for ; Fri, 28 Jul 2017 15:30:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4BF43288E6; Fri, 28 Jul 2017 15:30:52 +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 F3D03288DC for ; Fri, 28 Jul 2017 15:30:50 +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 1db7Bg-00050N-96; Fri, 28 Jul 2017 15:28:24 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1db7Be-0004yd-RJ for xen-devel@lists.xenproject.org; Fri, 28 Jul 2017 15:28:22 +0000 Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id 8D/92-02177-6185B795; Fri, 28 Jul 2017 15:28:22 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrHIsWRWlGSWpSXmKPExsXitHSDva5YRHW kwb25/Bbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8bDK1tYC6byVTya+pKpgfEHdxcjJ4eEgL/E 3/ermUFsNgEdiYtzd7J1MXJwiAioSNzeawASZhYIkWg99oUdxBYWiJeYvmoFmM0ioCqxZtYjR hCbV8BKYuGJ6+wQI/Uk3k58ARbnBIo3vpzHCmILCVhK7JvWwwRRLyhxcuYTFoj5mhKt23+zQ9 jyEs1bZzND1CtK9M97wDaBkW8WkpZZSFpmIWlZwMi8ilGjOLWoLLVI19hAL6koMz2jJDcxM0f X0MBULze1uDgxPTUnMalYLzk/dxMjMNTqGRgYdzBOWOV3iFGSg0lJlPemWXWkEF9SfkplRmJx RnxRaU5q8SFGGQ4OJQlesXCgnGBRanpqRVpmDjDoYdISHDxKIrzSYUBp3uKCxNzizHSI1ClGY 44FPRu+MHG8mvD/G5MQS15+XqqUOK8RyCQBkNKM0jy4QbBovMQoKyXMy8jAwCDEU5BalJtZgi r/ilGcg1FJmDceZApPZl4J3L5XQKcwAZ0ysakS5JSSRISUVAPj4ZBEAT2XjtYPa7a+fff07QL vT0KxmWG/3c+eN+ZcNdXzx8eZO/d8bP2cXypYOHVlzuqwiNc5qwuP8ZqoZqRxiTtunfNOJt7l zbyfb8zdhPL/rdwcdqThRuj6HjX/F+/fMPNlf5jjGV18Y8qE+rNviverpuZYP322W9PTxsen+ avEhUbGtqgbSizFGYmGWsxFxYkA9b3oPMECAAA= X-Env-Sender: prvs=375b3df75=roger.pau@citrix.com X-Msg-Ref: server-6.tower-206.messagelabs.com!1501255698!102057352!3 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.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 42227 invoked from network); 28 Jul 2017 15:28:21 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-6.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 28 Jul 2017 15:28:21 -0000 X-IronPort-AV: E=Sophos;i="5.40,425,1496102400"; d="scan'208";a="441766849" From: Roger Pau Monne To: Date: Fri, 28 Jul 2017 16:26:35 +0100 Message-ID: <20170728152637.20301-10-roger.pau@citrix.com> X-Mailer: git-send-email 2.11.0 (Apple Git-81) In-Reply-To: <20170728152637.20301-1-roger.pau@citrix.com> References: <20170728152637.20301-1-roger.pau@citrix.com> MIME-Version: 1.0 Cc: Ian Jackson , Roger Pau Monne Subject: [Xen-devel] [PATCH OSSTEST 09/11] ts-examine-hostprops-save: introduce a script to save properties 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 The introduce script turns the properties stored in the runvars using the format hostprop_$hotname_$prop=$val into host properties stored in the database. Signed-off-by: Roger Pau Monné --- ts-examine-hostprops-save | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 ts-examine-hostprops-save diff --git a/ts-examine-hostprops-save b/ts-examine-hostprops-save new file mode 100755 index 00000000..ce9a643d --- /dev/null +++ b/ts-examine-hostprops-save @@ -0,0 +1,39 @@ +#!/usr/bin/perl -w +# This is part of "osstest", an automated testing framework for Xen. +# Copyright (C) 2017 Citrix Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +use strict qw(vars); +use DBI; +use POSIX; + +unshift @INC, qw(.); +use Osstest; +use Osstest::TestSupport; + +tsreadconfig(); + +exit 0 if intended_blessing() ne "real"; + +logm("setting host properties"); + +foreach my $k (sort keys %r) { + next unless $k =~ m/^hostprop_([^_]*)_([^_]*)$/; + my $hostname= $1; + my $prop=$2; + + logm("recording for $hostname $prop=$r{$k}"); + set_host_property($hostname, $prop, $r{$k}); +}