From patchwork Fri Apr 21 10:58:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 9692465 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 B64BB60328 for ; Fri, 21 Apr 2017 11:00:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E11B2860D for ; Fri, 21 Apr 2017 11:00:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 919A12861F; Fri, 21 Apr 2017 11:00:50 +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 CF37D2860D for ; Fri, 21 Apr 2017 11:00:49 +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 1d1WGl-0007Qe-40; Fri, 21 Apr 2017 10:58:31 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d1WGk-0007QQ-1R for xen-devel@lists.xenproject.org; Fri, 21 Apr 2017 10:58:30 +0000 Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id 8C/3A-02183-5D5E9F85; Fri, 21 Apr 2017 10:58:29 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprAIsWRWlGSWpSXmKPExsXitHRDpO6Vpz8 jDNaf0LL4vmUykwOjx+EPV1gCGKNYM/OS8isSWDMOT/7AWLBHr+L0joVsDYz9ql2MnBwSAv4S Zz8dZwOx2QQMJFZMv8rYxcjBISKgInF7rwFImFkgQuLFjVVgJcICYRJvN0xlBLFZBFQl2m+eY QexeQXsJNp6trBBjJSXOLtlJzOIzSlgL3Hu0yOweiGgmtMvvzBD2GoSNxYuY4HoFZQ4OfMJC8 QuCYmDL14wT2DknYUkNQtJagEj0ypGjeLUorLUIl1DY72kosz0jJLcxMwcXUMDY73c1OLixPT UnMSkYr3k/NxNjMDQYQCCHYzbtnseYpTkYFIS5b3a8TNCiC8pP6UyI7E4I76oNCe1+BCjDAeH kgRvwxOgnGBRanpqRVpmDjCIYdISHDxKIrzpIGne4oLE3OLMdIjUKUZdjiutH98zCbHk5eelS onzmoEUCYAUZZTmwY2ARdQlRlkpYV5GoKOEeApSi3IzS1DlXzGKczAqCfNuBZnCk5lXArfpFd ARTEBHnPX7AXJESSJCSqqB8eSijz+3ikv9mX23fJXQ8zrRMwqB7wJPHduV5NN95m/WResN5+7 9+tt+OsupzT5gS/5Z9b9Kq3QOawv9PfTnvbDPZBWpggWNL9ediL/D6PHx7AG+2DcGXgwpz+4E n0qytty26X6mKsvdBzs9+BdxhTVnLmPJq2PcymcZbxV8e+sen7Cy7csXSCuxFGckGmoxFxUnA gBRx7wEowIAAA== X-Env-Sender: prvs=277ef2926=anthony.perard@citrix.com X-Msg-Ref: server-8.tower-31.messagelabs.com!1492772306!96817795!1 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: 9.4.12; banners=-,-,- X-VirusChecked: Checked Received: (qmail 18778 invoked from network); 21 Apr 2017 10:58:28 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-8.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 21 Apr 2017 10:58:28 -0000 X-IronPort-AV: E=Sophos;i="5.37,229,1488844800"; d="scan'208";a="420256180" From: Anthony PERARD To: Date: Fri, 21 Apr 2017 11:58:22 +0100 Message-ID: <20170421105824.22083-2-anthony.perard@citrix.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170421105824.22083-1-anthony.perard@citrix.com> References: <20170421105824.22083-1-anthony.perard@citrix.com> MIME-Version: 1.0 Cc: Anthony PERARD , Ian Jackson Subject: [Xen-devel] [PATCH v10 1/3] ts-openstack-deploy: Deploy OpenStack on a host with devstack 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 This script installs any necessary packages and clones all of the OpenStack trees which are used by devstack to deploy OpenStack. Signed-off-by: Anthony PERARD Acked-by: Ian Jackson --- Changes in V10: - Add 'set -e' to target_cmd* calls - fix edition of functions-libvirt - don't try to install python-systemd, which is not found --- sg-run-job | 5 ++ ts-openstack-deploy | 149 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 154 insertions(+) create mode 100755 ts-openstack-deploy diff --git a/sg-run-job b/sg-run-job index 8e625d9..cd7013e 100755 --- a/sg-run-job +++ b/sg-run-job @@ -492,6 +492,11 @@ proc run-job/test-rumprun {} { ts-guest-destroy-hard host $g + } +proc need-hosts/test-devstack {} { return host } +proc run-job/test-devstack {} { + run-ts . = ts-openstack-deploy + host +} + if {[file exists sg-run-job-adhoc]} { source sg-run-job-adhoc } diff --git a/ts-openstack-deploy b/ts-openstack-deploy new file mode 100755 index 0000000..a1c974f --- /dev/null +++ b/ts-openstack-deploy @@ -0,0 +1,149 @@ +#!/usr/bin/perl +# This is part of "osstest", an automated testing framework for Xen. +# Copyright (C) 2016 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 Osstest; +use Osstest::TestSupport; +use Osstest::BuildSupport; + +tsreadconfig(); +our ($whhost) = @ARGV; +$whhost ||= 'host'; +our $ho = selecthost($whhost); +our $builddir = target_jobdir($ho); + +sub packages () { + target_install_packages($ho, qw(git sudo)); +} +sub checkout () { + prepbuilddirs(); + build_clone($ho, 'openstack_cinder', $builddir, 'cinder'); + build_clone($ho, 'openstack_devstack', $builddir, 'devstack'); + build_clone($ho, 'openstack_glance', $builddir, 'glance'); + build_clone($ho, 'openstack_keystone', $builddir, 'keystone'); + build_clone($ho, 'openstack_nova', $builddir, 'nova'); + build_clone($ho, 'openstack_requirements', $builddir, 'requirements'); + build_clone($ho, 'openstack_tempest', $builddir, 'tempest'); + + my $vg = target_choose_vg($ho, 10*1024); # 10GB + target_putfilecontents_stash($ho, 60, + <) { + next if m/.*libvirt.*/; + print EO or die $!; + } + }); + target_editfile($ho, + "$builddir/devstack/lib/nova_plugins/functions-libvirt", + sub { + while () { + if (m/install_package.*libvirt.*/) { + s#install_package.*#:# + } + print EO or die $!; + } + } + ); + + # Package python-systemd does not exist in Debian installed by osstest + target_editfile($ho, "$builddir/devstack/files/debs/general", sub { + while () { + next if m/^python-systemd$/; + print EO or die $!; + } + }); + + # devstack blindly assume that systemd is used if systemctl is present + # https://bugs.launchpad.net/devstack/+bug/1641112 + target_editfile($ho, "$builddir/devstack/functions-common", sub { + while () { + if (m#\[ -x /bin/systemctl#) { + s#\[ -x /bin/systemctl \]#false# + } + print EO or die $!; + } + }); + + # OpenStack needs access to libvirt from a user. + target_cmd_root($ho, <> /etc/libvirt/libvirtd.conf <