Skip to content
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

Add failing test for parsing top-level port in IPv4 records #10

Merged
merged 3 commits into from
Jun 21, 2017

Conversation

cdzombak
Copy link
Contributor

@cdzombak cdzombak commented Jun 20, 2017

This PR adds a failing test exposing the issue @dadrian and I tried to work around in #9.

The schema in the test_parses_ipv4_records test case is loosely adapted from the full ipv4_host + ztag_ssh_banner schema from zmap/ztag#68. The fixture JSON is a stripped-down version of the modified ZTag output @dadrian and I used to test zmap/ztag#68 (see https://gist.github.com/cdzombak/aba9071ed41ebb4a6fbba36259457d30).

Running tests (python setup.py test or nosetests .) gives the following failure:

======================================================================
ERROR: test_parses_ipv4_records (zschema.tests.CompileAndValidationTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/cdzombak/code/zmap/zschema/zschema/tests.py", line 323, in test_parses_ipv4_records
    ipv4_host_ssh.validate(json_fixture('ipv4-ssh-record'))
  File "/Users/cdzombak/code/zmap/zschema/zschema/compounds.py", line 194, in validate
    if subkey not in self.definition:
  File "/Users/cdzombak/code/zmap/zschema/zschema/keys.py", line 19, in __eq__
    return self.port.__eq__(other.port)
AttributeError: 'unicode' object has no attribute 'port'

@zakird zakird merged commit 039a0d3 into master Jun 21, 2017
@cdzombak cdzombak deleted the cdz/ipv4-schema-validation-test branch June 21, 2017 14:54
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