diff --git a/test/functional/config/example_dut_config.yml b/test/functional/config/example_dut_config.yml index 00180d8..e49f4a2 100644 --- a/test/functional/config/example_dut_config.yml +++ b/test/functional/config/example_dut_config.yml @@ -14,6 +14,15 @@ type: "local" allow_disk_autoselect: False working_dir: "/tmp/open-cas-linux/" +# CAS version to test. +# This version will be installed on DUT before test. Can be any string +# digestible by git-checkout. If not specified, by default current state +# of your controller's repo (HEAD) will be used as version to install. +# NOTE: Make sure to have a local master branch synced with upstream +# as the local repo will be taken for version reference. To do this +# simply run: `git fetch origin master:master` +cas_version: "master" + disks: - path: "/dev/device_name1" # disk device path serial: "ABC" # disk serial number diff --git a/test/functional/tests/conftest.py b/test/functional/tests/conftest.py index ce6a74c..b8f6ed3 100644 --- a/test/functional/tests/conftest.py +++ b/test/functional/tests/conftest.py @@ -275,12 +275,14 @@ def base_prepare(item): disk.remove_partitions() create_partition_table(disk, PartitionTable.gpt) + cas_version = TestRun.config.get("cas_version") or git.get_current_commit_hash() if get_force_param(item) and not TestRun.usr.already_updated: installer.rsync_opencas_sources() - installer.reinstall_opencas() - elif not installer.check_if_installed(): + installer.reinstall_opencas(cas_version) + elif not installer.check_if_installed(cas_version): installer.rsync_opencas_sources() - installer.set_up_opencas() + installer.set_up_opencas(cas_version) + TestRun.usr.already_updated = True TestRun.LOGGER.add_build_info(f'Commit hash:') TestRun.LOGGER.add_build_info(f"{git.get_current_commit_hash()}")