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

Adding python test for net device #232

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ramyak-mehra
Copy link
Contributor

@ramyak-mehra ramyak-mehra commented Sep 7, 2022

closes #224

Signed-off-by: Ramyak mehra [email protected]

Summary of the PR

This PR adds support for configuring a net device on the host and guest and verifying that net device works on the vm

Requirements

Before submitting your PR, please make sure you addressed the following
requirements:

  • All commits in this PR are signed (with git commit -s), and the commit
    message has max 60 characters for the summary and max 75 characters for each
    description line.
  • All added/changed functionality has a corresponding unit/integration
    test.
  • Any newly added unsafe code is properly documented.

ramyak-mehra and others added 2 commits October 26, 2022 07:22
version 16 has support for iproute2 package

Signed-off-by: Ramyak Mehra <[email protected]>
@ramyak-mehra
Copy link
Contributor Author

I wanted to get a review on this, I know this is an old PR, I will do a rebase and push the with latest commits once everything seems fine from the code perspective

Copy link
Member

@andreeaflorescu andreeaflorescu left a comment

Choose a reason for hiding this comment

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

Sorry for the late review.

Comment on lines +232 to +233
# So we split the command at 63 bytes. 1 extra is reserved for \r at the end.
# empty string is of size 33. sys.getsizeof(b'') = 33.
Copy link
Member

Choose a reason for hiding this comment

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

Hmmm, this is rather strange. Why would the empty string require 33 bytes? Do you know why that is the case?


vmm_process.stdin.write(cmd_i)
vmm_process.stdin.flush()
time.sleep(1)
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need the sleep?

# booting the vmm.
expect_string(vmm_process,prompt)

add_addr_cmd = f"ip addr add {guest_ip_with_mask} dev eth0"
Copy link
Member

Choose a reason for hiding this comment

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

The name of the interface should also be sent as a parameter because it depends on the image with which you test.


# verifying that guest interface is setup properly
output = run_cmd_inside_vm(show_interface_cmd.encode() , vmm_process ,prompt.encode() , timeout=10 )
output = b''.join(output).decode()
Copy link
Member

Choose a reason for hiding this comment

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

Why is this needed?

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.

Add support for virtio net for aarch64
2 participants