From patchwork Thu Nov 24 18:14:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 9446157 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 4EA766071C for ; Thu, 24 Nov 2016 18:16:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4175C280CF for ; Thu, 24 Nov 2016 18:16:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 367B8280F4; Thu, 24 Nov 2016 18:16:55 +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 3F18C280CF for ; Thu, 24 Nov 2016 18:16:51 +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 1c9yXY-0005bz-7H; Thu, 24 Nov 2016 18:14:32 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c9yXW-0005ay-Nu for xen-devel@lists.xen.org; Thu, 24 Nov 2016 18:14:30 +0000 Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id 49/7D-22495-60E27385; Thu, 24 Nov 2016 18:14:30 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprAIsWRWlGSWpSXmKPExsXitHSDvS6rnnm EQcNfIYslHxezODB6HN39mymAMYo1My8pvyKBNePOPseCToOK47s72BsYn6p1MXJySAj4S7xY 8IENxGYTMJBYMf0qI4gtIiArsbprDjuIzSwQIfHixiqwGmGBWIm1u1azgtgsAqoSLybsZQaxe QXsJBadaWCGmCkvsfD8ESYQm1PAXuL+5vVgc4SAalav62KCsNUkbixcxgLRKyhxcuYTFohdEh IHX7xgnsDIOwtJahaS1AJGplWMGsWpRWWpRbqGhnpJRZnpGSW5iZk5uoYGxnq5qcXFiempOYl JxXrJ+bmbGIGhwwAEOxhX/3Y6xCjJwaQkyrtZyDxCiC8pP6UyI7E4I76oNCe1+BCjDAeHkgTv Qh2gnGBRanpqRVpmDjCIYdISHDxKIrwvQdK8xQWJucWZ6RCpU4y6HHtmvXrAJMSSl5+XKiXOm 6wLVCQAUpRRmgc3AhZRlxhlpYR5GYGOEuIpSC3KzSxBlX/FKM7BqCTMqw8yhSczrwRu0yugI5 iAjpD8ZgxyREkiQkqqgXH7r71Ov6dWCa4789Fot6Qi84Q0/09GMdN04zlZGaxWLFn2Ze+DFXd 0or62n+cSiDHYc+V79pVnLIv8w4PEP/X+Wbr4dGrA0zxtcTP5rPra733nXSM7ZJZO9JdeqR7r 6c9T/dJYXvt+4NSiUzaFK8W76+bdeHN2a3X09MdXk/zO/PN1165LdVFiKc5INNRiLipOBAARq KBbowIAAA== X-Env-Sender: prvs=1297afe57=anthony.perard@citrix.com X-Msg-Ref: server-12.tower-31.messagelabs.com!1480011266!55981792!2 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.0.16; banners=-,-,- X-VirusChecked: Checked Received: (qmail 49385 invoked from network); 24 Nov 2016 18:14:29 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-12.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 24 Nov 2016 18:14:29 -0000 X-IronPort-AV: E=Sophos;i="5.31,543,1473120000"; d="scan'208";a="400032622" From: Anthony PERARD To: Date: Thu, 24 Nov 2016 18:14:10 +0000 Message-ID: <20161124181412.18266-2-anthony.perard@citrix.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161124181412.18266-1-anthony.perard@citrix.com> References: <20161124181412.18266-1-anthony.perard@citrix.com> MIME-Version: 1.0 Cc: Anthony PERARD , Ian Jackson Subject: [Xen-devel] [OSSTEST PATCH v8 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 V8: - fix job name in sg-run-job - fix copyright year - fix too long lines 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 | 137 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 142 insertions(+) create mode 100755 ts-openstack-deploy diff --git a/sg-run-job b/sg-run-job index 9c3e0ce..0d65c8a 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..36d7866 --- /dev/null +++ b/ts-openstack-deploy @@ -0,0 +1,137 @@ +#!/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, '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 <