-#!/bin/bash
+#!/usr/bin/env bash
+set -eu -o pipefail
#Get Go ENV variables
eval "$(go env)"
-#!/bin/bash
+#!/usr/bin/env bash
+set -eu -o pipefail
CLUSTER_NAME=test-bmh-cluster
KUBECONFIG=--kubeconfig=/opt/kud/multi-cluster/${CLUSTER_NAME}/artifacts/admin.conf
APISERVER=$(kubectl ${KUBECONFIG} config view --minify -o jsonpath='{.clusters[0].cluster.server}')
TOKEN=$(kubectl ${KUBECONFIG} get secret $(kubectl ${KUBECONFIG} get serviceaccount default -o jsonpath='{.secrets[0].name}') -o jsonpath='{.data.token}' | base64 --decode )
- call_api $APISERVER/api --header "Authorization: Bearer $TOKEN" --insecure
- ret=$?
- if [[ $ret != 0 ]];
+ if ! call_api $APISERVER/api --header "Authorization: Bearer $TOKEN" --insecure;
then
printf "\nKubernetes Cluster Install did not complete successfully\n"
else
-#!/bin/bash
+#!/usr/bin/env bash
+set -eu -o pipefail
printf "\n\nStart Remote Virtlet VM provisioning E2E test\n\n"
KUBECONFIG=--kubeconfig=/opt/kud/multi-cluster/${CLUSTER_NAME}/artifacts/admin.conf
APISERVER=$(kubectl ${KUBECONFIG} config view --minify -o jsonpath='{.clusters[0].cluster.server}')
TOKEN=$(kubectl ${KUBECONFIG} get secret $(kubectl ${KUBECONFIG} get serviceaccount default -o jsonpath='{.secrets[0].name}') -o jsonpath='{.data.token}' | base64 --decode )
-call_api $APISERVER/api --header "Authorization: Bearer $TOKEN" --insecure
-ret=$?
-if [[ $ret != 0 ]];
+if ! call_api $APISERVER/api --header "Authorization: Bearer $TOKEN" --insecure;
then
printf "\nRemote Kubernetes Cluster Install did not complete successfully\n"
else
-#!/bin/bash
+#!/usr/bin/env bash
+set -eu -o pipefail
printf "\n\nStart Virtlet VM provisioning E2E test\n\n"
-#!/bin/bash
+#!/usr/bin/env bash
+set -eu -o pipefail
CLUSTER_NAME=cluster-test
KUBECONFIG=--kubeconfig=/opt/kud/multi-cluster/${CLUSTER_NAME}/artifacts/admin.conf
APISERVER=$(kubectl ${KUBECONFIG} config view --minify -o jsonpath='{.clusters[0].cluster.server}')
TOKEN=$(kubectl ${KUBECONFIG} get secret $(kubectl ${KUBECONFIG} get serviceaccount default -o jsonpath='{.secrets[0].name}') -o jsonpath='{.data.token}' | base64 --decode )
- call_api $APISERVER/api --header "Authorization: Bearer $TOKEN" --insecure
- ret=$?
- if [[ $ret != 0 ]];
+ if ! call_api $APISERVER/api --header "Authorization: Bearer $TOKEN" --insecure;
then
printf "\nKubernetes Cluster Install did not complete successfully\n"
else
-#!/bin/bash
+#!/usr/bin/env bash
+set -eu -o pipefail
ICN_DIR=$(dirname "$(dirname "$PWD")")
-#!/bin/bash
+#!/usr/bin/env bash
+set -eu -o pipefail
ICN_DIR=$(dirname "$(dirname "$PWD")")
-#!/bin/bash
+#!/usr/bin/env bash
+set -eu -o pipefail
ICN_DIR=$(dirname "$(dirname "$PWD")")
-#1/bin/bash
+#!/usr/bin/env bash
+set -eu -o pipefail
if which go > /dev/null; then
sudo apt-get -yq install golang-go
-#!/bin/bash
-set +x
+#!/usr/bin/env bash
+set -eu -o pipefail
LIBDIR="$(dirname "$(dirname "$PWD")")"
pushd $DOWNLOAD_PATH/multicloud-k8s/kud/hosting_providers/vagrant/inventory
HOST_IP=${HOST_IP:-$(hostname -I | cut -d ' ' -f 1)}
if [ "$1" == "minimal" ] ; then
- cat <<EOL > hosts.ini
+ cat <<EOL > hosts.ini
[all]
$HOSTNAME ansible_ssh_host=${HOST_IP} ansible_ssh_port=22
kube-master
EOL
else
- cat <<EOL > hosts.ini
+ cat <<EOL > hosts.ini
[all]
$HOSTNAME ansible_ssh_host=${HOST_IP} ansible_ssh_port=22
-#!/bin/bash
+#!/usr/bin/env bash
+set -eu -o pipefail
+
LIBDIR="$(dirname "$(dirname "$PWD")")"
source $LIBDIR/env/lib/common.sh
#!/usr/bin/env bash
-set +x
+set -eu -o pipefail
OS=$(awk -F= '/^ID=/ { print $2 }' /etc/os-release | tr -d '"')
if [[ $OS == ubuntu ]]; then
#!/usr/bin/env bash
-set -xe
+set -eux -o pipefail
# shellcheck disable=SC1091
source lib/logging.sh
-#!/bin/bash
-set -xe
+#!/usr/bin/env bash
+set -eux -o pipefail
# shellcheck disable=SC1091
source lib/logging.sh
#!/usr/bin/env bash
-#set -x
+set -eu -o pipefail
# shellcheck disable=SC1091
source lib/common.sh
}
function wait_for_provisioned {
- all_bmh_provisioned=1
declare -i k=1
declare -i t=$timeout
while ((t > 0)); do
echo "Try $k/$timeout iteration : Wait for $interval seconds to check all bmh state"
sleep $interval
- list_nodes | check_provisioned
- all_bmh_state=$?
- if [[ $all_bmh_state -eq $all_bmh_provisioned ]]; then
+ if ! list_nodes | check_provisioned; then
echo "All the VMs are provisioned - success"
warm_up_time
exit 0
#!/usr/bin/env bash
-set -x
+set -eux -o pipefail
# shellcheck disable=SC1091
source lib/logging.sh
# shellcheck disable=SC1091
source lib/common.sh
+BMO_RUN_LOCAL="${BMO_RUN_LOCAL:-false}"
+CAPBM_RUN_LOCAL="${CAPBM_RUN_LOCAL:-false}"
+
# Kill and remove the running ironic containers
for name in ironic ironic-inspector dnsmasq httpd mariadb ipa-downloader; do
sudo "${CONTAINER_RUNTIME}" ps | grep -w "$name$" && sudo "${CONTAINER_RUNTIME}" kill $name
#!/usr/bin/env bash
+set -eu -o pipefail
selinux="#security_driver = \"selinux\""
apparmor="security_driver = \"apparmor\""
-#!/bin/bash
+#!/usr/bin/env bash
+set -eu -o pipefail
eval "$(go env)"
+#!/usr/bin/env bash
+set -eu -o pipefail
+
# Log output automatically
LOGDIR="$(dirname $0)/logs"
if [ ! -d "$LOGDIR" ]; then
#!/usr/bin/env bash
-
-set -xe
+set -eux -o pipefail
# shellcheck disable=SC1091
source lib/logging.sh
#!/usr/bin/env bash
-set -ex
+set -eux -o pipefail
# shellcheck disable=SC1091
source lib/logging.sh
-#!/bin/sh
+#!/usr/bin/env bash
+set -eu -o pipefail
# This script will attempt to get the ip address of the a given libvirt guest.
-set -eu
-
PATH=$PATH:/usr/sbin:/sbin
VMNAME=$1
-#!/bin/bash -x
+#!/usr/bin/env bash
+set -eux -o pipefail
name="$1"
-#!/bin/bash
-set +ex
+#!/usr/bin/env bash
+set -eu -o pipefail
LIBDIR="$(dirname "$(dirname "$(dirname "$PWD")")")"
#!/usr/bin/env bash
-#set -x
+set -eu -o pipefail
LIBDIR="$(dirname "$(dirname "$(dirname "$PWD")")")"
}
function wait_for_provisioned {
- all_bmh_provisioned=1
declare -i k=1
while ((timeout > 0)); do
echo "Try $k iteration : Wait for $interval seconds to check all bmh state"
sleep $interval
- list_nodes | check_provisioned
- all_bmh_state=$?
- if [[ $all_bmh_state -eq $all_bmh_provisioned ]]; then
+ if ! list_nodes | check_provisioned; then
echo "All the Baremetal hosts are provisioned - success"
warm_up_time
exit 0
#!/usr/bin/env bash
-#set -x
+set -eu -o pipefail
LIBDIR="$(dirname "$(dirname "$(dirname "$PWD")")")"
echo "Baremetal $name current_host_state : "$current_host_state
echo "Previous Baremetals prev_host_state : "$prev_host_state
- if [ $j -eq 0 ]; then
+ if [ $j -eq 0 ]; then
prev_host_state=$current_host_state
((j+=1))
continue
}
function wait_for_deprovisioned {
- all_bmh_deprovisioned=1
declare -i k=1
while ((timeout > 0)); do
echo "Try $k iteration : Wait for $interval seconds to check all bmh state"
sleep $interval
- list_nodes | check_deprovisioned
- all_bmh_state=$?
- if [[ $all_bmh_state -eq $all_bmh_deprovisioned ]]; then
+ if ! list_nodes | check_deprovisioned; then
echo "All the Baremetal hosts are deprovisioned - success"
warm_up_time
exit 0
#!/usr/bin/env bash
-set -ex
+set -eux -o pipefail
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
-#!/bin/bash
+#!/usr/bin/env bash
+set -eu -o pipefail
#supported OS version
UBUNTU_BIONIC=${UBUNTU_BIONIC:-Ubuntu 18.04.2 LTS}
LOCAL_APT_REPO=${LOCAL_APT_REPO:-$DOWNLOAD_PATH/apt}
PIP_CACHE_DIR=${PIP_CACHE_DIR:-$DOWNLOAD_PATH/pip-cache-dir}
BUILD_DIR=${BUILD_DIR:-$DOWNLOAD_PATH/build-dir}
-CONTAINER_IMAGES_DIR=${CONTAINER_IMAGES_DIR:-$OFFLINE_DOWNLOAD_PATH/docker-dir}
+CONTAINER_IMAGES_DIR=${CONTAINER_IMAGES_DIR:-$DOWNLOAD_PATH/docker-dir}
#set variables
#Todo include over all variables here
-#!/bin/bash
+#!/usr/bin/env bash
+set -eu -o pipefail
# Log output automatically
# referred from metal3 project
#!/usr/bin/env bash
-set -ex
+set -eux -o pipefail
LIBDIR="$(dirname "$PWD")"
#install_kubernetes_packages $1
}
-if ["$1" == "-o"]; then
+if [ "$#" -eq 0 ]; then
+ install online
+elif [ "$1" == "-o" ]; then
install offline
- exit 0
+else
+ exit 1
fi
-
-install
#!/usr/bin/env bash
-set -xe
+set -eux -o pipefail
+
LIBDIR="$(dirname "$PWD")"
source $LIBDIR/lib/logging.sh
configure_ironic_interfaces
}
-if [ "$1" == "-o" ]; then
+if [ "$#" -eq 0 ]; then
+ configure online
+elif [ "$1" == "-o" ]; then
configure offline
- exit 0
+else
+ exit 1
fi
-
-configure
-#!/bin/bash
-set -xe
+#!/usr/bin/env bash
+set -eux -o pipefail
LIBDIR="$(dirname "$PWD")"
install_ironic_container
}
-if [ "$1" == "-o" ]; then
+if [ "$#" -eq 0 ]; then
+ install online
+elif [ "$1" == "-o" ]; then
install offline
- exit 0
-fi
-
-if [ "$1" == "--dhcp-start" ]; then
+elif [ "$1" == "--dhcp-start" ]; then
install_dhcp
echo "wait for 320s for nodes to be assigned"
sleep 6m
- exit 0
-fi
-
-if [ "$1" == "--dhcp-reset" ]; then
+elif [ "$1" == "--dhcp-reset" ]; then
reset_dhcp
echo "wait for 320s for nodes to be re-assigned"
sleep 6m
- exit 0
+else
+ exit 1
fi
-
-install
#!/usr/bin/env bash
-set -x
+set -eux -o pipefail
+
LIBDIR="$(dirname "$PWD")"
source $LIBDIR/lib/common.sh
#!/usr/bin/env bash
-set -ex
+set -eux -o pipefail
shopt -s extglob
source $(dirname $PWD)/../lib/common.sh
#!/usr/bin/env bash
-set -ex
+set -eux -o pipefail
source $(dirname $PWD)/../lib/common.sh
source $(dirname $PWD)/../lib/logging.sh
-!/bin/bash
+#!/usr/bin/env bash
+set -eu -o pipefail
# This script is called by cloud-init on worker nodes
# What does this script do:
tar xvzf $filename
if [ -d $module ]; then
echo "Installing module $module ..."
- pushd $module
+ pushd $module
bash ./install.sh
popd
rm -rf $module
#!/usr/bin/env bash
-
-
-set -ex
+set -eux -o pipefail
SCRIPT_PATH=`realpath $0`
TOOL_PATH=`dirname "$SCRIPT_PATH"`
#!/usr/bin/env bash
-
-set -ex
+set -eux -o pipefail
SCRIPT_PATH=`realpath $0`
TOOL_PATH=`dirname "$SCRIPT_PATH"`
#!/usr/bin/env bash
-
-set -ex
+set -eux -o pipefail
source ../_common.sh
#!/usr/bin/env bash
-
-set -ex
+set -eux -o pipefail
source ../../_common.sh
#!/usr/bin/env bash
+set -eu -o pipefail
apt update
apt install -y mkisofs coreutils
-#!/bin/bash
+#!/usr/bin/env bash
#Local controller - Bootstrap cluster DHCP connection
export BS_DHCP_INTERFACE="eno3"
#!/usr/bin/env bash
+set -eu -o pipefail
# This file is called by jenkins CI job