From patchwork Mon Nov 14 12:33:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 9427427 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 3DF4460755 for ; Mon, 14 Nov 2016 12:36:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 37F0B286BB for ; Mon, 14 Nov 2016 12:36:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2CA9828921; Mon, 14 Nov 2016 12:36:40 +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 2D3F3286BB for ; Mon, 14 Nov 2016 12:36:38 +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 1c6GSc-0008Dd-P2; Mon, 14 Nov 2016 12:34:06 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6GSa-0008D6-QB for xen-devel@lists.xen.org; Mon, 14 Nov 2016 12:34:04 +0000 Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id 7B/1B-28947-C3FA9285; Mon, 14 Nov 2016 12:34:04 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprNIsWRWlGSWpSXmKPExsXitHRDpK71es0 Ig1l/lS2WfFzM4sDocXT3b6YAxijWzLyk/IoE1oxJPSsYCz7qVdzeeZexgXG2WhcjJ4eEgL/E uvNzGEFsNgEDiRXTr4LZIgKyEqu75rCD2MwCERIvbqxiA7GFBWIlPpz+A1bDIqAq8fXdVGYQm 1fAVmLm6QZmiJnyEgvPH2HqYuTg4BSwk/jZKwsSFgIq6XzaxQhhq0ncWLiMBaJVUOLkzCcsEK skJA6+eMEM0iohwC3xt9t+AiPfLCRVs5BULWBkWsWoUZxaVJZapGtkrJdUlJmeUZKbmJmja2h grJebWlycmJ6ak5hUrJecn7uJERhQ9QwMjDsY+/b6HWKU5GBSEuWNj9SMEOJLyk+pzEgszogv Ks1JLT7EKMPBoSTB+2ktUE6wKDU9tSItMwcY2jBpCQ4eJRGING9xQWJucWY6ROoUoy7HnlmvH jAJseTl56VKifP+ASkSACnKKM2DGwGLs0uMslLCvIwMDAxCPAWpRbmZJajyrxjFORiVhHlvg0 zhycwrgdv0CugIJqAjdplrgBxRkoiQkmpgdBa13vfixBqRraxTTr/J7buVc9tfWTP6ZVKnjP3 SENX5/gVNfhf+nymoLb8YUnhjym0NPvHEmEmMygndydezv6YymjIbMvGvfWS5/GB6l3R2fMPq VRe/nmCb0P/wn2HGbkdFCZffrc5ctRw3zGP1jpdENKf1flgmvWZHyMzn9y4ZaMjIpIkosRRnJ BpqMRcVJwIA2YDzM64CAAA= X-Env-Sender: prvs=119cd6670=anthony.perard@citrix.com X-Msg-Ref: server-11.tower-31.messagelabs.com!1479126840!39947770!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.0.16; banners=-,-,- X-VirusChecked: Checked Received: (qmail 52397 invoked from network); 14 Nov 2016 12:34:02 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-11.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 14 Nov 2016 12:34:02 -0000 X-IronPort-AV: E=Sophos;i="5.31,638,1473120000"; d="scan'208";a="389341195" From: Anthony PERARD To: Date: Mon, 14 Nov 2016 12:33:32 +0000 Message-ID: <20161114123334.5585-2-anthony.perard@citrix.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161114123334.5585-1-anthony.perard@citrix.com> References: <20161114123334.5585-1-anthony.perard@citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Anthony PERARD , Ian Jackson Subject: [Xen-devel] [OSSTEST PATCH v7 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 --- Changes in V7: - reindent - fix style - remove many workaround, there are not needed anymore. - create bug report upstream Changes in V6: - rebased - fix issues due to new debian and newer devstack: - add missing libvirt group - switch back to old nova-network instead of neutron - have devstack use 'service' instead of 'systemctl' to restart services Only change in V5: - edit stackrc from devstack file to change the hardcoded path DEST No change in V4: - acked Change in V3: - Use host as argument to run the job. - Use selectjob() and get rid of the unused $gho. - Use target_jobdir() instead of builddirsprops(). - Remove GIT_BASE from devstack config. - Rename the script to ts-openstack-deploy (from ts-openstack-devstack). --- sg-run-job | 5 ++ ts-openstack-deploy | 132 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 137 insertions(+) create mode 100755 ts-openstack-deploy diff --git a/sg-run-job b/sg-run-job index 9c3e0ce..7b9296c 100755 --- a/sg-run-job +++ b/sg-run-job @@ -474,6 +474,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..f26963a --- /dev/null +++ b/ts-openstack-deploy @@ -0,0 +1,132 @@ +#!/usr/bin/perl +# This is part of "osstest", an automated testing framework for Xen. +# Copyright (C) 2015 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, 'cinder', $builddir, 'cinder'); + build_clone($ho, 'devstack', $builddir, 'devstack'); + build_clone($ho, 'glance', $builddir, 'glance'); + build_clone($ho, 'keystone', $builddir, 'keystone'); + build_clone($ho, 'nova', $builddir, 'nova'); + build_clone($ho, 'requirements', $builddir, 'requirements'); + build_clone($ho, '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 () { + next if m/install_package.*libvirt.*/; + 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 <