Skip to content

Comments

Pythonify shunt setup methods and integrate into tests#927

Merged
anurag6 merged 16 commits intofaucetsdn:masterfrom
anurag6:shunt
Sep 29, 2021
Merged

Pythonify shunt setup methods and integrate into tests#927
anurag6 merged 16 commits intofaucetsdn:masterfrom
anurag6:shunt

Conversation

@anurag6
Copy link
Collaborator

@anurag6 anurag6 commented Sep 29, 2021

No description provided.

@anurag6 anurag6 marked this pull request as draft September 29, 2021 01:32
@codecov
Copy link

codecov bot commented Sep 29, 2021

Codecov Report

Merging #927 (9281e2d) into master (f2f204d) will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #927      +/-   ##
==========================================
- Coverage   82.24%   82.21%   -0.03%     
==========================================
  Files          45       46       +1     
  Lines        5637     5774     +137     
==========================================
+ Hits         4636     4747     +111     
- Misses       1001     1027      +26     
Flag Coverage Δ
ata 62.74% <ø> (+0.38%) ⬆️
aux 67.75% <ø> (+0.11%) ⬆️
base 65.91% <ø> (+0.30%) ⬆️
dhcp 67.01% <ø> (+0.14%) ⬆️
many 66.83% <ø> (-0.25%) ⬇️
mud 71.72% <ø> (-0.03%) ⬇️
switch 67.33% <ø> (+0.32%) ⬆️
topo 66.00% <ø> (+0.15%) ⬆️
unit 32.62% <ø> (-0.25%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
daq/traffic_analyzer.py 86.50% <0.00%> (-3.18%) ⬇️
daq/acl_state_collector.py 80.82% <0.00%> (-2.74%) ⬇️
daq/host.py 91.14% <0.00%> (ø)
daq/container_gateway.py 94.02% <0.00%> (ø)
daq/tcpdump_helper.py 78.51% <0.00%> (ø)
daq/runner.py 84.85% <0.00%> (+0.09%) ⬆️
daq/topology.py 96.09% <0.00%> (+0.18%) ⬆️
daq/network.py 95.35% <0.00%> (+1.95%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f2f204d...9281e2d. Read the comment docs.

while batch_start <= len(jobs):
batch_end = batch_start + batch_size
if batch_end > len(jobs):
batch_jobs = jobs[batch_start:]
Copy link
Collaborator

Choose a reason for hiding this comment

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

this if is unnecessary. Python will slice the array correctly if batch_end > array length

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

MAkes sense. Changed.

capture: Prints out and captures stdout and stderr output of command
docker_container: Set if command needs to be run within a docker container
returns:
return code of command, stdout, stderr
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are the return values used anywhere? It looks like everywhere that calls run_cmd discard the return values.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

None so far, but it could be used for debugging/checking if the command went through. Bound to be useful in future dev work. It is derived from the ShellCommandHelper in Forch.

@anurag6 anurag6 marked this pull request as ready for review September 29, 2021 06:29
def build_vxlan_ssh_conn(conn_params):
"""
Args:
conn_params: JSON. Format:{
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not important but I think this can be a dataclass instead.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was planning to turn it into a proto in the future. Will add a TODO.

@anurag6 anurag6 merged commit 556b137 into faucetsdn:master Sep 29, 2021
@anurag6 anurag6 deleted the shunt branch September 29, 2021 16:57
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.

2 participants