-
Notifications
You must be signed in to change notification settings - Fork 36
Conversation
Allows to execute a external program/script and get the response. The program must be named 'gvmcg' and should receive up to 3 arguments called start, end and titles. Example with gvm-cli: ``` gvm-cli --protocol OSP socket --socketpath=/run/ospd/openvas.sock --xml "<get_performance start='0' titles='titles'/>" ```
c50a0c4
to
82b2b2a
Compare
Codecov Report
@@ Coverage Diff @@
## master #131 +/- ##
==========================================
+ Coverage 68.38% 68.87% +0.48%
==========================================
Files 12 12
Lines 1705 1738 +33
==========================================
+ Hits 1166 1197 +31
- Misses 539 541 +2
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one nitpicking change :-)
ospd/ospd.py
Outdated
titles = scan_et.attrib.get('titles') | ||
|
||
cmd = list() | ||
cmd.append('gvmcg') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be sumarized in one line
cmd.append('gvmcg') | |
cmd = ['gvmcg'] |
ospd/ospd.py
Outdated
end = scan_et.attrib.get('end') | ||
titles = scan_et.attrib.get('titles') | ||
|
||
cmd = list() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cmd = list() |
cmd = secET.fromstring( | ||
'<get_performance start="a" end="0" titles="mem"/>') | ||
|
||
self.assertRaises( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I would use the with statement for assert raises (see https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertRaises) but it's up to you :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other tests don't use the with statement for assert raises neither. I will do this in a future PR.
Allows to execute a external program/script and get the response.
The program must be named 'gvmcg' and should receive up to 3 arguments
called start, end and titles.
Example with gvm-cli: