From patchwork Fri Jun 16 17:56:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 9792513 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 EFB0D60231 for ; Fri, 16 Jun 2017 17:59:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E73D228573 for ; Fri, 16 Jun 2017 17:59:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DBBC52862B; Fri, 16 Jun 2017 17:59:37 +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 40D4F28573 for ; Fri, 16 Jun 2017 17:59:37 +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 1dLvUd-0004vU-1A; Fri, 16 Jun 2017 17:57:11 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLvUb-0004uv-Gf for xen-devel@lists.xenproject.org; Fri, 16 Jun 2017 17:57:09 +0000 Received: from [193.109.254.147] by server-1.bemta-6.messagelabs.com id A5/8A-06719-4FB14495; Fri, 16 Jun 2017 17:57:08 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupnkeJIrShJLcpLzFFi42JxWrohUveLtEu kwaQb/Bbft0xmcmD0OPzhCksAYxRrZl5SfkUCa0b335UsBcd1KvZvvsrUwLhHuYuRk0NCwF/i +arvjCA2m4CBxIrpV4FsDg4RARWJ23sNQMLMAhESL26sYgOxhQUSJLZtfcYKYrMIqEr03FnAA mLzCthKPH60lhlipLzEtHe9rCBjOAXsJH5vLQYJCwGV/F3RyAZhq0ncWLgMqlVQ4uTMJywQqy QkDr54wTyBkXcWktQsJKkFjEyrGDWKU4vKUot0jUz1kooy0zNKchMzc3QNDcz0clOLixPTU3M Sk4r1kvNzNzECA4cBCHYwrloQeIhRkoNJSZT3/RPnSCG+pPyUyozE4oz4otKc1OJDjDIcHEoS vCFSLpFCgkWp6akVaZk5wBCGSUtw8CiJ8O7nA0rzFhck5hZnpkOkTjHqcizo2fCFSYglLz8vV UqcdyLIDAGQoozSPLgRsHi6xCgrJczLCHSUEE9BalFuZgmq/CtGcQ5GJWFeTZApPJl5JXCbXg EdwQR0RNAFB5AjShIRUlINjHKPXErD9kesVXPy2fZR/zFvfPTz3MgP4rVnrE30v2T3GF8VrDj r/FBLajFDKedMywKuVX8uCVZpbvObfj1e7usetrfJa9rcd/l8Oht4RNK9x2lniyjzrLt75dfN 2nmMYaurxxnvF6xKaq5BSWYHTV6t6V5pc4ZjNu/Zrv2n5u6y8b4f6nWSW4mlOCPRUIu5qDgRA JCSG16iAgAA X-Env-Sender: prvs=333b30148=anthony.perard@citrix.com X-Msg-Ref: server-3.tower-27.messagelabs.com!1497635826!107787936!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.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 49270 invoked from network); 16 Jun 2017 17:57:07 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 16 Jun 2017 17:57:07 -0000 X-IronPort-AV: E=Sophos;i="5.39,348,1493683200"; d="scan'208";a="428233299" From: Anthony PERARD To: Date: Fri, 16 Jun 2017 18:56:45 +0100 Message-ID: <20170616175704.7832-2-anthony.perard@citrix.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170616175704.7832-1-anthony.perard@citrix.com> References: <20170616175704.7832-1-anthony.perard@citrix.com> MIME-Version: 1.0 Cc: Anthony PERARD , Ian Jackson Subject: [Xen-devel] [OSSTEST PATCH v11 01/20] 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(+) diff --git a/sg-run-job b/sg-run-job index 4b98e2b..4635b65 100755 --- a/sg-run-job +++ b/sg-run-job @@ -501,6 +501,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 <