-
Notifications
You must be signed in to change notification settings - Fork 62
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
Modify audit and policy #332
Conversation
Codecov Report
@@ Coverage Diff @@
## master #332 +/- ##
=======================================
Coverage 97.46% 97.47%
=======================================
Files 20 20
Lines 4221 4235 +14
=======================================
+ Hits 4114 4128 +14
Misses 107 107
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.
Sorry i wasn't fast enough. The PR contains a lot of copy&paste mistakes.
@@ -0,0 +1,222 @@ | |||
# -*- coding: utf-8 -*- | |||
# Copyright (C) 2018 Greenbone Networks GmbH |
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.
# Copyright (C) 2018 Greenbone Networks GmbH | |
# Copyright (C) 2020 Greenbone Networks GmbH |
|
||
from gvm.errors import RequiredArgument, InvalidArgument, InvalidArgumentType | ||
|
||
from gvm.protocols.gmpv7 import HostsOrdering |
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.
from gvm.protocols.gmpv7 import HostsOrdering | |
from gvm.protocols.gmpv9 import HostsOrdering |
@@ -0,0 +1,60 @@ | |||
# -*- coding: utf-8 -*- | |||
# Copyright (C) 2018 Greenbone Networks GmbH |
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.
# Copyright (C) 2018 Greenbone Networks GmbH | |
# Copyright (C) 2020 Greenbone Networks GmbH |
@@ -0,0 +1,189 @@ | |||
# -*- coding: utf-8 -*- | |||
# Copyright (C) 2018 Greenbone Networks GmbH |
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.
# Copyright (C) 2018 Greenbone Networks GmbH | |
# Copyright (C) 2020 Greenbone Networks GmbH |
@@ -0,0 +1,113 @@ | |||
# -*- coding: utf-8 -*- | |||
# Copyright (C) 2018 Greenbone Networks GmbH |
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.
# Copyright (C) 2018 Greenbone Networks GmbH | |
# Copyright (C) 2020 Greenbone Networks GmbH |
'</modify_task>' | ||
) | ||
|
||
def test_modify_task_invalid_schedule_periods(self): |
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.
def test_modify_task_invalid_schedule_periods(self): | |
def test_modify_audit_invalid_schedule_periods(self): |
with self.assertRaises(InvalidArgument): | ||
self.gmp.modify_audit(audit_id='t1', schedule_periods=-1) | ||
|
||
def test_modify_task_with_observers(self): |
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.
def test_modify_task_with_observers(self): | |
def test_modify_audit_with_observers(self): |
'</modify_task>' | ||
) | ||
|
||
def test_modify_task_invalid_observers(self): |
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.
def test_modify_task_invalid_observers(self): | |
def test_modify_audit_invalid_observers(self): |
with self.assertRaises(InvalidArgumentType): | ||
self.gmp.modify_audit(audit_id='t1', observers='foo') | ||
|
||
def test_modify_task_with_preferences(self): |
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.
def test_modify_task_with_preferences(self): | |
def test_modify_audit_with_preferences(self): |
'</modify_task>' | ||
) | ||
|
||
def test_modify_task_invalid_preferences(self): |
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.
def test_modify_task_invalid_preferences(self): | |
def test_modify_audit_invalid_preferences(self): |
What:
Added modifiers for Audits and Policies:
modify_audits
modify_policy_set_nvt_preference
modify_policy_set_name
modify_policy_set_comment
modify_policy_set_scanner_preference
modify_policy_set_nvt_selection
modify_policy_set_family_selection
Why:
These API calls are missing.
How:
Using the
modify_task
andmodify_config_
Checklist: