Add initinfra gating tests
Relates-To: #180 Change-Id: Ie7a8daa532596f2d1d0fb2059ef4630607511711
This commit is contained in:
parent
68c97923e1
commit
e40b5ffec5
@ -0,0 +1,4 @@
|
||||
resources:
|
||||
- ../../../../function/baremetal-operator
|
||||
commonLabels:
|
||||
airshipit.org/stage: initinfra
|
@ -22,6 +22,7 @@
|
||||
- airshipctl-build-ephemeral-iso
|
||||
- install-kubectl
|
||||
- airshipctl-deploy-ephemeral-node
|
||||
- airshipctl-cluster-initinfra
|
||||
var_files_default:
|
||||
- local-dev.yaml
|
||||
- airship-ipam.yaml
|
||||
|
14
roles/airshipctl-cluster-initinfra/defaults/main.yaml
Normal file
14
roles/airshipctl-cluster-initinfra/defaults/main.yaml
Normal file
@ -0,0 +1,14 @@
|
||||
# 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.
|
||||
|
||||
# TODO: Remove this as soon as issue #127 is complete
|
||||
infra_namespace: metal3
|
43
roles/airshipctl-cluster-initinfra/tasks/main.yaml
Normal file
43
roles/airshipctl-cluster-initinfra/tasks/main.yaml
Normal file
@ -0,0 +1,43 @@
|
||||
# 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.
|
||||
|
||||
- name: deploy infra to cluster
|
||||
command: >-
|
||||
airshipctl cluster initinfra
|
||||
|
||||
# TODO: As soon as issue #127 is complete, this check for pods should
|
||||
# be removed and initinfra command should check for resource status.
|
||||
- name: verify initinfra metal3-baremetal-operator is created
|
||||
command: >-
|
||||
timeout 20 kubectl \
|
||||
--kubeconfig {{ airshipctl_config_dir_default | default(ansible_env.HOME) }}/.airship/kubeconfig \
|
||||
--namespace {{ infra_namespace }} \
|
||||
get deploy {{ item }}
|
||||
register: deploy_status
|
||||
until: item in deploy_status.stdout
|
||||
with_items:
|
||||
- metal3-baremetal-operator
|
||||
retries: 50
|
||||
delay: 20
|
||||
|
||||
- name: verify initinfra metal3-baremetal-operator comes up
|
||||
command: >-
|
||||
timeout 20 kubectl \
|
||||
--kubeconfig {{ airshipctl_config_dir_default | default(ansible_env.HOME) }}/.airship/kubeconfig \
|
||||
--namespace {{ infra_namespace }} \
|
||||
wait --for=condition=ready pods --selector name={{ item }}
|
||||
register: deploy_status
|
||||
until: item in deploy_status.stdout
|
||||
with_items:
|
||||
- metal3-baremetal-operator
|
||||
retries: 50
|
||||
delay: 20
|
29
tools/gate/27_cluster_initinfra.sh
Executable file
29
tools/gate/27_cluster_initinfra.sh
Executable file
@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you 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 -xe
|
||||
|
||||
TMP_DIR=${TMP_DIR:-"$(dirname $(mktemp -u))"}
|
||||
ANSIBLE_HOSTS=${ANSIBLE_HOSTS:-"${TMP_DIR}/ansible_hosts"}
|
||||
PLAYBOOK_CONFIG=${PLAYBOOK_CONFIG:-"${TMP_DIR}/config.yaml"}
|
||||
|
||||
sudo ansible-playbook -i "$ANSIBLE_HOSTS" \
|
||||
playbooks/airship-airshipctl-test-runner.yaml \
|
||||
-e @tools/gate/config_cluster_initinfra.yaml \
|
||||
-e @"$PLAYBOOK_CONFIG"
|
15
tools/gate/config_cluster_initinfra.yaml
Normal file
15
tools/gate/config_cluster_initinfra.yaml
Normal file
@ -0,0 +1,15 @@
|
||||
# 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.
|
||||
|
||||
---
|
||||
test_roles:
|
||||
- airshipctl-cluster-initinfra
|
@ -86,6 +86,7 @@
|
||||
- airshipctl-build-ephemeral-iso
|
||||
- install-kubectl
|
||||
- airshipctl-deploy-ephemeral-node
|
||||
- airshipctl-cluster-initinfra
|
||||
serve_dir: /srv/iso
|
||||
serve_port: 8099
|
||||
|
||||
@ -109,6 +110,7 @@
|
||||
- airshipctl-build-ephemeral-iso
|
||||
- install-kubectl
|
||||
- airshipctl-deploy-ephemeral-node
|
||||
- airshipctl-cluster-initinfra
|
||||
serve_dir: /srv/iso
|
||||
serve_port: 8099
|
||||
voting: false
|
||||
|
Loading…
Reference in New Issue
Block a user