Skip to content
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

New test cases for set CHS geometry for disk types:scsi, sata, virtio… #4207

Merged
merged 1 commit into from
Jul 26, 2022

Conversation

chunfuwen
Copy link
Contributor

@chunfuwen chunfuwen commented May 12, 2022

New test cases for geometry: set cyls, heads, secs, trans attributes for disk types:scsi, sata, virtio, usb

set detect_zeroes attribute
set read_bytes_sec/write_bytes_sec/total_bytes_sec together
set max total_bytes_sec

Signed-off-by: chunfuwen [email protected]

@chunfuwen
Copy link
Contributor Author

chunfuwen commented May 12, 2022

PASS 01-type_specific.io-github-autotest-libvirt.virtual_disks.geometry.coldplug.chs_scsi.positive_test
PASS 02-type_specific.io-github-autotest-libvirt.virtual_disks.geometry.coldplug.chs_virtio.positive_test
PASS 03-type_specific.io-github-autotest-libvirt.virtual_disks.geometry.coldplug.chs_sata.positive_test
PASS 04-type_specific.io-github-autotest-libvirt.virtual_disks.geometry.coldplug.chs_usb.negative_test
PASS 05-type_specific.io-github-autotest-libvirt.virtual_disks.geometry.coldplug.chs_sata_trans.negative_test
PASS 06-type_specific.io-github-autotest-libvirt.virtual_disks.geometry.coldplug.detect_zeroes_on.positive_test
PASS 07-type_specific.io-github-autotest-libvirt.virtual_disks.geometry.coldplug.detect_zeroes_off.positive_test
PASS 08-type_specific.io-github-autotest-libvirt.virtual_disks.geometry.coldplug.set_read_write_bytes_sec_iotune.negative_test
PASS 09-type_specific.io-github-autotest-libvirt.virtual_disks.geometry.coldplug.set_read_write_bytes_iops_sec_iotune.positive_test
PASS 10-type_specific.io-github-autotest-libvirt.virtual_disks.geometry.coldplug.set_total_bytes_sec_boundary_iotune.positive_test
PASS 11-type_specific.io-github-autotest-libvirt.virtual_disks.geometry.hotplug.discard_ignore_detect_zeroes_unmap.positive_test
PASS 12-type_specific.io-github-autotest-libvirt.virtual_disks.geometry.hotplug.discard_unmap_detect_zeroes_unmap.positive_test

@chunfuwen chunfuwen force-pushed the add_chs_geometry_cases branch 3 times, most recently from 2aad519 to 86b2c37 Compare May 12, 2022 01:45
@chunfuwen
Copy link
Contributor Author

IDE controller is not supported on q35 machine type and afterward, so this automation doesn't cover ide bus type

@chunfuwen chunfuwen force-pushed the add_chs_geometry_cases branch 6 times, most recently from 2b978ed to efc9402 Compare May 31, 2022 01:33
@chunfuwen
Copy link
Contributor Author

@dzhengfy
@qiankehan
please help take a review

@qiankehan
Copy link
Contributor

The geometry only includes the attributes cyls, heads, secs, trans literally. It is improper to put the tests of discard and iotune in the test set geometry.

@chunfuwen
Copy link
Contributor Author

chunfuwen commented Jul 18, 2022

@qiankehan

How about changing the name from geometry to metrics(virtual_disks.metrics or virtual_disk.telemetry)? Here we want to aggregate some couples and cohesive attributes into one cfg file, rather than maintain cyls, heads, secs, trans as independent cfg file. As you may know that, in remaining virtual disk plan, almost each of them comes from one bugzilla bug, we can not create one cfg file for one bugzilla,that will leads to huge maintainer efforts. Here we try to seek out some common points, which we think they can be aggregated into.

@qiankehan
Copy link
Contributor

@qiankehan

How about changing the name from geometry to metrics(virtual_disks.metrics)? Here we want to aggregate some couples and cohesive attributes into one cfg file, rather than maintain cyls, heads, secs, trans as independent cfg file. As you may know that, in remaining virtual disk plan, almost each of them comes from one bugzilla bug, we can not create one cfg file for one bugzilla,that will leads to huge maintainer efforts. Here we try to seek out some common points, which we think they can be aggregated into.

I think virtual_disks.metrics is not a good name because it is so broad that could include all the sub-elements and attributes of disk. Following the scheme of disk XML is more reasonable, and it will be easier to debug. For example:

  • For the geometry, since it is the sub-element of disk, naming these cases as virtual_disks.geometry.*
  • The attribute discard is the attribute of driver. And the driver is the direct sub-element of disk. So name these cases as virtual_disks.driver.discard.*

backend_device = "chs_virtio"
chs_attrs = "{'cyls': '16383', 'heads': '16', 'secs': '63'}"
only coldplug..positive_test
- chs_sata:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remember to skip this sata cases on other arches in CI because other aarches only support sata in libvirt/qemu upstream.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK


def check_chs_values(params, vm_name, test):
"""
Check cylinders, heads, sectors value from qemu line since there are on other ways to check this.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on other ways tono other ways

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated


def check_discard_detect_zeroes_values(params, vm_name, test):
"""
Check detect_zeroes and discard value from qemu line since there are on other ways to check this.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

"""
chs_geometry_attrs_dict = eval(params.get('chs_attrs'))
cmd = ("ps -ef | grep %s | grep -v grep " % vm_name)
LOG.debug("VM cmdline: %s", process.system_output(cmd, shell=True))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

process.system_output(verbose=True) is enabled as default. Do we still need to log the output again?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated with using process.system_output(verbose=True) only

:param test: test assert object
"""
cmd = ("ps -ef | grep %s | grep -v grep " % vm_name)
LOG.debug("VM cmdline: %s", process.system_output(cmd, shell=True))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

process.system_output(verbose=True) is enabled as default. Do we still need to log the output again?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove LOG, and add verbose=True when call process.system_output

if detect_zeroes:
str_to_grep = "detect-zeroes.*%s.*" % (detect_zeroes)
if not libvirt.check_logfile(str_to_grep, log_file):
test.fail('Failed to check detect-zeroes as expected')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to include the str_to_grep in the message for debugging

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

if discard:
str_to_grep = "discard.*%s.*" % (discard)
if not libvirt.check_logfile(str_to_grep, log_file):
test.fail('Failed to check discard as expected')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to include the str_to_grep in the message for debugging

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

test.fail('Failed to check discard as expected')


def translate_blkiotune_raw_output_into_dict(output, default_delimiter="="):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function name includes blkiotune, but the docstring doesn't. And only virsh.blkdeviotune output is passed into this function. So I am confusing the usage of blkiotune in the function name. We should make them consistent anyway.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function's purpose is to convert the output to a dict. So could you please have a look at
libvirt_misc.convert_to_dict(). Some python files also use it, like in virsh_emulatorpin_mix.py . I am feeling it could be helpful for you.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this function, and use libvirt_misc.convert_to_dict() instead

if hotplug:
LOG.info("attaching devices, expecting error...")
result = virsh.attach_device(vm_name, device_obj.xml, debug=True)
libvirt.check_result(result, expected_fails=[])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not see this is expecting error. If we only need to check the command status, libvirt.check_exit_status(result, expect_error=False) is enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@chunfuwen
Copy link
Contributor Author

@qiankehan
How about changing the name from geometry to metrics(virtual_disks.metrics)? Here we want to aggregate some couples and cohesive attributes into one cfg file, rather than maintain cyls, heads, secs, trans as independent cfg file. As you may know that, in remaining virtual disk plan, almost each of them comes from one bugzilla bug, we can not create one cfg file for one bugzilla,that will leads to huge maintainer efforts. Here we try to seek out some common points, which we think they can be aggregated into.

I think virtual_disks.metrics is not a good name because it is so broad that could include all the sub-elements and attributes of disk. Following the scheme of disk XML is more reasonable, and it will be easier to debug. For example:

  • For the geometry, since it is the sub-element of disk, naming these cases as virtual_disks.geometry.*
  • The attribute discard is the attribute of driver. And the driver is the direct sub-element of disk. So name these cases as virtual_disks.driver.discard.*

@qiankehan
In openstack world, we have telemetry, https://docs.openstack.org/mitaka/install-guide-ubuntu/common/get_started_telemetry.html
also in openshift world, we have https://access.redhat.com/documentation/en-us/openshift_container_platform/4.1/html-single/telemetry/index

Telemetry means that data captured of states, events, performance in computing, storage and networking in the system.
In those cases being automated, if we aggregate them from this dimension, geometry, set read_bytes_sec/write_bytes_sec/total_bytes_sec , set max total_bytes_sec are good candidates

@qiankehan
Copy link
Contributor

qiankehan commented Jul 20, 2022

@qiankehan
How about changing the name from geometry to metrics(virtual_disks.metrics)? Here we want to aggregate some couples and cohesive attributes into one cfg file, rather than maintain cyls, heads, secs, trans as independent cfg file. As you may know that, in remaining virtual disk plan, almost each of them comes from one bugzilla bug, we can not create one cfg file for one bugzilla,that will leads to huge maintainer efforts. Here we try to seek out some common points, which we think they can be aggregated into.

I think virtual_disks.metrics is not a good name because it is so broad that could include all the sub-elements and attributes of disk. Following the scheme of disk XML is more reasonable, and it will be easier to debug. For example:

  • For the geometry, since it is the sub-element of disk, naming these cases as virtual_disks.geometry.*
  • The attribute discard is the attribute of driver. And the driver is the direct sub-element of disk. So name these cases as virtual_disks.driver.discard.*

@qiankehan In openstack world, we have telemetry, https://docs.openstack.org/mitaka/install-guide-ubuntu/common/get_started_telemetry.html also in openshift world, we have https://access.redhat.com/documentation/en-us/openshift_container_platform/4.1/html-single/telemetry/index

Telemetry means that data captured of states, events, performance in computing, storage and networking in the system. In those cases being automated, if we aggregate them from this dimension, geometry, set read_bytes_sec/write_bytes_sec/total_bytes_sec , set max total_bytes_sec are good candidates

Yeah, openshift and OpenStack have clear definition about the concept of Telemetry. I disagree with such abstract names like metrix or telemetry until its scope is clear and documented. Otherwise, how to know if an element or an attribute is a part of this concept? And it will make no sense.

Maybe we can draft the documents like openshift or OpenStack in tp-libvirt and then add the cases with such a name.

…for disk types:scsi, sata, virtio, usb

Set detect_zeroes attribute

Set read_bytes_sec/write_bytes_sec/total_bytes_sec together

Set max total_bytes_sec

Signed-off-by: chunfuwen <[email protected]>
@chunfuwen
Copy link
Contributor Author

@qiankehan
How about changing the name from geometry to metrics(virtual_disks.metrics)? Here we want to aggregate some couples and cohesive attributes into one cfg file, rather than maintain cyls, heads, secs, trans as independent cfg file. As you may know that, in remaining virtual disk plan, almost each of them comes from one bugzilla bug, we can not create one cfg file for one bugzilla,that will leads to huge maintainer efforts. Here we try to seek out some common points, which we think they can be aggregated into.

I think virtual_disks.metrics is not a good name because it is so broad that could include all the sub-elements and attributes of disk. Following the scheme of disk XML is more reasonable, and it will be easier to debug. For example:

  • For the geometry, since it is the sub-element of disk, naming these cases as virtual_disks.geometry.*
  • The attribute discard is the attribute of driver. And the driver is the direct sub-element of disk. So name these cases as virtual_disks.driver.discard.*

@qiankehan In openstack world, we have telemetry, https://docs.openstack.org/mitaka/install-guide-ubuntu/common/get_started_telemetry.html also in openshift world, we have https://access.redhat.com/documentation/en-us/openshift_container_platform/4.1/html-single/telemetry/index
Telemetry means that data captured of states, events, performance in computing, storage and networking in the system. In those cases being automated, if we aggregate them from this dimension, geometry, set read_bytes_sec/write_bytes_sec/total_bytes_sec , set max total_bytes_sec are good candidates

Yeah, openshift and OpenStack have clear definition about the concept of Telemetry. I disagree with such abstract names like metrix or telemetry until its scope is clear and documented. Otherwise, how to know if an element or an attribute is a part of this concept? And it will make no sense.

Maybe we can draft the documents like openshift or OpenStack in tp-libvirt and then add the cases with such a name.

@qiankehan
In order to move this PR forward, I create separate and independent issue :#4376 to track progress of this discussion.
After we have clear conclusion, we can come back to refactor the code

@chunfuwen
Copy link
Contributor Author

After log updated, new test result:

PASS 01-type_specific.io-github-autotest-libvirt.virtual_disks.geometry.coldplug.chs_scsi.positive_test
PASS 02-type_specific.io-github-autotest-libvirt.virtual_disks.geometry.coldplug.chs_virtio.positive_test
PASS 03-type_specific.io-github-autotest-libvirt.virtual_disks.geometry.coldplug.chs_sata.positive_test
PASS 04-type_specific.io-github-autotest-libvirt.virtual_disks.geometry.coldplug.chs_usb.negative_test
PASS 05-type_specific.io-github-autotest-libvirt.virtual_disks.geometry.coldplug.chs_sata_trans.negative_test
PASS 06-type_specific.io-github-autotest-libvirt.virtual_disks.geometry.coldplug.detect_zeroes_on.positive_test
PASS 07-type_specific.io-github-autotest-libvirt.virtual_disks.geometry.coldplug.detect_zeroes_off.positive_test
PASS 08-type_specific.io-github-autotest-libvirt.virtual_disks.geometry.coldplug.set_read_write_bytes_sec_iotune.negative_test
PASS 09-type_specific.io-github-autotest-libvirt.virtual_disks.geometry.coldplug.set_read_write_bytes_iops_sec_iotune.positive_test
PASS 10-type_specific.io-github-autotest-libvirt.virtual_disks.geometry.coldplug.set_total_bytes_sec_boundary_iotune.positive_test
PASS 11-type_specific.io-github-autotest-libvirt.virtual_disks.geometry.hotplug.discard_ignore_detect_zeroes_unmap.positive_test
PASS 12-type_specific.io-github-autotest-libvirt.virtual_disks.geometry.hotplug.discard_unmap_detect_zeroes_unmap.positive_test

@chunfuwen chunfuwen requested a review from dzhengfy July 26, 2022 02:17
Copy link
Contributor

@dzhengfy dzhengfy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@cliping cliping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chunfuwen
Copy link
Contributor Author

Let' merge it firstly, and after #4376 has conclusion, then we can go back to refactor code if needed

@chunfuwen chunfuwen merged commit 8639d32 into autotest:master Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants