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

Something may be wrong in test_run_reference_vmm.py::test_reference_vmm_num_vcpus #207

Open
iscas-glm opened this issue Feb 22, 2022 · 2 comments

Comments

@iscas-glm
Copy link

in test_reference_vmm_num_vcpus testcase,it calls real check function expect_vcpus(vmm_process, expected_vcpus)
which extracts "siblings" in /proc/cpuinfo file,while the number of siblings on a processor is the total number of execution units within that processor,not the meaning of real physical vcpus.
If the test sample is as problematic as I say, this line should be changed as:
vmm_process.stdin.write(b'cat /proc/cpuinfo| grep "physical id"|wc -l\n')

@andreeaflorescu
Copy link
Member

We should indeed think about a better way to write this test such that it works as expected on both hyperthreading enabled & disabled hosts. We do not necessarily care about how those vcpus are arranged in a topology (i.e. if we have 2 threads per core or not), in this case we should just care about the number of configured vcpus being the same number of vcpus we're seeing in the host. We can further extend the test to also take into account the topology.

Are you interested in submitting a fix?

@iscas-glm
Copy link
Author

We should indeed think about a better way to write this test such that it works as expected on both hyperthreading enabled & disabled hosts. We do not necessarily care about how those vcpus are arranged in a topology (i.e. if we have 2 threads per core or not), in this case we should just care about the number of configured vcpus being the same number of vcpus we're seeing in the host. We can further extend the test to also take into account the topology.

Are you interested in submitting a fix?

I'd love to, if you don't mind that I'm new at this project.
In fact, I've only been working with the Rust-Vmm project for a while
and found that the test sample failed when I replicated test_run_reference_vmm.py::test_run_reference_vmm.
Early I started by trying to send the following command from the test function to the child process that started the VM

cat /proc/cpuinfo| grep "physical id"|wc -l

But it seems that the vmm_process.stdin.write() function can only write 32 characters to the terminal, and I don't know why.

I ended up getting the number of virtual machine instance cpus in a different way.

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

No branches or pull requests

2 participants