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

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

Clean up Zenmap unit tests #85

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

Comments

@dmiller-nmap
Copy link

@dmiller-nmap dmiller-nmap commented Mar 20, 2015

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.
@Amertz08
Copy link

@Amertz08 Amertz08 commented Mar 26, 2015

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?

@dmiller-nmap
Copy link
Author

@dmiller-nmap dmiller-nmap commented Mar 27, 2015

@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/run_tests.py.

@berdario
Copy link

@berdario berdario commented May 5, 2015

Not very useful, but I got this failure

Traceback (most recent call last):
  File "run_tests.py", line 15, in <module>
    start_dir=glob.glob("build/lib.*")[0],
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

@RajithaRama
Copy link

@RajithaRama RajithaRama commented Aug 3, 2016

@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..?

@mohzah
Copy link

@mohzah 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 setup.py install

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

Successfully merging a pull request may close this issue.

None yet
5 participants