Skip to content
This repository has been archived by the owner on Nov 29, 2021. It is now read-only.

Fix get_count_total(). Consider 0 value set by the server. #366

Merged
merged 2 commits into from
Mar 10, 2021

Conversation

jjnicola
Copy link
Member

@jjnicola jjnicola commented Mar 9, 2021

What:
Fix get_count_total(). Consider 0 value set by the server.

Why:
Consider the possibility that the server finds 0 alive hosts, and it must not
be overwritten with the value calculated by ospd from the target.
None means that it was not set, 0 if set by the server and must not be overwritten.

How:
Start a scan with a single host name in the target which can't be resolved. Without the patch it ends as interrupted. With the patch the scan finishes as expected.

Checklist:

Consider the possibility that the server finds 0 alive hosts, and it must not
be overwritten with the value calculated by ospd from the target.
None means that it was not set, 0 if set by the server and must not be overwritten.
@jjnicola jjnicola requested a review from bjoernricks as a code owner March 9, 2021 15:01
@jjnicola jjnicola requested a review from ArnoStiefvater March 9, 2021 15:02
@codecov
Copy link

codecov bot commented Mar 9, 2021

Codecov Report

Merging #366 (480bfb1) into ospd-20.08 (c7c195f) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           ospd-20.08     #366   +/-   ##
===========================================
  Coverage       73.94%   73.94%           
===========================================
  Files              23       23           
  Lines            2610     2610           
===========================================
  Hits             1930     1930           
  Misses            680      680           
Impacted Files Coverage Δ
ospd/scan.py 92.59% <100.00%> (ø)

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 c7c195f...480bfb1. Read the comment docs.

Copy link
Contributor

@bjoernricks bjoernricks left a comment

Choose a reason for hiding this comment

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

Would it be possible to ensure this behavior with a test?

@jjnicola jjnicola marked this pull request as draft March 10, 2021 07:14
@jjnicola jjnicola marked this pull request as ready for review March 10, 2021 07:38
@jjnicola jjnicola requested a review from bjoernricks March 10, 2021 07:38
@bjoernricks bjoernricks merged commit 45fd1b3 into greenbone:ospd-20.08 Mar 10, 2021
@jjnicola jjnicola deleted the unresolved branch May 26, 2021 10:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants