-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2699 from lunkwill42/feature/snmpv3-management-pr…
…ofile Add an SNMPv3 management profile type
- Loading branch information
Showing
4 changed files
with
164 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
from nav.web.seeddb.page.management_profile.forms import SnmpV3Form | ||
|
||
|
||
class TestSnmpv3Form: | ||
def test_when_seclevel_is_noauth_then_it_should_not_require_auth_password(self): | ||
form = SnmpV3Form( | ||
dict( | ||
sec_level="noAuthNoPriv", | ||
auth_protocol="MD5", | ||
sec_name="foo", | ||
auth_password="", | ||
) | ||
) | ||
assert form.is_valid() | ||
|
||
def test_when_seclevel_is_auth_then_it_should_require_auth_password(self): | ||
form = SnmpV3Form( | ||
dict( | ||
sec_level="authNoPriv", | ||
auth_protocol="MD5", | ||
sec_name="foo", | ||
auth_password="", | ||
) | ||
) | ||
assert not form.is_valid() | ||
|
||
def test_when_seclevel_is_priv_then_it_should_require_priv_password(self): | ||
form = SnmpV3Form( | ||
dict( | ||
sec_level="authPriv", | ||
auth_protocol="MD5", | ||
sec_name="foo", | ||
auth_password="bar", | ||
) | ||
) | ||
assert not form.is_valid() | ||
|
||
def test_when_seclevel_is_priv_then_it_should_accept_priv_password(self): | ||
form = SnmpV3Form( | ||
dict( | ||
sec_level="authPriv", | ||
auth_protocol="MD5", | ||
sec_name="foo", | ||
auth_password="bar", | ||
priv_password="cromulent", | ||
) | ||
) | ||
assert form.is_valid() |