From patchwork Tue Dec 13 18:10:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 9472933 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 8AB356021C for ; Tue, 13 Dec 2016 18:13:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 884AC285FD for ; Tue, 13 Dec 2016 18:13:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7D42E2864C; Tue, 13 Dec 2016 18:13:42 +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 C68CE285FD for ; Tue, 13 Dec 2016 18:13:41 +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 1cGrXZ-0005T4-H5; Tue, 13 Dec 2016 18:11:01 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGrXY-0005SV-4x for xen-devel@lists.xen.org; Tue, 13 Dec 2016 18:11:00 +0000 Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id 8A/89-00888-3B930585; Tue, 13 Dec 2016 18:10:59 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprIIsWRWlGSWpSXmKPExsXitHRDpO4my4A Ig0f71S2WfFzM4sDocXT3b6YAxijWzLyk/IoE1oyfxz6wFpw3rFj+7CVLA+MsjS5GTg4JAX+J tWcmsoPYbAIGEiumX2UEsUUEZCVWd80BizMLREi8uLGKDcQWFoiVWLWwHayGRUBVYk3DQbAaX gE7ib+HP7FBzJSXWHj+CBOIzSlgL3H43TKweiGgmktnu1ggbDWJGwuXsUD0CkqcnPmEBWKXhM TBFy+YJzDyzkKSmoUktYCRaRWjRnFqUVlqka6RqV5SUWZ6RkluYmaOrqGBsV5uanFxYnpqTmJ SsV5yfu4mRmDw1DMwMO5gbD3hd4hRkoNJSZQ3ziAgQogvKT+lMiOxOCO+qDQntfgQowwHh5IE L4sFUE6wKDU9tSItMwcYxjBpCQ4eJRHeNJA0b3FBYm5xZjpE6hSjLseH40ueMgmx5OXnpUqJ8 1qBFAmAFGWU5sGNgMXUJUZZKWFeRgYGBiGegtSi3MwSVPlXjOIcjErCvIEgU3gy80rgNr0COo IJ6AjRJf4gR5QkIqSkGhhbfupmJHVl5SzKfeOnWam9e0Nh26+lJ9w/Xz90aZNwsvaR0CXtp9b K3nyooSOgLPZW1H7b4zVWVZEWUmyTGXJPHrdY5eK30Dcw+f7bkK/XJy3Z8YLB7Bp/dPjB9a4B t+cbaO6935MftsnP8KHe+kcO9aKf5R4zcP2SnvtL4pD576SnZ802qi9RYinOSDTUYi4qTgQAI t/va6QCAAA= X-Env-Sender: prvs=1483b5bee=anthony.perard@citrix.com X-Msg-Ref: server-9.tower-31.messagelabs.com!1481652656!20460604!1 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.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 45925 invoked from network); 13 Dec 2016 18:10:58 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-9.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 13 Dec 2016 18:10:58 -0000 X-IronPort-AV: E=Sophos;i="5.33,342,1477958400"; d="scan'208";a="394563010" From: Anthony PERARD To: Date: Tue, 13 Dec 2016 18:10:49 +0000 Message-ID: <20161213181051.20516-2-anthony.perard@citrix.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161213181051.20516-1-anthony.perard@citrix.com> References: <20161213181051.20516-1-anthony.perard@citrix.com> MIME-Version: 1.0 Cc: Anthony PERARD , Ian Jackson Subject: [Xen-devel] [OSSTEST PATCH v9 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 V9: - runvars for openstack trees have been renamed to openstack_* 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..6542da8 --- /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, '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 () { + 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 <