-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
create multiple cnv workloads #10673
base: master
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: avd-sagare The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
8a1c795
to
5ded88a
Compare
5d52616
to
616acfb
Compare
Signed-off-by: Avdhoot <[email protected]>
Signed-off-by: Avdhoot <[email protected]>
Signed-off-by: Avdhoot <[email protected]>
Signed-off-by: Avdhoot <[email protected]>
Signed-off-by: Avdhoot <[email protected]>
Signed-off-by: Avdhoot <[email protected]>
Signed-off-by: Avdhoot <[email protected]>
616acfb
to
46283a5
Compare
tests/conftest.py
Outdated
vm_list_default_compr = [] | ||
|
||
""" | ||
Setup csi-kms-connection-details configmap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be commented instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
tests/conftest.py
Outdated
def factory(namespace=None): | ||
""" | ||
Args: | ||
namespace: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
elaborate the namespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
tests/conftest.py
Outdated
source_url=constants.CNV_FEDORA_SOURCE, # Assuming source_url is the same for all VMs | ||
namespace=namespace, | ||
) | ||
vm_obj = vm_obj[-1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the need for last vm_obj in the cnv_vm_objs list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually cnv_workload gives list and everytime new obj is append on vm-obj list..So I am picking up last added vm object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can get the index of current iteration by enumerating
Signed-off-by: Avdhoot <[email protected]>
vm_list_agg_compr = [] | ||
vm_list_default_compr = [] | ||
|
||
namespace = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
namespace will be created in vm class if no namespace is provided. So no need to create a specific ns here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to create namespace here because I need to create csi kms token where we are creating vm pvc.
tests/conftest.py
Outdated
@@ -7092,6 +7092,112 @@ def teardown(): | |||
return factory | |||
|
|||
|
|||
@pytest.fixture |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pytest.fixture | |
@pytest.fixture() |
tests/conftest.py
Outdated
Create a cnv factory. Calling this fixture Creates multiple VMs | ||
with specified configurations using the cnv_workload fixture. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please elaborate the fixture description as discussed
namespace if namespace else create_unique_resource_name("vm", "namespace") | ||
) | ||
|
||
# Setup csi-kms-connection-details configmap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't this be done as part of the cluster deployment with KMS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we are creating new customize encrypted storageclass, we can't do at during cluster deployment.
tests/conftest.py
Outdated
return ( | ||
vm_list_default_compr, | ||
vm_list_agg_compr, | ||
sc_obj_aggressive, | ||
sc_obj_def_compr, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason for categ the VMs this way? can we return a single list of VM objects and get the required data from those?
@@ -0,0 +1,144 @@ | |||
import logging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide a more meaningful test case name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
tests/functional/cnv/test_vms.py
Outdated
run_cmd(cmd) | ||
|
||
# Calculate the MD5 checksum | ||
if file_path: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throw exceptions when the file path and md5sum_on_loca are not found
tests/functional/cnv/test_vms.py
Outdated
md5sum_on_vm = cal_md5sum_vm(vm_obj, vm_filepath, username=None) | ||
assert ( | ||
md5sum_on_vm == md5sum_on_local | ||
), f"md5sum has not changed after copying file on {vm_obj.name}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be, md5sum changed?
tests/functional/cnv/test_vms.py
Outdated
md5sum_on_vm = cal_md5sum_vm(vm_obj, vm_filepath, username=None) | ||
assert ( | ||
md5sum_on_vm == md5sum_on_local | ||
), f"md5sum has not changed after copying file on {vm_obj.name}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be, md5sum changed?
tests/functional/cnv/test_vms.py
Outdated
volume_name = vm.pvc_obj.get().get("spec").get("volumeName") | ||
for line in run_oc_command( | ||
f"describe pv {volume_name}", namespace=vm.namespace | ||
): | ||
if "VolumeHandle:" in line: | ||
volume_handle = line.split()[1] | ||
break | ||
if volume_handle is None: | ||
logger.error(f"Cannot get volume handle for pv {volume_name}") | ||
raise Exception("Cannot get volume handle") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is for getting the pv name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no for getting volume handle name of PV
tests/functional/cnv/test_vms.py
Outdated
# 4.Stop all VMs | ||
for vm_obj in self.vm_objs_def + self.vm_objs_aggr: | ||
vm_obj.stop() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't this part of the test case? do we need this, shouldn't the fixture teardown take care of stopping the VM's?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests/conftest.py
Outdated
compression="aggressive", | ||
new_rbd_pool=True, | ||
) | ||
vm_configs = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imo, you can add these configs by create cnv_workload.yaml file
log.info("csi-kms-connection-details setup successful") | ||
|
||
# Create an encryption enabled storageclass for RBD | ||
sc_obj_def_compr = storageclass_factory( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sc created should have ceph-rbd-virt sc params. Please check and patch if necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
new_rbd_pool=True, | ||
) | ||
|
||
sc_obj_aggressive = storageclass_factory( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
tests/conftest.py
Outdated
source_url=constants.CNV_FEDORA_SOURCE, # Assuming source_url is the same for all VMs | ||
namespace=namespace, | ||
) | ||
vm_obj = vm_obj[-1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can get the index of current iteration by enumerating
tests/conftest.py
Outdated
compression="aggressive", | ||
new_rbd_pool=True, | ||
) | ||
vm_configs = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make sure you cover all RWX and at least one RWO configs from here
kms = pv_encryption_kms_setup_factory(kv_version="v2") | ||
log.info("csi-kms-connection-details setup successful") | ||
|
||
# Create an encryption enabled storageclass for RBD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use rbd virtualization storageclass here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Signed-off-by: Avdhoot <[email protected]>
Signed-off-by: Avdhoot <[email protected]>
e639641
to
cd2b1bd
Compare
Signed-off-by: Avdhoot <[email protected]>
3ed5434
to
77acbb7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR validation on existing cluster
Cluster Name: asagare-cnv8
Cluster Configuration:
PR Test Suite:
PR Test Path: tests/functional/cnv/test_vms.py
Additional Test Params:
OCP VERSION: 4.18
OCS VERSION: 4.18
tested against branch: master
No description provided.