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

Clean up Zenmap unit tests #85

dmiller-nmap opened this issue Mar 20, 2015 · 5 comments

Clean up Zenmap unit tests #85

dmiller-nmap opened this issue Mar 20, 2015 · 5 comments


Copy link

Lots of Zenmap's component Python modules have unit tests of some sort or other, but many are just "run this function if __name__=='__main__'" type of things. We currently use the test discovery built in to Python 2.7's unittest library, so this task could be taken in a few different steps:

  1. Convert existing tests to unittest test cases so that autodiscovery can pick them up.
  2. Add new test cases for functions and modules not covered by any tests.
  3. Use a more robust testing structure (like a zenmap/tests/ directory) so we don't rely on autodiscovery, which doesn't work on Python 2.6 and earlier.
Copy link

I'd like to work on this for the SoC2015. My questions being given a full-time commitment to this how long would something like this take?

Is there a list of all the functions and modules categorized into either your step 1 or step 2 categories?

Where are the current unittest located?

Copy link

@Amertz08 I would anticipate that this would take about 2 or 3 weeks of full-time work, but I'm a bad estimator of other people's time budgets. The modules are in the zenmap/ directory under zenmapGUI, zenmapCore, and radialnet. The existing unittest-compatible tests are discovered and run with zenmap/tests/

Copy link

berdario commented May 5, 2015

Not very useful, but I got this failure

Traceback (most recent call last):
  File "", line 15, in <module>
IndexError: list index out of range
make: *** [zenmap_check] Error 1

The problem is that the build directory doesn't exist.
Assuming that zenmap isn't enabled by default, I didn't configure to build it (that is, my configure command was just ./configure --with-libpcap=included). I have both python (Python2) and python3 executables on my system

Copy link

@dmiller-nmap I like to work on this. Not fulltime. But when i have time i will do it. It's ok to use PyUnit for this write..?

Copy link

mohzah commented Mar 28, 2017

@berdario probably too late to reply but may be useful for someone else
build directory will be created if you run python install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

5 participants