From patchwork Tue Jul 25 11:57:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 9861865 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 9428C601A1 for ; Tue, 25 Jul 2017 12:01:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E959285F3 for ; Tue, 25 Jul 2017 12:01:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8174E28607; Tue, 25 Jul 2017 12:01:07 +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 77F4428651 for ; Tue, 25 Jul 2017 12:01:02 +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 1dZyTm-0002Ds-J0; Tue, 25 Jul 2017 11:58:22 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dZyTl-0002Bl-N0 for xen-devel@lists.xenproject.org; Tue, 25 Jul 2017 11:58:21 +0000 Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id 49/10-22472-C5237795; Tue, 25 Jul 2017 11:58:20 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprGIsWRWlGSWpSXmKPExsXitHSDvW6MUXm kwYJjwhbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8bXe13sBRN0K87NvMPYwNig0sXIySEh4C+x 4sw6FhCbTcBAYsX0q4xdjBwcIgIqErf3GoCEmQUiJF7cWMUGYgsLJEgcvvUErJxFQFXi4q4/z CA2r4CdxKrGyYwQI+UlJvZOA7M5Bewlfu6/zg5iCwHVbN65AcpWk7ixcBkLRK+gxMmZEDOZBS QkDr54wTyBkXcWktQsJKkFjEyrGDWKU4vKUot0Dc31kooy0zNKchMzc3QNDYz1clOLixPTU3M Sk4r1kvNzNzECQ4cBCHYwvjzteYhRkoNJSZT3m255pBBfUn5KZUZicUZ8UWlOavEhRhkODiUJ 3vUGQDnBotT01Iq0zBxgEMOkJTh4lER4eQ2B0rzFBYm5xZnpEKlTjMYcC3o2fGHieDXh/zcmI Za8/LxUKXHePyCTBEBKM0rz4AbBousSo6yUMC8j0GlCPAWpRbmZJajyrxjFORiVhHmFQRbyZO aVwO17BXQKE9Apc2aUgpxSkoiQkmpgvDq3wS9x0kKjM5obrWTd52fM21yhY1b5b7KM8GbdzqQ 078mzTQ0PCr9cyMr3qWJ9xsoNHrtDbc96hr7b+WRi0IuNvEetdGvk+UVsirN/RTSzPZQ6W/tA 816kksZ+i1Ln/qXPxVfXzf4TIrHqc4vkDZ0NedP+nFvA9Xvlx3umK7eYCYsx5bIKK7EUZyQaa jEXFScCAPur9rGpAgAA X-Env-Sender: prvs=372f2a2d8=anthony.perard@citrix.com X-Msg-Ref: server-15.tower-31.messagelabs.com!1500983896!102969324!4 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 46727 invoked from network); 25 Jul 2017 11:58:20 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-15.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 25 Jul 2017 11:58:20 -0000 X-IronPort-AV: E=Sophos;i="5.40,411,1496102400"; d="scan'208";a="441192825" From: Anthony PERARD To: Date: Tue, 25 Jul 2017 12:57:36 +0100 Message-ID: <20170725115759.21895-2-anthony.perard@citrix.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170725115759.21895-1-anthony.perard@citrix.com> References: <20170725115759.21895-1-anthony.perard@citrix.com> MIME-Version: 1.0 Cc: Anthony PERARD , Ian Jackson Subject: [Xen-devel] [OSSTEST PATCH v13 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 <