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

Automate virtlogd maxclients related cases #5656

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

chunfuwen
Copy link
Contributor

Automate virtlogd maxclients related cases

xx-59118,xx-86131,xx-86144,xx-86515

@chunfuwen
Copy link
Contributor Author

chunfuwen commented Jun 2, 2024

DATA (filename=output.expected) => NOT FOUND (data sources: variant, test, file)
DATA (filename=stdout.expected) => NOT FOUND (data sources: variant, test, file)
DATA (filename=stderr.expected) => NOT FOUND (data sources: variant, test, file)
PASS 1-type_specific.io-github-autotest-libvirt.conf_file.qemu_conf.set_virtlogd.positive_test.valid_max_clients

DATA (filename=output.expected) => NOT FOUND (data sources: variant, test, file)
DATA (filename=stdout.expected) => NOT FOUND (data sources: variant, test, file)
DATA (filename=stderr.expected) => NOT FOUND (data sources: variant, test, file)
PASS 1-type_specific.io-github-autotest-libvirt.conf_file.qemu_conf.set_virtlogd.positive_test.valid_boundary_max_clients

DATA (filename=output.expected) => NOT FOUND (data sources: variant, test, file)
DATA (filename=stdout.expected) => NOT FOUND (data sources: variant, test, file)
DATA (filename=stderr.expected) => NOT FOUND (data sources: variant, test, file)
PASS 1-type_specific.io-github-autotest-libvirt.conf_file.qemu_conf.set_virtlogd.positive_test.nclients_occupied_released

Command 'virsh list' finished with 0 after 0.032307155s
cleaning libvirtd logs...
DATA (filename=output.expected) => NOT FOUND (data sources: variant, test, file)
DATA (filename=stdout.expected) => NOT FOUND (data sources: variant, test, file)
DATA (filename=stderr.expected) => NOT FOUND (data sources: variant, test, file)
PASS 1-type_specific.io-github-autotest-libvirt.conf_file.qemu_conf.set_virtlogd.negative_test.invalid_boundary_max_clients

DATA (filename=output.expected) => NOT FOUND (data sources: variant, test, file)
DATA (filename=stdout.expected) => NOT FOUND (data sources: variant, test, file)
DATA (filename=stderr.expected) => NOT FOUND (data sources: variant, test, file)
PASS 1-type_specific.io-github-autotest-libvirt.conf_file.qemu_conf.set_virtlogd.positive_test.guest_runnning_after_virtlogd_crash

cleaning libvirtd logs...
DATA (filename=output.expected) => NOT FOUND (data sources: variant, test, file)
DATA (filename=stdout.expected) => NOT FOUND (data sources: variant, test, file)
DATA (filename=stderr.expected) => NOT FOUND (data sources: variant, test, file)
PASS 1-type_specific.io-github-autotest-libvirt.conf_file.qemu_conf.set_virtlogd.positive_test.reload_new_config

DATA (filename=stdout.expected) => NOT FOUND (data sources: variant, test, file)
DATA (filename=stderr.expected) => NOT FOUND (data sources: variant, test, file)
PASS 1-type_specific.io-github-autotest-libvirt.conf_file.qemu_conf.set_virtlogd.positive_test.log_filters_not_same_with_loglevel

Command 'virsh list' finished with 0 after 0.031746877s
cleaning libvirtd logs...
DATA (filename=output.expected) => NOT FOUND (data sources: variant, test, file)
DATA (filename=stdout.expected) => NOT FOUND (data sources: variant, test, file)
DATA (filename=stderr.expected) => NOT FOUND (data sources: variant, test, file)
PASS 1-type_specific.io-github-autotest-libvirt.conf_file.qemu_conf.set_virtlogd.positive_test.reload_max_size_config

DATA (filename=output.expected) => NOT FOUND (data sources: variant, test, file)
DATA (filename=stdout.expected) => NOT FOUND (data sources: variant, test, file)
DATA (filename=stderr.expected) => NOT FOUND (data sources: variant, test, file)
PASS 1-type_specific.io-github-autotest-libvirt.conf_file.qemu_conf.set_virtlogd.positive_test.set_max_backups

DATA (filename=output.expected) => NOT FOUND (data sources: variant, test, file)
DATA (filename=stdout.expected) => NOT FOUND (data sources: variant, test, file)
DATA (filename=stderr.expected) => NOT FOUND (data sources: variant, test, file)
PASS 1-type_specific.io-github-autotest-libvirt.conf_file.qemu_conf.set_virtlogd.positive_test.reload_max_backups

Command 'virsh list' finished with 0 after 0.047711199s
cleaning libvirtd logs...
DATA (filename=output.expected) => NOT FOUND (data sources: variant, test, file)
DATA (filename=stdout.expected) => NOT FOUND (data sources: variant, test, file)
DATA (filename=stderr.expected) => NOT FOUND (data sources: variant, test, file)
PASS 1-type_specific.io-github-autotest-libvirt.conf_file.qemu_conf.set_virtlogd.positive_test.set_max_size_config

@chunfuwen chunfuwen force-pushed the add_virtlogd_maxclient_cases branch 6 times, most recently from 6d2780a to a8fafea Compare June 7, 2024 07:17
"""
virtlogd_config.max_clients = params.get("low_max_clients")
cmd = ("systemctl status virtlogd | grep 'Active: active'")
ret = process.run(cmd, ignore_status=True, shell=True, verbose=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

ignore_status=True, shell=True are using 9 times , could we set virsh_dargs = {"ignore_status": True, "shell": True} in global

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Define one global variable: debug_param = {'ignore_status': True, 'shell':True, 'verbose':True}, and replace them with this variable

Comment on lines 978 to 999
elif expected_result == "valid_max_clients":
check_valid_max_clients()
elif expected_result == "valid_boundary_max_clients":
check_valid_boundary_max_clients()
elif expected_result == "nclients_occupied_released":
check_nclients_occupied_released()
elif expected_result == "invalid_boundary_max_clients":
check_invalid_boundary_max_clients()
elif expected_result == "guest_runnning_after_virtlogd_crash":
check_guest_runnning_after_virtlogd_crash()
elif expected_result == "reload_new_config":
check_reload_new_config(virtlogd_config)
elif expected_result == "log_filters_not_same_with_loglevel":
check_log_filters_not_same_with_loglevel()
elif expected_result == "reload_max_size_config":
check_reload_max_size_config()
elif expected_result == "set_max_size_config":
check_set_max_size_config()
elif expected_result == "set_max_backups":
check_set_max_backups()
elif expected_result == "reload_max_backups":
check_reload_max_backups()
Copy link
Contributor

@nanli1 nanli1 Jun 12, 2024

Choose a reason for hiding this comment

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

How about merge these lines?such as

if case in ["invalid_virtlogd_conf", "valid_max_clients",
                             "valid_boundary_max_clients", "nclients_occupied_released",
                             "invalid_boundary_max_clients", "reload_new_config",
                             "log_filters_not_same_with_loglevel", "reload_max_size_config",
                             "set_max_size_config",
                             "set_max_backups", "reload_max_backups"]:

check_test = eval("check_%s" % case)
check_test()


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

xx-59118,xx-86131,xx-86144,xx-86515

Signed-off-by: chunfuwen <[email protected]>
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

@dzhengfy dzhengfy merged commit 595840c into autotest:master Aug 29, 2024
5 checks passed
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.

3 participants