From patchwork Fri Jul 28 13:56:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 9868873 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 D5FBF6035E for ; Fri, 28 Jul 2017 13:59:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7171287B3 for ; Fri, 28 Jul 2017 13:59:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BBE60287C3; Fri, 28 Jul 2017 13:59:47 +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 2A9DE288B7 for ; Fri, 28 Jul 2017 13:59:45 +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 1db5ko-0000G7-BL; Fri, 28 Jul 2017 13:56:34 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1db5km-0000EG-6T for xen-devel@lists.xenproject.org; Fri, 28 Jul 2017 13:56:32 +0000 Received: from [85.158.143.35] by server-9.bemta-6.messagelabs.com id B7/22-03406-F824B795; Fri, 28 Jul 2017 13:56:31 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprGIsWRWlGSWpSXmKPExsXitHRDpG6/U3W kwbteGYvvWyYzOTB6HP5whSWAMYo1My8pvyKBNePrvS72ggm6Fedm3mFsYGxQ6WLk5JAQ8JdY /m4HG4jNJmAgsWL6VcYuRg4OEQEVidt7DUDCzAIREi9urAIrERZIkDjwaw8ziM0ioCrRuXYBE 4jNK2AncWhtDxPESHmJib3TGEFsTgF7ib//voP1CgHVXPr1mAnCVpO4sXAZC0SvoMTJmU9YIH ZJSBx88YJ5AiPvLCSpWUhSCxiZVjFqFKcWlaUW6Rob6yUVZaZnlOQmZuboGhqY6eWmFhcnpqf mJCYV6yXn525iBIYOAxDsYNy5PvAQoyQHk5Io702z6kghvqT8lMqMxOKM+KLSnNTiQ4wyHBxK ErwVjkA5waLU9NSKtMwcYBDDpCU4eJREeF+DpHmLCxJzizPTIVKnGI05FvRs+MLE8WrC/29MQ ix5+XmpUuK8nCClAiClGaV5cINg0XWJUVZKmJcR6DQhnoLUotzMElT5V4ziHIxKwrzHQabwZO aVwO17BXQKE9ApE5sqQU4pSURISTUwJgikuCZNrXf727n7+JFDV356yaqECs3O8VP+VB5R//D OkxsugfW3Ld53LT7QESaVbHYiWXLHAvudNXwbbrzN0Glp505aUfHE/XWTW9Fj9gd/Uve4ZF+L 2dsz41bf6bMBXJJ2Llapk872RK3gertVeXPhWgmlyeZvLOzPi9UwH99jzXw2btEWJZbijERDL eai4kQAsSsesqkCAAA= X-Env-Sender: prvs=3753e7f57=anthony.perard@citrix.com X-Msg-Ref: server-9.tower-21.messagelabs.com!1501250188!75321762!2 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.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 49675 invoked from network); 28 Jul 2017 13:56:31 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-9.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 28 Jul 2017 13:56:31 -0000 X-IronPort-AV: E=Sophos;i="5.40,425,1496102400"; d="scan'208";a="433426620" From: Anthony PERARD To: Date: Fri, 28 Jul 2017 14:56:02 +0100 Message-ID: <20170728135625.30263-2-anthony.perard@citrix.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170728135625.30263-1-anthony.perard@citrix.com> References: <20170728135625.30263-1-anthony.perard@citrix.com> MIME-Version: 1.0 Cc: Anthony PERARD , Ian Jackson Subject: [Xen-devel] [OSSTEST PATCH v14 01/24] 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 --- sg-run-job | 5 ++ ts-openstack-deploy | 148 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 153 insertions(+) create mode 100755 ts-openstack-deploy diff --git a/sg-run-job b/sg-run-job index b1f94f4..6092384 100755 --- a/sg-run-job +++ b/sg-run-job @@ -629,6 +629,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..6f061eb --- /dev/null +++ b/ts-openstack-deploy @@ -0,0 +1,148 @@ +#!/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 <