Skip to content

Trigger okd test

Trigger okd test #240

name: Trigger okd test
on:
workflow_dispatch:
inputs:
perform_cleanup:
description: 'do we want to perform env cleanup'
required: true
default: true
type: boolean
schedule:
- cron: '30 04 * * *'
jobs:
build:
if: ( github.event_name == 'schedule' && github.repository == 'kubev2v/forkliftci' ) || (github.event_name != 'schedule')
name: Deploy OKD
runs-on: ubuntu-latest
steps:
- name: Check out forkliftci repository
uses: actions/checkout@v3
- name: Add cwd to path for kubectl.
run: echo `pwd` >> $GITHUB_PATH
- name: Checkout forklift
uses: actions/checkout@v3
with:
repository: kubev2v/forklift
path: forklift
- name: run OKD deployment
uses: ./ci/deploy-okd
with:
perform_cleanup: ${{ inputs.perform_cleanup }}
OKD_ENGINE_SECRETS: ${{ secrets.OKD_ENGINE_SECRETS }}
OKD_SSH_KEY: ${{ secrets.OKD_SSH_KEY }}
- name: install hco & forklift
shell: bash
run: |
cd ${GITHUB_WORKSPACE}/cluster/okd-on-ovirt/
source ../common.sh
source utils.sh
#TODO: get kubeconfig from the cluster and set KUBECONFIG env
download_kubeconf "/tmp/kubeconfig"
k8s_apply_volume_populator
NFS_IP_ADDRESS=$(get_conf_value "${CONF_PATH}" "NFS_IP_ADDRESS")
NFS_SHARE=$(get_conf_value "${CONF_PATH}" "NFS_SHARE")
${GITHUB_WORKSPACE}/cluster/providers/utils/deploy_csi_driver_nfs.sh "${NFS_IP_ADDRESS}" "${NFS_SHARE}"
k8s_apply_mco_container_use_devices
# deploy hyperconverged operator
k8s_apply_hco
# deploy latest forklift operator using subscription
k8s_apply_forklift_latest
- name: prepare the test VM
shell: bash
run: |
cd ${GITHUB_WORKSPACE}/cluster/okd-on-ovirt/
source utils.sh
# Create test fedora VM
run_docker_create_vm
- name: run e2e suite tests
shell: bash
run: |
cd ${GITHUB_WORKSPACE}/cluster/okd-on-ovirt/
source utils.sh
# export test variables for the tests
export_test_var
echo "OVIRT_VM_ID: ${OVIRT_VM_ID}"
cd ${GITHUB_WORKSPACE}/forklift
KUBEVIRT_CLIENT_GO_SCHEME_REGISTRATION_VERSION=v1 \
go test ./tests/suit -v \
-ginkgo.focus ".*secure flow.*"
- name: run virtctl - check if vm booted
shell: bash
id: vm_booted
run: |
cd ${GITHUB_WORKSPACE}/cluster/okd-on-ovirt/
source utils.sh
# verify VM is booted
# TODO: move into the test suite
download_virtctl
run_virtctl_cmd_timeout
- name: save logs
if: ${{ always() }}
uses: ./ci/save-artifacts/
with:
source_provider: ovirt
- name: cleanup
shell: bash
if: always()
run: |
# exit early if cleanup not set
[ ${{ inputs.perform_cleanup || 'true' }} != "true" ] && exit
# dont perform a cleanup if vm_booted test has failed
[ ${{ steps.vm_booted.outcome }} == "failure" ] && exit
cd ${GITHUB_WORKSPACE}/cluster/okd-on-ovirt/
source utils.sh
run_docker_ansible_cleanup