Skip to content

Commit

Permalink
Introduce the e2e test setup for OVA providers.
Browse files Browse the repository at this point in the history
Signed-off-by: Bella Khizgiyaev <[email protected]>
  • Loading branch information
bkhizgiy committed Oct 22, 2023
1 parent 20f8c32 commit 71ee7ef
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 5 deletions.
2 changes: 2 additions & 0 deletions BUILD_AND_INSTALL_FORKLIFT_ON_KIND.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ it is possible to install the following source providers as part of k8s kind clu
- [VMware - vcsim](https://github.com/vmware/govmomi/blob/main/vcsim/README.md)
- [OpenStack - packstack](https://github.com/kubev2v/packstack-img)
- [oVirt - fakeovirt and ovirt-imageio](https://github.com/kubev2v/fakeovirt)
- [OVA - NFS share setup and copying OVA files]()


Run the script:
Expand All @@ -63,6 +64,7 @@ when `<provider-name>` can be one of those:
| INSTALL_NFS | install nfs server locally | |

- vsphere
- ova
- all


Expand Down
9 changes: 8 additions & 1 deletion build_forklift_bazel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,19 @@ if [ "${PROVIDER_NAME}" = "vsphere" ]; then
--action_env VIRT_V2V_DONT_REQUEST_KVM=true "
fi

if [ "${PROVIDER_NAME}" = "ova" ]; then
ACTION_ENV="$ACTION_ENV --action_env VIRT_V2V_IMAGE=quay.io/kubev2v/forklift-virt-v2v-stub:${REGISTRY_TAG} \
--action_env VIRT_V2V_DONT_REQUEST_KVM=true \
--action_env OVA_PROVIDER_SERVER_IMAGE=${REGISTRY}/forklift-ova-provider-server:${REGISTRY_TAG}"
fi

if [ "${PROVIDER_NAME}" = "all" ]; then
ACTION_ENV="$ACTION_ENV --action_env VIRT_V2V_IMAGE=quay.io/kubev2v/forklift-virt-v2v-stub:${REGISTRY_TAG} \
--action_env VIRT_V2V_DONT_REQUEST_KVM=true \
--action_env OVIRT_POPULATOR_IMAGE=${REGISTRY}/ovirt-populator:${REGISTRY_TAG} \
--action_env OPENSTACK_POPULATOR_IMAGE=${REGISTRY}/openstack-populator:${REGISTRY_TAG} \
--action_env POPULATOR_CONTROLLER_IMAGE=${REGISTRY}/populator-controller:${REGISTRY_TAG}"
--action_env POPULATOR_CONTROLLER_IMAGE=${REGISTRY}/populator-controller:${REGISTRY_TAG} \
--action_env OVA_PROVIDER_SERVER_IMAGE=${REGISTRY}/forklift-ova-provider-server:${REGISTRY_TAG}"
fi

bazel run push-forklift-operator-bundle \
Expand Down
17 changes: 13 additions & 4 deletions cluster/providers/install-provider.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@ case $PROVIDER_NAME in
k8s_apply_volume_populator
${SCRIPT_DIR}/vmware/setup.sh
${SCRIPT_DIR}/ovirt/setup.sh
[ ! -z "${INSTALL_NFS}" ] && ${SCRIPT_DIR}/openstack/install_nfs.sh
[ ! -z "${INSTALL_NFS}" ] && ${SCRIPT_DIR}/utils/install_nfs.sh
${SCRIPT_DIR}/openstack/setup.sh
${SCRIPT_DIR}/openstack/create_test_vms.sh
${SCRIPT_DIR}/ova/setup.sh


;;
"vsphere")
echo "installing vsphere providers"

# installs NFS for CSI
[ ! -z "${INSTALL_NFS}" ] && ${SCRIPT_DIR}/openstack/install_nfs.sh
[ ! -z "${INSTALL_NFS}" ] && ${SCRIPT_DIR}/utils/install_nfs.sh

${SCRIPT_DIR}/vmware/setup.sh
;;
Expand All @@ -37,7 +39,7 @@ case $PROVIDER_NAME in
k8s_apply_volume_populator

# installs NFS for CSI
[ ! -z "${INSTALL_NFS}" ] && ${SCRIPT_DIR}/openstack/install_nfs.sh
[ ! -z "${INSTALL_NFS}" ] && ${SCRIPT_DIR}/utils/install_nfs.sh

${SCRIPT_DIR}/ovirt/setup.sh

Expand All @@ -48,14 +50,21 @@ case $PROVIDER_NAME in
k8s_apply_volume_populator

#installs nfs for CSI and opentack volumes
[ ! -z "${INSTALL_NFS}" ] && ${SCRIPT_DIR}/openstack/install_nfs.sh
[ ! -z "${INSTALL_NFS}" ] && ${SCRIPT_DIR}/utils/install_nfs.sh

#create openstack - packstack deployment
${SCRIPT_DIR}/openstack/setup.sh

#create sample VMs and volume disks for the tests
${SCRIPT_DIR}/openstack/create_test_vms.sh
;;
"ova")
echo "installing ova providers"
# installs NFS for CSI
[ ! -z "${INSTALL_NFS}" ] && ${SCRIPT_DIR}/utils/install_nfs.sh

${SCRIPT_DIR}/ova/setup.sh
;;
*)
echo "provider ${PROVIDER_NAME} set incorrectly"
exit 5
Expand Down
20 changes: 20 additions & 0 deletions cluster/providers/ova/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

set -ex

export NFS_IP_ADDRESS=$(ip route get 8.8.8.8 | awk '{ print $7 }' | head -1)
export NFS_SHARE="/home/nfsshare"

ova_file_url="https://github.com/kubev2v/forkliftci/releases/download/v8.0/vm.ova"

# Download the file and check if the copy was successful
echo "The VM ova file download started."
wget -P "$NFS_SHARE" "$ova_file_url"
if [ $? -eq 0 ]; then
echo "OVA file copied successfully to NFS share."
else
echo "Error: OVA file copy failed."
fi

# deploy csi-driver-nfs
cluster/providers/utils/deploy_csi_driver_nfs.sh "${NFS_IP_ADDRESS}" "${NFS_SHARE}"
File renamed without changes.

0 comments on commit 71ee7ef

Please sign in to comment.