Module tests.test_upgrade
Functions
def flux_helm_chart_url(request)
def flux_helm_chart_version(request)
def longhorn_install_method(request)
def longhorn_repo(request)
def longhorn_upgrade(longhorn_install_method, rancher_hostname, rancher_access_key, rancher_secret_key, rancher_chart_install_version, longhorn_repo, flux_helm_chart_url, flux_helm_chart_version, longhorn_repo_url, longhorn_repo_branch, longhorn_manager_image, longhorn_engine_image, longhorn_instance_manager_image, longhorn_share_manager_image, longhorn_backing_image_manager_image)
def rancher_access_key(request)
def rancher_chart_install_version(request)
def rancher_hostname(request)
def rancher_secret_key(request)
def test_upgrade(longhorn_install_method, rancher_hostname, rancher_access_key, rancher_secret_key, rancher_chart_install_version, longhorn_repo, flux_helm_chart_url, flux_helm_chart_version, upgrade_longhorn_transient_version, upgrade_longhorn_repo_url, upgrade_longhorn_repo_branch, upgrade_longhorn_manager_image, upgrade_longhorn_engine_image, upgrade_longhorn_instance_manager_image, upgrade_longhorn_share_manager_image, upgrade_longhorn_backing_image_manager_image, client, core_api, volume_name, csi_pv, pvc, pod_make, statefulset, rwx_statefulset, storage_class)
-
Test Longhorn upgrade
TODO The test will cover both volume has revision counter enabled and disabled cases.
Prerequisite
-
Disable Auto Salvage Setting
-
Find the upgrade image tag
- Create a volume, generate and write data into the volume.
- Create vol_revision_enabled with revision counter enabled case.
- Create vol_revision_disabled with revision counter disabled case.
- Create vol_rebuild for replica rebuilding after system upgrade & engine live upgrade
- Create strict local volume strict_local_vol
- Create a Pod using a volume, generate and write data
- Create a StatefulSet with 2 replicas generate and write data to their volumes
- Keep all volumes attached
- Create custom resources
- Upgrade Longhorn system.
- Check Pod and StatefulSet didn't restart after system upgrade
- Check all volumes data
- Write all volumes data after system upgrade
- Check data written to all volumes after system upgrade
- Detach the vol_revision_enabled & vol_revision_disabled, and Delete Pod, and StatefulSet to detach theirvolumes
- Upgrade all volumes engine images
- Attach the volume, and recreate Pod, and StatefulSet
- Verify the volume's engine image has been upgraded
- Check All volumes data
- Delete one replica for vol_rebuild to trigger the rebuilding
- Verify the vol_rebuild is still healthy
-
def test_upgrade_with_auto_upgrade_latest_engine_enabled()
-
- Deploy Longhorn stable version
- Set Concurrent Automatic Engine Upgrade Per Node Limit to > 0
- Create a volume and attach it
- Deploy longhornio/longhorn-engine:master-head and wait for it to be deployed. This step is to make sure to expose the race condition that Longhorn tries auto engine upgrade while the new default IM is still starting
- Upgrade Longhorn to master-head
- Observe volume engine image upgrade success.
def upgrade_longhorn_backing_image_manager_image(request)
def upgrade_longhorn_engine_image(request)
def upgrade_longhorn_instance_manager_image(request)
def upgrade_longhorn_manager_image(request)
def upgrade_longhorn_repo_branch(request)
def upgrade_longhorn_repo_url(request)
def upgrade_longhorn_transient_version(request)