Add skeleton for devstack plugin and gate hooks

Change-Id: Ib568436bd8f896fba4fa46e07714c4cb8b889459
This commit is contained in:
Davanum Srinivas 2017-03-30 23:01:01 -04:00
parent 4916646810
commit e64f9f8a93
5 changed files with 106 additions and 0 deletions

17
contrib/gate_hook.sh Normal file
View File

@ -0,0 +1,17 @@
#!/bin/bash
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
set -ex
$BASE/new/devstack-gate/devstack-vm-gate.sh

18
contrib/post_test_hook.sh Normal file
View File

@ -0,0 +1,18 @@
#!/bin/bash -xe
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# This script is executed inside post_test_hook function in devstack gate.
cd $BASE/new/devstack
source openrc admin admin

17
contrib/pre_test_hook.sh Normal file
View File

@ -0,0 +1,17 @@
#!/bin/bash -xe
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# This script is executed inside pre_test_hook function in devstack gate.
export localconf=$BASE/new/devstack/local.conf

52
devstack/plugin.sh Normal file
View File

@ -0,0 +1,52 @@
#!/usr/bin/env bash
# plugin.sh - DevStack plugin.sh dispatch script zun-ui
BASE_DIR=$(cd $(dirname $BASH_SOURCE)/.. && pwd)
function install_k8s_cloud_provider {
echo_summary "Installing Devstack Plugin"
}
function init_k8s_cloud_provider {
echo_summary "Initialize Devstack Plugin"
}
function configure_k8s_cloud_provider {
echo_summary "Configuring Devstack Plugin"
}
# check for service enabled
if is_service_enabled zun-ui; then
if [[ "$1" == "stack" && "$2" == "pre-install" ]]; then
# Set up system services
# no-op
:
elif [[ "$1" == "stack" && "$2" == "install" ]]; then
# Perform installation of service source
# no-op
:
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
# Configure after the other layer 1 and 2 services have been configured
# no-op
:
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
# no-op
:
fi
if [[ "$1" == "unstack" ]]; then
# no-op
:
fi
if [[ "$1" == "clean" ]]; then
# Remove state and transient data
# Remember clean.sh first calls unstack.sh
# no-op
:
fi
fi

2
devstack/settings Normal file
View File

@ -0,0 +1,2 @@
# settings file for devstack plugin
enable_service k8s_cloud_provider